Queued ingestion
Move graph construction behind BullMQ and Redis while preserving correct visibility, retries, and shutdown behavior.
When queue mode helps
Use queue mode when segmentation, extraction, and embedding make foreground response latency unacceptable. The LLM response can complete while workers build graph memory afterward.
Configure the queue
const agent = new MemoGrafterAgent({
db: { connectionString: process.env.DATABASE_URL! },
llm,
embedder,
queue: {
redisUrl: process.env.REDIS_URL!,
removeOnComplete: true,
removeOnFail: false,
},
});Acceptance versus visibility
In queue mode, an awaited ingestion call confirms that the job was accepted. It does not mean topic and memory nodes are already searchable. Reads must wait for the relevant worker job to complete before assuming new memory is visible.
Retry safety
Worker operations
Failure behavior
Redis connection problems are warnings in normal chatbot invocation paths, but production systems still need alerting because accepted-looking conversations may not become graph memory. Required database or provider failures during worker execution should surface through failed-job monitoring.