Skip to main content
Context is everything you store in HydraDB: knowledge and memories. Each stored unit is a source (an uploaded document, an app source, or a memory). Ingestion returns an 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 as context.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

  1. Ingest context: POST /context/ingest. The response returns an ID for each source.
  2. Wait for indexing: poll GET /context/status with those IDs. A source is searchable at graph_creation and its graph is ready at completed. errored means indexing failed.
  3. Retrieve context: POST /query.
  4. 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" on POST /query searches both from the same scope.
  • IDs: /context/ingest returns an ID for each source. To assign your own, set id in the document_metadata, app_knowledge, or memories item. 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. In thinking mode, a query returns the linked sources in additional_context alongside the matching chunks. Set relations on the same document_metadata item as the file’s metadata:
Python SDK