Knowledge Graphs
How Nenjo stores explicit source material as graphs of linked documents, and how agents traverse them with metadata-first retrieval.
A knowledge pack is a graph of source documents. It is how explicit reference material — product docs, policies, glossaries, research — is made available to agents for search and citation, without dumping a corpus into every prompt.
Documents are nodes with metadata
Each document is a node that carries metadata, not just text:
selector— a stable dotted name (orientation.nenjo,design.agents) used to reference the document. Selectors are stable agent-visible refs; source paths are pack-local file paths used by the resolver.titleandsummary— let an agent judge relevance without reading the full body.kind— an author-defined category such asorientation,design,resource,build,classification,reference,policy, orentity. This is a routing hint, not a closed platform enum; packs may define their own values.tags— faceted labels likeintent:design,resource:agents,audience:builder.related— typed outbound edges to other documents.
Typed edges make it a graph
The related edges are directional and typed, so traversal carries meaning:
| Edge | Meaning |
|---|---|
references | Points to a relevant related document |
part_of | This document is a component of a larger one |
depends_on | Understanding this requires the target |
related_to | General association |
governs | This document constrains the target |
classifies | This document categorizes the target |
defines | This document specifies the target |
Edges are outbound. If a concept should be reachable from a seed document, the seed must have an outbound edge to it — otherwise traversal will not find it.
How agents traverse: metadata-first retrieval
An agent never loads a whole pack. It is seeded with the pack index (injected into the prompt via the pack's selector, e.g. {{ lib.<pack_slug> }} or {{ pkg.nenjo_ai.packages.knowledge.core }}), then narrows down:
- Seed — the rendered pack index or
list_knowledge_packsprovides the entry points. - Search —
search_knowledgefinds candidate document selectors by metadata. - Traverse —
list_knowledge_neighborsfollows a document's outbound related edges to dependencies and exact rules. - Read —
read_knowledge_docpulls the full body of the selected documents only. - Answer — the agent answers only from the documents it actually read, not from summaries.
This is far cheaper and more precise than naive context stuffing: the agent reads summaries and tags first, walks the graph along typed edges, and loads full content lazily.
Two sources, one model
The same graph structure powers both sources:
- The Library — the platform's source-material surface, where your organization authors and edits knowledge packs (referenced as
{{ lib.<pack_slug> }}). Library items sync into knowledge pack manifests so agents can search, traverse, and read them. - Package knowledge — packs installed through packages, using the
pkg.<scope>.<repo>.<package>.<pack>namespace. Package knowledge is read-only source material; agents should not mutate it.
Knowledge is not memory
Memory stores learned preferences and project facts. Knowledge graphs store explicit source material that should be searched and read before an agent makes source-backed claims. Treat a pack index as a discovery hint, never as full content.

