Skip to main content
Use AsyncConnectorClient when your RAG pipeline uses asyncio β€” LangChain, LlamaIndex, FastAPI, or any framework where embedding and vector store calls are already async.

Background task inside FastAPI


Sync pipeline

If your pipeline is synchronous, use ConnectorClient. The SSE reader and your callback run on separate threads β€” blocking calls (embedding APIs, database writes) are safe.

Strategy: actions vs. summaries

Index actions

Upsert each ActionsPayload as it arrives β€” granular, session-level embeddings. Good for detailed retrieval (β€œwhat did this user click last session?”).

Replace with summaries

When a SummaryPayload arrives (payload.replaces actions), replace the raw embeddings with a single prose embedding. Keeps your context window compact.
You can do both at once β€” index actions immediately, then overwrite with the summary when it arrives: