- Runtime ingestion feeds content in as it is generated during live agent interactions, one turn at a time.
- Bootstrap ingestion loads pre-existing data in bulk: historical conversations, documentation, migrations from another system.
instance.send_message() are persisted to conversation history, and when the conversation compacts, those raw turns are promoted into the same pipeline described below: compaction promotion.It is deferred but not conditional: compaction fires at 3,000 tokens, 10 messages, or 5 minutes of inactivity, so every conversation reaches this pipeline. That is why the Agent Integration needs no ingestion call: agents report turns and Synap forms the memory. Use the two paths below for content that is not a conversation turn, and never for text you already streamed, which would extract it twice.The ingestion pipeline
Every document you send, via either path, flows through the same stages before it becomes a memory you can retrieve:Categorization
document_type and selects the appropriate extraction logic. A chat conversation, an email, and a PDF are each processed differently.Extraction
Chunking
Entity resolution
Storage
Ingestion mode
mode accepts long-range (the default) or fast on both ingestion paths. The server accepts either value, but in the current release nothing downstream reads it: both run the same pipeline, so the choice does not change what is extracted or how long a write takes. You can leave it out. See Ingestion mode.
The ingestion mode is also distinct from the retrieval mode you pick when querying, which does change what a fetch does (fast = vector search; accurate = vector search + graph traversal + LLM subquery decomposition + reranking). See Retrieval Modes.
Document types
document_type tells the pipeline what kind of content it is looking at and which extraction logic to apply. Both paths accept the same set:
Scoping every document
user_id and customer_id determine where a memory is stored in the scope hierarchy, which in turn controls who can retrieve it later. On B2C agents, customer_id is resolved automatically and you only pass user_id; on B2B agents you pass both. The same scoping rules apply on both ingestion paths. See Memory Scopes for the full hierarchy.
Runtime ingestion
Runtime ingestion feeds content into Synap as it is generated during live agent interactions. This is the primary ingestion path for most applications. After each conversation turn (or at the end of a conversation) your application callssdk.memories.create() to send the turn through the pipeline. The call returns immediately, so your agent never waits for ingestion before responding to the user; fast is the natural default here.
Your agent receives a user message
Your agent retrieves context from Synap
Your agent generates and delivers a response
Your agent ingests the turn
sdk.memories.create(). This returns immediately and does not block the user experience.Synap processes in the background
The SDK call
Fitting it into the agent loop
Include speaker labels in conversation content
Include speaker labels in conversation content
User: and Assistant: labels. The pipeline uses them to identify who said what, which is critical for accurate preference detection and entity attribution.Use consistent user and customer IDs
Use consistent user and customer IDs
user_id (and customer_id on B2B) consistent across all calls for the same user and organization. Inconsistent IDs fragment the store into isolated pockets of context that cannot be retrieved together. Derive them from your auth system.Ingest after the response is delivered
Ingest after the response is delivered
Handle ingestion errors gracefully
Handle ingestion errors gracefully
Set document_id for idempotent retries
Set document_id for idempotent retries
document_id to prevent duplicate memories. Derive it from your conversation or message identifier.Bootstrap ingestion
Bootstrap ingestion loads data you already have (past conversations, documentation, customer records) in bulk withsdk.memories.batch_create(). It shares the pipeline above, runs at BOOTSTRAP priority, defaults to long-range (which behaves the same as fast), and can run alongside your live agent.
For the batch method, what to check before a large load, and a full example, see Import existing history.