Retrieval Graph
The Retrieval Graph is the system that finds the right information at query time. Built on a co-occurrence concept network with hierarchical community structure, it handles everything from precise factual lookups to broad thematic queries that span your entire knowledge base: without the cost of traditional graph-based retrieval approaches.
Co-Occurrence Concept Network
At its core, the Retrieval Graph is built from the natural co-occurrence patterns in your data. When two concepts appear together in the same text segment, they are linked: forming a dense network of semantic associations that captures how ideas relate to each other in your domain.
How it’s constructed:
- Concept extraction: NLP-based noun phrase extraction identifies key concepts across all ingested content, without any LLM involvement
- Co-occurrence linking: concepts that appear in the same text segment are connected with weighted edges reflecting their association strength
- Community detection: the Leiden algorithm partitions the concept network into hierarchical communities at multiple resolution levels
- Provenance anchoring: every concept and community traces back to its source documents and segments
This produces a rich, queryable structure from pure linguistic analysis: typically processing in under a minute, with no embedding computation and no LLM calls during indexing.
Hierarchical Community Structure
The Leiden community detection algorithm organises the concept network into a multi-level hierarchy: from fine-grained topic clusters at the bottom to broad thematic domains at the top.
This hierarchy is what enables Squad to handle different types of queries efficiently:
| Query Scope | Community Level | Example |
|---|---|---|
| Local (specific fact) | Leaf communities | ”What is the delivery date for order #4521?” |
| Regional (topic area) | Mid-level communities | ”What are the main risks in our North Sea operations?” |
| Global (broad synthesis) | Top-level communities | ”Summarise our entire supplier risk profile” |
Each community carries a statistical summary of its member concepts and their relationships: enabling the system to quickly determine whether a community is likely to contain relevant information before examining individual documents.
Query Pipeline
When a query arrives, the Retrieval Graph executes a multi-stage pipeline that balances thoroughness against computational cost:
1. Query Decomposition
Complex queries are decomposed into focused subqueries, each targeting a specific aspect of the information need. This ensures comprehensive coverage without diluting search precision.
2. Concept Matching
Each subquery is matched against the concept network using vector similarity: identifying the communities and document segments most likely to contain relevant information.
3. Budget-Controlled Iterative Deepening
This is where Squad’s retrieval diverges from conventional approaches. Rather than retrieving a fixed number of results, the system performs a breadth-first community walk with iterative deepening:
- Start at the community level identified by concept matching
- Evaluate relevance of candidate segments using focused LLM assessment
- If the budget allows and relevance signals suggest deeper information exists, expand to adjacent communities
- Continue until the relevance budget is exhausted or confidence thresholds are met
This approach automatically adapts retrieval depth to query complexity: simple factual queries resolve quickly from a single community, while broad analytical queries traverse multiple levels of the hierarchy.
4. Claim Extraction and Synthesis
Relevant segments are grouped by community and processed to extract specific claims: factual assertions with provenance. These claims are then synthesised into a coherent answer, with every assertion traceable to its source material.
Dual Retrieval Architecture
Squad operates two complementary retrieval layers that work together:
Co-occurrence layer handles all primary retrieval: local lookups, regional exploration, and global synthesis. It is fast, cost-effective, and domain-agnostic.
Typed ontology layer (from the Semantic Layer) provides explainability, entity resolution, and structured reasoning. When the intelligence engine needs to understand what type of entity something is, resolve ambiguous references, or traverse typed relationships, it queries the ontology layer.
Together, these layers give Squad the ability to both find relevant information efficiently and understand it structurally: combining the breadth of statistical retrieval with the precision of structured knowledge.
Performance Characteristics
| Metric | Value |
|---|---|
| Indexing cost | Equivalent to vector search (NLP-only, no LLM) |
| Indexing speed | Thousands of documents in under a minute |
| Retrieval quality | Comparable to full GraphRAG at ~0.1% of the indexing cost |
| Answer faithfulness | 5.0 / 5.0 on internal validation benchmarks |
| Answer relevance | 5.0 / 5.0 on internal validation benchmarks |
Next Steps
- Memory Architecture: the broader memory system the retrieval graph operates within
- Semantic Layer: the structured entity and relationship layer
- Graph Visualization: exploring the retrieval graph visually