Overview
Ingestion is how you feed data into Synap’s memory system. Every conversation, document, email, or transcript you send throughsdk.memories.create() enters the ingestion pipeline where it is categorized, chunked, entities are extracted and resolved, and the result is persisted across Synap’s vector and graph storage engines.
Ingestion is asynchronous. When you call create(), Synap immediately returns an ingestion_id that you can use to poll the processing status. This design allows high-throughput workloads without blocking your application.
Creating a Memory
Usesdk.memories.create() to send a single document into the ingestion pipeline.
Parameter Reference
The raw content to ingest. For conversations, include the full transcript with speaker labels. For documents, include the full text content.
The type of content being ingested. Determines which extraction and chunking strategies are applied. See Document Types below.
An optional idempotency key. If you submit the same
document_id twice, the second submission updates the existing memory rather than creating a duplicate. Useful for re-ingesting edited documents.The original creation timestamp of the document. If omitted, defaults to the current time. Providing the true creation time improves temporal reasoning during retrieval.
The end-user identifier. Scopes the resulting memory to this user. Memories created with a
user_id are retrievable via sdk.user.context.fetch() and sdk.conversation.context.fetch() when the same user is queried.The customer (organization/tenant) identifier. Scopes the resulting memory to this customer. Use this when multiple users belong to the same customer and should share certain memories.
The ingestion mode. Controls the depth of extraction and processing. See Ingest Modes below.
Arbitrary key-value metadata attached to the memory. Metadata is stored but not indexed for retrieval. Use it for your own bookkeeping (session IDs, agent versions, source systems, etc.).
Response
Unique identifier for this ingestion job. Use with
sdk.memories.status() to track progress.Initial status of the ingestion job. Always
"queued" on creation.The IDs of the memories that will be created. Available immediately so you can reference them before processing completes.
Document Types
Thedocument_type parameter tells the ingestion pipeline which extraction and chunking strategies to apply.
| Document Type | Description | Optimized For |
|---|---|---|
ai-chat-conversation | Multi-turn AI assistant conversations | Speaker turns, intent extraction, preference detection |
document | General text documents | Paragraph chunking, topic extraction |
email | Email messages and threads | Sender/recipient extraction, action items, thread context |
pdf | PDF document content (text extracted) | Section-aware chunking, header/footer handling |
image | Image descriptions or OCR text | Entity extraction from visual content descriptions |
audio | Audio transcriptions | Speaker diarization awareness, temporal markers |
meeting-transcript | Meeting transcription content | Multi-speaker extraction, action items, decisions |
For
image and audio types, you provide the text content (description, transcript, or OCR output), not the raw binary file. Media processing and transcription should be handled upstream of Synap.Ingest Modes
Synap offers two ingestion modes that trade off processing depth against throughput.fast
Optimized for speed. Performs basic chunking, lightweight entity extraction, and vector embedding. Skips deep relationship mapping and advanced categorization.
- Processing time: seconds
- Best for: high-throughput pipelines, real-time chat logging, non-critical data
long-range
Optimized for quality. Runs the full extraction pipeline including deep entity resolution, relationship mapping, preference detection, emotional analysis, and graph storage.
- Processing time: seconds to minutes
- Best for: conversations, documents where deep extraction matters, building long-term user profiles
Code Examples
Ingesting a Conversation
Ingesting a Document
Ingesting with User and Customer Scoping
When bothuser_id and customer_id are provided, the memory is accessible at both scopes. This is useful when a user’s conversation may contain information relevant to the broader organization.
Batch Ingestion
For bulk workloads, usesdk.memories.batch_create() to submit multiple documents in a single request.
The fail_fast Option
Controls batch behavior on validation errors.
False(default): Process all documents. Invalid documents are rejected individually while valid ones proceed.True: Abort the entire batch if any document fails validation. No documents are ingested.
Checking Ingestion Status
Ingestion is asynchronous. Usesdk.memories.status() to poll the processing state of a submitted document.
Ingestion Statuses
| Status | Description |
|---|---|
queued | Document accepted and waiting for processing |
processing | Actively being processed through the ingestion pipeline |
completed | Successfully ingested. Memories are available for retrieval |
failed | Processing failed. Check error_message for details |
partial_success | Some extractions succeeded but others failed. Partial results are available |
The
partial_success status typically occurs with large documents where some chunks process successfully while others encounter extraction errors. The successfully processed portions are still available for retrieval.Updating Memories
Update an existing memory usingsdk.memories.update(). This is useful when the source document has been edited or when you want to append new information.
Merge Strategies
replace
replace
Completely replaces the existing memory content with the new document. Previous extractions are discarded and re-extracted from the new content. Use when the document has been fully rewritten.
append
append
Adds the new content to the end of the existing memory. Previous extractions are preserved, and new extractions are generated only from the appended content. Use when adding new turns to a conversation.
smart-merge
smart-merge
Intelligently merges the new content with the existing memory. The pipeline detects overlapping sections, deduplicates extractions, and reconciles conflicting information by preferring the newer version. Use when the document has been partially edited.
Deleting Memories
Remove a memory and all its associated extractions permanently.Best Practices
Include speaker labels in conversations
Include speaker labels in conversations
Always prefix conversation turns with speaker labels (
User:, Assistant:, or actual names). The ingestion pipeline uses these labels to correctly attribute preferences, facts, and intents to the right participant.Set user_id and customer_id consistently
Set user_id and customer_id consistently
Use stable, deterministic identifiers for
user_id and customer_id. These IDs form the basis of scoped retrieval. Inconsistent IDs fragment the user’s memory across multiple scopes.Use document_id for idempotency
Use document_id for idempotency
When re-ingesting content that may have been submitted before (e.g., webhook retries), always provide a
document_id. This prevents duplicate memories and ensures updates are applied cleanly.Provide document_created_at for historical data
Provide document_created_at for historical data
When backfilling historical conversations or documents, set
document_created_at to the original timestamp. This enables accurate temporal reasoning (“What did the user say last month?”).Choose the right mode for the workload
Choose the right mode for the workload
Reserve
long-range mode for content where deep understanding matters (user conversations, strategic documents). Use fast mode for high-volume, lower-priority data (automated logs, bulk imports).Batch when possible
Batch when possible
For bulk ingestion (backfills, migrations), use
batch_create() with fail_fast=False. This reduces HTTP overhead and allows the pipeline to optimize scheduling.Next Steps
Context Fetch
Query the memories you have ingested for contextual retrieval.
Entity Resolution
Understand how entities are automatically resolved during ingestion.
Context Compaction
Compress long conversations to reduce token costs.
SDK Configuration
Configure SDK behavior, timeouts, and retry policies.