1. What it is
Bring Your Own Graph (BYOG) lets you attach agraph_payload (your own entities and relations) to a source (a document, an app_knowledge source, or a memory) on POST /context/ingest. For that source, HydraDB uses your graph instead of running LLM extraction.
Your graph uses the same source to relation to target triplets as extracted graphs. It appears in graph_context, linked to the source’s chunks; no query changes are needed.
2. When to use it
Use BYOG when you already know the relationships and want them used verbatim:- You maintain a graph of known relationships or a database export and want those exact facts in HydraDB.
- You need deterministic, reproducible relations rather than model-extracted ones.
- You want faster ingestion: a BYOG document skips the extraction LLM call entirely.
3. The graph_payload shape
graph_payload is a JSON string: a map keyed by source id (a document’s document_metadata id, an app_knowledge item’s id, or a memory’s id), where each value is that source’s graph (an entities map + a relations list). Attach graphs to several sources in one request by adding more keys.
- Top-level key: the
idof a source in the same request. The source must carry an explicitid, and a key matching no source returns400. A request is eithertype=knowledgeortype=memory, so its keys target only that type’s sources. entities: a map keyed by a caller-local id. Each entity has aname(required),type,namespace, and optionalidentifier(an external id, display-only). The entity key is just a handle for relations to reference; it is not stored.relations: a list of edges.sourceandtargetare entity-map keys;predicateis any plain string;contextandtemporal_detailsare optional per relation.- No
chunk_id: you never supply or see chunk ids; HydraDB resolves them server-side when it links your relations to the source’s chunks. - Normalized names: entity names are lowercased so they match at query time, just like extracted entities. Entities that no relation references are dropped.
4. How it behaves
- Replace mode: A BYOG document’s graph is your
graph_payload; LLM extraction is skipped for it. The document is still chunked and embedded, so it stays fully vector-searchable. - Chunk linking: Each relation is linked to the source’s most relevant chunk(s), so
graph_contextresults hydrate the right passages. Linking is permissive (see Limitations). - Queryable like any graph: Your relations appear in the
/querygraph_contextslice (taggedorigin: "byog"in metadata) and traverse exactly like extracted ones (see Context Graphs). - Durable across re-ingest: Re-ingesting the same source without a
graph_payloadre-applies the stored graph, including on connector re-syncs. It does not run LLM extraction or return an error. To replace the graph, re-ingest with a newgraph_payload.
5. Limits
graph_payload is validated up front; oversized payloads are rejected with 400.
6. Example: multiple sources in one request
graph_payload is a map, so one request can carry graphs for several sources at once: here two documents and one app_knowledge source, each keyed by its own id. Then query, and each source’s triples surface.
graph_context: true:
cURL
graph_context and traverses just like an extracted one. The origin: "byog" tag on the relation marks it as yours:
7. Memories
Memories accept agraph_payload too: send type=memory, give each memory an id, and key the graph by that id. The graph shape is identical; relations link to the memory’s chunks and surface in /query with type=memory and graph_context: true.
cURL
id to receive a graph (an id-less memory gets a server-generated id and can’t be targeted). The memories form field stays plural even though type is the singular memory.
8. Limitations
- Replace, not augment: A BYOG source has no LLM-extracted facts, only the graph you supply (plus normal chunk search).
- Permissive linking leads to possible false positives: Every relation links to its best-matching chunk even if the match is weak; there is no minimum match threshold. A linked relation is sourced (similar to a chunk), not necessarily supported (stated by the source).
- Bulk, one-shot: You supply the whole graph with the source. There is no per-triple add, update, or delete; re-ingest with a new
graph_payloadto change it.
Related
- Context Graphs: the auto-extracted graph BYOG replaces; HydraDB builds it for you, BYOG lets you supply it
- Knowledge: documents, and forceful relations between sources
- Ingest Context: the
graph_payloadform field reference - Query: how chunks and graph context are retrieved together
