The AI Ticket Support System uses Redis as the message broker for BullMQ, Node.js’s production-grade job queue library. When a support ticket is created, the HTTP handler immediately returns a response to the caller and then enqueues an asynchronous job for GraphRAG entity extraction. This keeps ticket creation fast and decouples the heavier NLP work — entity identification, embedding generation, and knowledge graph updates — from the critical request path.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/yocxy2/2a/llms.txt
Use this file to discover all available pages before exploring further.
Starting Redis
Option A — standalone Docker container
.env.example values.
Option B — Docker Compose (recommended)
Thedocker-compose.yml file already declares a redis service using the redis:7-alpine image. Running docker compose up starts Redis alongside Postgres and the backend automatically — no separate container management is needed.
Queue: entity-extraction
When a ticket is successfully persisted to the database, the ticket controller adds a job namedextract-entities to the entity-extraction BullMQ queue with the following payload:
Worker
The entity extraction worker —entityExtractionWorker.ts — is imported directly in the backend’s index.ts entry point, so it starts automatically when the backend server boots. No separate process is required for standard deployments.
If you want to run the worker in isolation (for example, to scale it independently of the HTTP server, or to debug extraction jobs without starting the full API), you can launch it as a standalone process:
Worker instance that listens on the entity-extraction queue with a concurrency of 5. For each extract-entities job it receives, it:
- Calls the OpenAI API to identify named entities in the ticket text.
- Generates a
text-embedding-3-smallvector for each entity. - Upserts
Entityrows and createsEntityRelationedges in the database.
Connection settings
Redis connection parameters are read directly from environment variables at startup insidesrc/lib/redis.ts:
redis client instance is shared by both the queue producer (ticket controller) and the BullMQ worker. Configure the connection via the following environment variables:
| Variable | Default | Description |
|---|---|---|
REDIS_HOST | localhost | Hostname of the Redis server |
REDIS_PORT | 6379 | Port the Redis server listens on |
REDIS_PASSWORD | (empty) | Auth password; leave empty for no-auth setups |
Fault tolerance
Redis is treated as a non-critical dependency for the core ticket workflow. If the Redis connection is unavailable at the moment a ticket is created, theentityQueue.add call in the controller is wrapped in a try/catch block. The error is logged to the server console and the ticket creation response is unaffected — the HTTP 201 status is still returned to the caller.
This design means:
- Ticket creation always succeeds as long as Postgres is reachable.
- AI classification (GPT-4o-mini category + suggested response) always runs synchronously and is unaffected by Redis.
- Entity extraction (GraphRAG) is best-effort; jobs that were not enqueued due to a Redis outage are not retried automatically once Redis recovers.