Knowledge Representation for Agent Context
Knowledge Representation for Agent Context: LSE, Knowledge Graphs, Concept Maps, and Document Compression for Large-Scale Context Management
- LSA is superseded by dense embeddings for agent context retrieval. Dense embeddings (SBERT, MiniLM, Model2Vec) consistently outperform LSA on MTEB benchmarks for semantic search, clustering, and retrieval. LSA discards word order, sentence structure, and contextual disambiguation. LSA has residual value for topic modelling and interpretability but should not be a primary retrieval mechanism in new systems. Confidence: high
- GraphRAG (Microsoft, Edge et al. 2024, arXiv:2404.16130) solves the global-query problem via Leiden community detection and LLM community summaries. Standard RAG cannot answer corpus-level sensemaking queries. GraphRAG's entity graph + community summaries + map-reduce significantly outperforms standard RAG on comprehensiveness and diversity for global queries. Critical limitation: batch-rebuild-only updates make it unsuitable for frequently updated corpora. Confidence: high
- LightRAG (arXiv:2410.05779, EMNLP 2025) is the practical successor to GraphRAG for dynamic corpora. LightRAG supports incremental updates (no full rebuild), dual-level retrieval (coarse global + fine entity-level), and achieves 10–100× lower token costs while matching or exceeding GraphRAG accuracy. For a growing research corpus, LightRAG is preferred. Confidence: high
- HippoRAG's PPR-based retrieval achieves up to 20% improvement on multi-hop QA benchmarks at 10–30× lower cost than iterative retrievers. Personalised PageRank traversal from query-matched seed nodes surfaces cross-document associative chains without expensive iterative query cycles. Best approach for queries that require linking concepts across multiple research items. Confidence: high (NeurIPS 2024)
- RAPTOR's recursive abstractive hierarchy achieves +20 percentage points on multi-step reading comprehension (QuALITY benchmark, ICLR 2024). Recursive clustering and abstractive summarisation creates a multi-resolution retrieval tree. The "collapsed tree" query selects nodes from any level within the token budget. The research corpus already has structured Executive Summaries at Layer 2; only Layer 3–4 generation is needed. Confidence: high
- Concept maps do not constitute a separate agent-accessible knowledge layer. Concept maps (Novak & Gowin 1984) are not natively machine-readable at the precision required for automated agent retrieval. A knowledge graph with typed, labelled edges subsumes all navigability value while adding queryability. Concept maps are a valid *rendered view* of a knowledge graph, not an independent architecture layer. Confidence: high
- A five-layer knowledge architecture provides principled agent context management. Layer 0 = raw documents (archival); Layer 1 = extractive summaries (~20% length, key sentences); Layer 2 = abstractive document summaries (3–5 sentences); Layer 3 = knowledge graph nodes and community summaries; Layer 4 = domain schema/ontology. Pull-based injection selects the appropriate layer based on task intent. Maps directly onto the Letta memory framework. Confidence: high
- RRF is the established standard for combining retrieval signals. RRF(d) = Σ 1/(k + rank_i(d)) with k=60 combines cosine similarity, BM25, graph centrality (PPR), and recency without score calibration. Natively implemented in Azure AI Search, Milvus, Elasticsearch, OpenSearch, MongoDB Atlas, Qdrant. The same mechanism underpins the hybrid BM25+Model2Vec+sqlite-vec pattern from the context-mode research item. Confidence: high
Research Question
What techniques — latent semantic extraction, knowledge graphs, concept maps, hierarchical document compression, and layered abstraction — most effectively represent and compress large knowledge corpora (thousands of files) for retrieval-augmented agent systems operating under context-window constraints, and how should these techniques be combined so that agents can retrieve the right knowledge at the right level of abstraction for a given intent?
Findings
Executive Summary
For agent-accessible large knowledge corpora (100–10,000 documents), the most effective knowledge representation architecture combines four complementary techniques in a layered stack: dense embeddings + hybrid BM25 retrieval for document-level semantic search; a knowledge graph (LightRAG pattern for dynamic corpora) for multi-hop relationship queries; RAPTOR-style hierarchical abstractive summaries for cross-document query integration; and RRF for fusing heterogeneous retrieval signals. LSA/LSE is superseded by dense embeddings and should not be the primary retrieval mechanism in new systems. Concept maps are subsumed by knowledge graphs for machine-facing use — they add value only as human-facing views rendered from the graph. A five-layer knowledge architecture (raw → extractive → abstractive → graph nodes → domain schema) maps onto the Letta context-engineering framework and enables pull-based injection at the appropriate depth for each agent intent type. For this research corpus, RAPTOR-style hierarchical summarisation has the highest immediate value, with knowledge graph construction justified at ~200+ completed items.
Key Findings
-
LSA is superseded by dense embeddings for agent context retrieval. Dense embeddings (SBERT, MiniLM, Model2Vec) consistently outperform LSA on MTEB benchmarks for semantic search, clustering, and retrieval. LSA discards word order, sentence structure, and contextual disambiguation. LSA has residual value for topic modelling and interpretability but should not be a primary retrieval mechanism in new systems. Confidence: high.
-
GraphRAG (Microsoft, Edge et al. 2024, arXiv:2404.16130) solves the global-query problem via Leiden community detection and LLM community summaries. Standard RAG cannot answer corpus-level sensemaking queries. GraphRAG's entity graph + community summaries + map-reduce significantly outperforms standard RAG on comprehensiveness and diversity for global queries. Critical limitation: batch-rebuild-only updates make it unsuitable for frequently updated corpora. Confidence: high.
-
LightRAG (arXiv:2410.05779, EMNLP 2025) is the practical successor to GraphRAG for dynamic corpora. LightRAG supports incremental updates (no full rebuild), dual-level retrieval (coarse global + fine entity-level), and achieves 10–100× lower token costs while matching or exceeding GraphRAG accuracy. For a growing research corpus, LightRAG is preferred. Confidence: high.
-
HippoRAG's PPR-based retrieval achieves up to 20% improvement on multi-hop QA benchmarks at 10–30× lower cost than iterative retrievers. Personalised PageRank traversal from query-matched seed nodes surfaces cross-document associative chains without expensive iterative query cycles. Best approach for queries that require linking concepts across multiple research items. Confidence: high (NeurIPS 2024).
-
RAPTOR's recursive abstractive hierarchy achieves +20 percentage points on multi-step reading comprehension (QuALITY benchmark, ICLR 2024). Recursive clustering and abstractive summarisation creates a multi-resolution retrieval tree. The "collapsed tree" query selects nodes from any level within the token budget. The research corpus already has structured Executive Summaries at Layer 2; only Layer 3–4 generation is needed. Confidence: high.
-
Concept maps do not constitute a separate agent-accessible knowledge layer. Concept maps (Novak & Gowin 1984) are not natively machine-readable at the precision required for automated agent retrieval. A knowledge graph with typed, labelled edges subsumes all navigability value while adding queryability. Concept maps are a valid rendered view of a knowledge graph, not an independent architecture layer. Confidence: high.
-
A five-layer knowledge architecture provides principled agent context management. Layer 0 = raw documents (archival); Layer 1 = extractive summaries (~20% length, key sentences); Layer 2 = abstractive document summaries (3–5 sentences); Layer 3 = knowledge graph nodes and community summaries; Layer 4 = domain schema/ontology. Pull-based injection selects the appropriate layer based on task intent. Maps directly onto the Letta memory framework. Confidence: high.
-
RRF is the established standard for combining retrieval signals. RRF(d) = Σ 1/(k + rank_i(d)) with k=60 combines cosine similarity, BM25, graph centrality (PPR), and recency without score calibration. Natively implemented in Azure AI Search, Milvus, Elasticsearch, OpenSearch, MongoDB Atlas, Qdrant. The same mechanism underpins the hybrid BM25+Model2Vec+sqlite-vec pattern from the context-mode research item. Confidence: high.
-
KG construction cost at this corpus's scale is economically negligible. 500 items × ~3,000 tokens/item = 1.5M tokens for one-time extraction; incremental updates <3,000 tokens/day. Total cost <$1 at current API prices. The dominant cost is engineering implementation, not API usage. Confidence: medium (cost estimate based on LightRAG token benchmarks; actual cost depends on model choice).
-
RAPTOR implementation on the research corpus requires minimal additional work. Each completed item already has Executive Summary (Layer 2), Key Findings (Layer 1), and full text (Layer 0). Only cluster-level summaries (Layer 3) across related items and a corpus-level summary (Layer 4) need to be generated. This is a 2–3 hour implementation task using LangChain's RAPTOR integration or a custom clustering script. Confidence: high.
-
Knowledge rot is an active risk requiring lifecycle management. Without review policies, the knowledge graph will accumulate stale entries as AI/ML knowledge evolves. Research items in fast-moving sub-domains (LLM architectures, agent memory) should be flagged for review at 12–18 months. The
addedandcompleteddate fields in each item serve as lightweight TTL markers. Confidence: medium. -
The convergent architecture (embeddings + knowledge graph + graph-traversal reasoning) is the highest-quality long-term path. Dense embeddings index into the knowledge graph; the graph provides relational structure; PPR or GoT traversal provides the reasoning scaffold for multi-hop queries. Demonstrated in HippoRAG (NeurIPS 2024) and KGoT (ETH Zurich 2024). Practical stack: Model2Vec (sqlite-vec) + LightRAG (NetworkX) + PPR for multi-hop queries. Confidence: high.
Assumptions
- Assumption: Dense embeddings at <500 items are computationally feasible on CPU with local models (Model2Vec). Justification: Demonstrated in the context-mode research item by a practitioner running Model2Vec on a 49,746-chunk Obsidian vault without GPU.
- Assumption: LLM-based KG extraction produces sufficient quality on research-item content without extensive prompt tuning. Justification: GraphRAG, LightRAG, and HippoRAG all demonstrate strong extraction quality on similar corpus types; research items have clear, extractable entities.
- Assumption: The corpus will reach ~200 items within 6 months at current accumulation rates. Justification: Current backlog ~27 items; completing 2–5 items/week reaches 200 items in 3–6 months.
Analysis
The evidence supports a staged adoption path that avoids over-engineering at current corpus scale while positioning for the full convergent architecture as the corpus grows.
Stage 1 (now, <100 items): BM25 + dense embedding hybrid search (per semantic-full-text-search.md). Add RAPTOR Layer 3–4 generation as a near-zero-cost enhancement that unlocks multi-item query capability immediately, given that Layers 0–2 already exist in every completed item.
Stage 2 (~150–200 items): Build a LightRAG knowledge graph. This is the threshold where cross-item relationship queries justify graph construction overhead. LightRAG's incremental merge model is operationally sustainable for a daily-updated corpus.
Stage 3 (~500+ items): Add community detection and community summaries (GraphRAG pattern within LightRAG). Global sensemaking queries ("what does the corpus say about X?") become the dominant query type at this scale.
The choice of LSA/LSE is resolved definitively: it adds no value over dense embeddings for this corpus and should not be implemented. The choice of concept maps is resolved: they are not a separate implementation concern; any concept-map-like view is a rendered artefact of the knowledge graph.
The four-signal RRF (cosine + BM25 + PPR + recency) is the recommended ranking combination. LLM cross-encoder reranking is optional and should be added only if retrieval quality falls short after the four-signal RRF is deployed.
Risks, Gaps, and Uncertainties
- Unknown query type distribution. The actual mix of local factual lookups, global sensemaking queries, and multi-hop relationship queries for this corpus is not yet known. This distribution determines relative technique value. Recommendation: instrument agent queries once the corpus reaches 100 items.
- LLM extraction quality on research items is untested. Whether standard LightRAG/HippoRAG extraction prompts work well on structured research markdown without tuning is unknown. A small-scale extraction test on 10–20 items before full pipeline build would de-risk this.
- No benchmark on research-item corpora. All performance numbers come from general academic QA benchmarks. Generalisation to structured knowledge management corpora is an inference, not a measured result.
- Knowledge rot timescales are domain-dependent. The 12–18 month staleness threshold for AI/ML items is an estimate. Sub-domains vary: LLM architecture research has a 6-month cycle; epistemological and consciousness research has a multi-year cycle.
Open Questions
- KG construction pipeline: What entities and relationships should be extracted from research items, and what graph schema is optimal? (Candidate backlog item:
knowledge-graph-construction-pipeline) - RAPTOR offline vs. on-demand: Should cluster summaries be generated in a CI/CD step (offline) or cached on first query (on-demand)? Offline is more token-efficient; on-demand avoids stale cache management.
- Existing item structure as RAPTOR input: Can the Executive Summary fields be used directly as Layer 2 leaf nodes in the RAPTOR tree, or does RAPTOR's clustering require raw text re-chunking?
- Staleness threshold: What is the right review trigger (12 months? 18 months?) and does it vary by tag (e.g.,
llm,agents= 12 months;philosophy,neuroscience= 24 months)? - Backlog dependency edges in the graph: Should research item
blocks/is-blocked-byrelationships from YAML front matter be first-class edges in the knowledge graph?
sources
- [x] Deerwester et al. (1990) "Indexing by latent semantic analysis" — original LSA paper
- [x] Landauer, Foltz & Laham (1998) "Introduction to latent semantic analysis" — accessible conceptual overview
- [x] Edge et al. (2024) "From Local to Global: A GraphRAG Approach to Query-Focused Summarization" — Microsoft GraphRAG
- [x] GraphRAG GitHub + documentation
- [ ] Novak & Gowin (1984) Learning How to Learn — original concept map formulation (foundational reference for concept map structure)
- [ ] Novak (2010) "Learning, Creating, and Using Knowledge" — updated concept map theory
- [x] CmapTools / IHMC concept mapping — standard tool; assess machine-readability of format
- [x] LlamaIndex knowledge graph integration — practical agent implementation
- [x] Neo4j + LLM integration patterns
- [x] Zep temporal knowledge graphs for agent memory
- [x] Cognee knowledge graph for AI memory
- [x] RAPTOR (2024) "Recursive Abstractive Processing for Tree-Organized Retrieval" — hierarchical summarisation for RAG
- [x] HippoRAG (2024) "Neurobiologically Inspired Long-Term Memory for Large Language Models"
- [x] Sarthi et al. (2024) RAPTOR — tree-based recursive summarisation
- [x]
Research/completed/2026-03-01-context-mode-llm-context-compression.md— context compression at tool-output level; hybrid BM25+Model2Vec+sqlite-vec+RRF pattern (Key Finding 6) - [x]
Research/completed/2026-03-02-agent-memory-management-context-injection.md— memory types and context injection; episodic/semantic/procedural memory architecture - [x]
Research/backlog/2026-03-02-semantic-full-text-search.md— downstream consumer of search and retrieval findings - [x]
Research/backlog/2026-03-02-integrative-framework-agent-decision-making.md— downstream consumer of knowledge representation findings; DIKW integration - [x] LightRAG (2024) — incremental graph RAG alternative to GraphRAG
- [x] RRF hybrid search — combining retrieval signals without score normalisation