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
- Starting Point: Every graph query begins with a "Seed Node" (usually a Subject ID like a User or Project).
- Traversal: The system follows defined edges from the seed node to find connected information.
- 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).
- Filtering: Traversal can be restricted based on edge type (e.g., "only follow
WORKS_ONedges") or property filters (e.g., "only find memories withsalience > 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
| Feature | Graph Retrieval | Vector Retrieval |
|---|---|---|
| Logic | Structural & Explicit | Statistical & Semantic |
| Search | "Find memories for Users in Project X" | "Find memories related to 'budget'" |
| Precision | High (based on facts) | Moderate (based on similarity) |
| Discovery | Finds connected entities | Finds 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."