id for each source, and the other endpoints in this group take that id.
Endpoint references
SDK methods are listed by their Python names. The TypeScript SDK uses the same names in camelCase, such ascontext.updateSourceMetadata.
Choose an ingest payload
POST /context/ingest accepts three payloads. type picks the store, and within type=knowledge you pick the payload shape:
You can send
documents and app_knowledge in the same request.
Typical call sequence
- Ingest context:
POST /context/ingest. The response returns an ID for each source. - Wait for indexing: poll
GET /context/statuswith those IDs. A source is searchable atgraph_creationand its graph is ready atcompleted.erroredmeans indexing failed. - Retrieve context:
POST /query. - Manage what is stored: list, inspect, update metadata, or delete by ID.
Key concepts
- Knowledge and memories: Knowledge is the documents, app sources, and facts your AI uses. Memories are preferences, decisions, and past conversations. Both live in a collection, and
type: "all"onPOST /querysearches both from the same scope. - IDs:
/context/ingestreturns an ID for each source. To assign your own, setidin thedocument_metadata,app_knowledge, ormemoriesitem. Use IDs to poll status, inspect content, and delete context. - Metadata: Metadata Filters covers metadata fields, ingestion, updates, and filtering.
- Forceful relations: Links you declare between sources with
relations.ids. Inthinkingmode, a query returns the linked sources inadditional_contextalongside the matching chunks. Set relations on the samedocument_metadataitem as the file’s metadata:
Python SDK
Related
- Knowledge: forceful relations: linking sources at ingestion
- Context: memories and knowledge, and when to use which
- Metadata Filters: schema-backed and free-form metadata
- Query: Overview: retrieve ingested context
