Skip to main content

Graph Retrieval

Graph Retrieval leverages the explicit relationships stored in the Knowledge Graph (JanusGraph) to find context that semantic search alone might miss. It allows the system to perform structural discovery across entities and memories.

How it Works

  1. Starting Point: Every graph query begins with a "Seed Node" (usually a Subject ID like a User or Project).
  2. Traversal: The system follows defined edges from the seed node to find connected information.
  3. Multi-hop Discovery: Graph retrieval can jump across multiple nodes (e.g., from a User to their Org, then to all Projects in that Org, then to the Memories about those Projects).
  4. Filtering: Traversal can be restricted based on edge type (e.g., "only follow WORKS_ON edges") or property filters (e.g., "only find memories with salience > 0.8").

Key Traversal Patterns

Neighborhood Search (1-hop)

Find all memories directly linked to the subject via ABOUT edges. This provides the most immediate context.

Context Expansion (2-hop)

Find memories linked to entities that are linked to the subject. Example: If a user is linked to an Org, find memories about the Org's policies.

Provenance Tracking

Follow DERIVED_FROM edges to find the source document or conversation for a specific memory block.

Supersession Chain

Follow SUPERSEDES edges to find the full history and evolution of a specific piece of knowledge.

Graph vs. Vector Retrieval

FeatureGraph RetrievalVector Retrieval
LogicStructural & ExplicitStatistical & Semantic
Search"Find memories for Users in Project X""Find memories related to 'budget'"
PrecisionHigh (based on facts)Moderate (based on similarity)
DiscoveryFinds connected entitiesFinds similar concepts

Use Cases

  • Scoped Context: Ensuring the AI only sees memories relevant to the current project.
  • Entity Awareness: Informing the AI about the organizational structure or relationship network of the subject.
  • Knowledge History: Providing the AI with the background and evolution of a specific fact.
  • Complex Scoping: "Find all preferences for members of the 'Legal' team."