DocumentStore
DocumentStore persists fully extracted InsuranceDocument records — policies and quotes — and supports querying by carrier, insured name, policy number, and quote number.
DocumentStore to resolve document references in user messages. The extractor writes to it after a successful extraction.
MemoryStore
MemoryStore handles two things: chunked document content for vector search, and conversation history for cross-session continuity. Both are optional but unlock the query agent’s most useful capabilities.
addChunks accepts DocumentChunk[] objects produced by your chunking pipeline. search returns the top-k most relevant chunks for an embedding query. addTurn and getHistory manage per-conversation message history, while searchHistory supports semantic search across past turns.
SourceStore
SourceStore extends SourceRetriever and is the persistence layer for your source grounding evidence. It stores both raw SourceSpan objects and the larger SourceChunk retrieval windows derived from them.
SourceStore implements SourceRetriever, you can pass any SourceStore instance directly to agents and pipelines via the sourceRetriever config option.
SQLite Reference Implementation
ThecreateSqliteStore factory returns a single store object that satisfies DocumentStore, MemoryStore, and SourceStore. It uses SQLite with a local vector similarity index for development and testing.
Application and PCE Stores
Two additional interfaces support stateful multi-step workflows.ApplicationStore persists application pipeline state across multiple email or chat rounds. It stores the current batch of open questions, the insured’s answers so far, and any context writes produced by the pipeline.
BackfillProvider allows the application pipeline to pre-populate answers from prior submissions, existing policies, or external CRM data. Implement this interface to prevent asking the same questions on renewal.
Both interfaces are optional — the application pipeline degrades gracefully without them, treating every session as a fresh start.
Data Flow
The diagram below shows how data moves through CL SDK’s storage layer across a typical extraction and query session.Implementing Your Own Store
Any class that satisfies the interface signatures works. Here is a minimalDocumentStore backed by a Postgres table: