Choose knowledge or memory
Use knowledge for what your AI reasons over: files, wiki pages, tickets, and messages from apps. Use memories for what should carry between conversations: preferences, decisions, and inferred behavior traits. For memories,infer: false (the default) stores what you send. With infer: true, HydraDB extracts facts and preferences from text or dialogue and checks them against what it already holds in that collection, which improves accuracy. Your application chooses what to save; HydraDB does not record interactions you have not sent it.
Choose where the data goes
Create a database before adding context. Collections are created when you first write to them, so there is no separate collection-creation call. If you omitcollection, HydraDB writes to and reads from the default collection only.
For most products, one collection is the right answer. Building a company brain? Put everything in one collection: connect every connector and ingest all your data there, so one query searches all of it. To keep some results away from some users, stay in that one collection and use metadata filters, such as a team field, and access control, the source app’s permissions or your own rules. HydraDB enforces both inside a single search.
Separate collections are for data that should never meet in one query, such as one customer’s memories. Send the same collection name when you search or check indexing status.
Query
Query is how agents read from HydraDB.POST /query searches knowledge, memories, or both, chosen with type: "knowledge", "memory", or "all".
HydraDB’s query is a multi-stage pipeline: metadata filtering, semantic and keyword retrieval, and context graph traversal, in a single call. It returns ranked passages with their sources and the graph around them; your application puts them into the model’s prompt. See Query for the request and every parameter.
A query without acl ignores document permissions. If your app has signed-in users, send each user’s identity as acl, taken from their session on your backend, never from the client.
Filter with metadata
Metadata filters are theWHERE clause of a query: only context whose fields match is considered, for example policies whose status is approved. Declare the fields you filter on in the database’s metadata schema. Use additional_metadata for free-form fields such as a document’s author or URL. See Metadata for both.
Next steps
- Quickstart: create a database, ingest a document and a memory, and query them.
- How to Use API Results: format results and build the model prompt.
