Frontier Foundry

Knowledge Graphs

The Library · Context Engineering & Memory

Storing facts as linked entities so agents can traverse relationships.

Also called: knowledge graph, graphrag, graph rag, graph memory. In the glossary.

How it works, as a machineThe String Board · facts

Follow one fact from a source passage to an answer with its path, in a case room with a string board wall.

  1. Pull out the triples
  2. Merge the twins
  3. Tie it to its source
  4. Light the seed nodes
  5. Walk the strings
  6. Hand over the path
Play Knowledge Graphs

Knowledge Graphs in plain words

A knowledge graph stores facts as things and the links between them: this person works at that company, which makes this product. An agent can follow the links to answer questions that need several hops. It gives structure that a pile of documents lacks, and it has to be built and kept current.

An analogy

A family tree pinned to the wall. Each name is a card and each string a relationship, so finding a great-aunt's grandson means tracing strings, not rereading every letter in the attic. The tree is only useful if someone keeps adding the new babies.

How Knowledge Graphs connects

3 typed relations in the knowledge graph

Builds on

Makes possible

See Knowledge Graphs in the knowledge graph

What the sources say

2 parts · 12 sources · updated 2026-11-27

A knowledge graph stores facts as entities and the links between them, built from text by a language model and queried by walking the links. The sources describe building it (extract, merge twins, tie each fact to its source), and reading it (seed by similarity, walk the links, hand back the path). What they warn about is a graph full of twins and facts that cannot say where they came from.

Building the board: from a passage to a pinned fact

A source passage becomes triples, the twins are merged into one node each, and each fact is tied to the sources it came from. A graph that skips the merge or the tie answers counts wrong or cannot say where a fact came from.

  1. The extraction bench reads a chunk and writes typed subject-verb-object triples from a fixed schema.
  2. The merge table folds twin entities into one node, and the node keeps every source link.
  3. The episode thread rack ties each fact to the sources it came from and dates it when new data replaces it.
43M papers, 157M entities, 3B triplets
Size of one research knowledge graph built from papers in 26 disciplines, as reported by its authors Hugging Face
500
Chunk size set in a workshop graph builder, with a chunk overlap so that nothing is missed between chunks Nyah Macklin
+12.5%
Relative harmonic-mean gain of a 7B extractor over a 32B model on knowledge-graph construction, as reported by the RAGU authors Hugging Face
  • A graph is built from text in five moves: gather the sources, split them into chunks, embed each chunk, have a language model extract entities and relationships, then write the graph. Nyah Macklin
  • A schema of node types and relationship patterns handed to the builder guides the language model so that it does not make up new node and relationship types. Nyah Macklin
  • Asked for free subject-predicate-object triples, an extractor returns a graph that is not worth querying; given a schema to fill, node and edge types are consistent and relationships can be queried. Tim Ainge

When it breaksRerun the builder, double the lessons. In a live workshop the agent was asked how many lessons a course has and answered 30. The graph held 15 lessons: the speaker had run the graph builder a second time and it had written a second copy of each. Nyah Macklin

Walking the strings: from a question to a cited answer

A question lands on seed nodes by vector similarity, the agent walks the links hop by hop, facts whose sources fail the rule are turned back, and the answer goes out with the path it walked.

  1. The seed beacon tower finds the nodes nearest the question by vector similarity.
  2. The string board walks the links from the seed nodes, hop by hop, with a graph query.
  3. The source tag turnstile turns back facts whose parent sources fail the rule for the question.
  4. The path receipt desk hands over the answer with the path of links it walked.
3 hops
Depth at which the speaker says GraphRAG becomes imperative over vector-only RAG Nyah Macklin
top 5
Chunks the workshop agent pulls back in a vector search before the graph query runs Nyah Macklin
at least 100K tokens per round
Tokens an assistant loads each round when its memory is a set of markdown files, as the speaker reports for his own agents Stephen Chin
50+ turns
Agent turns after which the graph-guided investigation produced what an analyst made in three or four weeks, in twenty or thirty minutes, as the speakers report Abhilash Asokan
up to 23%
Gain over strong baselines on two long-memory benchmarks, with lower token and runtime cost, as reported by the paper authors Hugging Face
~71x fewer tokens
Author claim for tokens per query when a model reads a knowledge graph instead of the raw files; disputed by commenters AINews
  • GraphRAG is RAG whose retrieval path includes a knowledge graph; plain vector RAG usually suffices when a search engine could answer, and the graph becomes imperative at three or more hops or when data must be aggregated across documents. Nyah Macklin
  • The speaker advises using both graph and vector, not graph alone: the graph does not replace the vector layer, and together they give the benefits of both. Nyah Macklin
  • Similarity in vector space is not the same as a relationship, so vector-only lookup returns related-looking facts, makes silly mistakes and cannot follow long multi-hop chains. Stephen Chin

Open questionDoes an agent need a graph for memory, or will a text file do?

  • Memory kept as markdown files wastes tokens every round and fails at large scale; keep it in a graph and walk it. Stephen Chin
  • Put everything in a text file: language models read text well, though retrieval over very large data takes work. Latent Space

Sources

12 in all

More in Context Engineering & Memory

The Library: the whole area
  • Context EngineeringDeciding what goes into a model's limited context window, when, and in what form.
  • Long ContextModels that read very long inputs (hundreds of thousands to millions of tokens).
  • Retrieval-Augmented GenerationFetching relevant documents at question time and putting them in the prompt.
  • EmbeddingsVectors that place similar meanings near each other, used for search and clustering.
  • Agent MemoryLetting agents keep and recall information across sessions.
  • Prompt EngineeringWriting instructions and examples that steer a model's behavior.
  • Prompt CachingReusing computation for repeated prompt prefixes to cut cost and latency.