Orchestrata Ultimate / Specs / 008-knowledge-graph

008-knowledge-graph: Knowledge Graph

The Neo4j Knowledge Graph is the persistent memory system for Orchestrata's multi-agent coordination. It serves as shared institutional memory that enables agents to maintain context across sessions, understand project relationships, and coordinate effectively without filling agent context windows.

At a glance

Item Value
Spec directory specs/008-knowledge-graph/
Status line in the spec Complete — Phase 2 context-injection expansion landed (runtime signals, validator loop, expanded context sections)
Requirement IDs defined 123
With a @traces citation in src/ 101 (82.1%)
With a @traces citation in tests/ 26 (21.1%)
Tracked files 11
RTM page 008-knowledge-graph

Reading this spec

The Neo4j Knowledge Graph is the persistent memory system for multi-agent coordination in Orchestrata. It acts as shared institutional memory: agents keep context across sessions, understand how projects relate, and coordinate without filling their own context windows.

The scope is six user stories: temporal knowledge tracking, portfolio-based organization, the agent memory interface, code analysis integration and knowledge synchronization (all priority 1), and multi-hop retrieval (priority 2). The stated aims are cross-session persistence, relationship understanding, prevention of context window overflow, multi-project portfolio coordination and awareness of how projects evolve over time. Requirement IDs use the REQ-008- prefix.

The design decisions are Neo4j 5.0 or later for storage, Tree-sitter for parsing Python and Prolog code, temporal timestamps on every node and relationship, Cypher query patterns for context injection, and goal-oriented synchronization following the XOS pattern.

In the code, the package is orchestrata_ultimate/knowledge_graph. The largest tracers are orchestrata_ultimate/knowledge_graph/code_parser, orchestrata_ultimate/knowledge_graph/synchronizer, orchestrata_ultimate/knowledge_graph/anomaly_detector, orchestrata_ultimate/knowledge_graph/query_engine and orchestrata_ultimate/knowledge_graph/types. The per-requirement view is on the RTM page.

The spec's status line reads Complete, with a note that a Phase 2 context-injection expansion has landed (runtime signals, a validator loop and expanded context sections). It tracks 11 files and defines 123 requirement IDs. The full text follows below.

Measured coverage is 101 of 123 requirements cited by at least one @traces in src/ (82.1%), spread over 42 modules; the module citing the most of them is orchestrata_ultimate/knowledge_graph/code_parser (21 requirements). In tests/, 26 requirements are cited by a test-side @traces.

Coverage gaps: 22 requirements have no citing symbol. The largest untraced groups are REQ-008-* (22). Untraced means no @traces names the ID; the behaviour may still exist in code that was never annotated. Test-side citations are thinner than code-side ones (26 against 101).

Requirements

Checkbox is the state recorded in the requirements checklist; Traced by is the count of src/ symbols whose @traces names the ID.

ID Done Requirement Traced by
REQ-008-001 yes Neo4j knowledge graph serves as persistent memory for multi-agent coordination 2
REQ-008-002 yes Knowledge graph maintains temporal awareness with time-stamped nodes and relationships 6
REQ-008-003 yes Portfolio-based organization enables cross-project context sharing 3
REQ-008-004 yes Agents can query knowledge graph for task-relevant context without loading entire project history 6
REQ-008-005 yes Multi-hop retrieval enables complex context gathering across multiple relationships 11
REQ-008-006 yes Knowledge graph supports both static code structure and dynamic execution state 19
REQ-008-007 yes Portfolio nodes can contain multiple projects with shared context 3
REQ-008-008 yes Cross-project dependency tracking enables portfolio-level coordination 1
REQ-008-009 yes Portfolio-level dashboards show progress across multiple projects 2
REQ-008-010 yes Automatic portfolio assignment based on project metadata and tags none
REQ-008-011 yes Portfolio-level governance extends PAM++ ownership to portfolio scope none
REQ-008-012 yes Standardized Cypher query patterns for common agent context needs 5
REQ-008-013 yes Context injection protocol provides only relevant nodes to agent context 19
REQ-008-014 yes Query timeout enforcement prevents agent blocking 1
REQ-008-015 yes Caching layer optimizes frequently accessed context 6
REQ-008-016 yes Agent-specific query permissions enforced through PAM++ 1
REQ-008-017 yes Tree-sitter integration for Python code analysis 6
REQ-008-018 yes Tree-sitter integration for Prolog code analysis 6
REQ-008-019 yes Incremental parsing enables efficient updates for large codebases 5
REQ-008-020 yes Concrete syntax tree preservation maintains accurate code representation 1
REQ-008-021 yes Code analysis results automatically mapped to knowledge graph nodes 32
REQ-008-022 yes Goal-oriented synchronization following XOS pattern 2
REQ-008-023 yes Idempotent updates ensure consistency across sync operations 17
REQ-008-024 yes Unidirectional flow from project files to knowledge graph 6
REQ-008-025 yes Anomaly correction automatically maintains consistency 12
REQ-008-026 yes File watchers monitor changes for incremental updates 14
REQ-008-027 yes Time-stamped nodes track creation, update, and validity periods 3
REQ-008-028 yes Historical queries enable temporal reasoning and context selection 3
REQ-008-029 yes Versioned entity states support rollback and comparison 7
REQ-008-030 yes Temporal audit capabilities track changes over time 4
REQ-008-031 yes PAM++ ownership enforcement for all knowledge graph queries 4
REQ-008-032 yes Portfolio-level access control for cross-project queries 1
REQ-008-033 yes Agent-specific query permissions based on role and authority 2
REQ-008-034 yes Audit trail maintained for all graph modifications and queries 5
REQ-008-035 yes Governance engine integration enforces memory operation policies 3
REQ-008-036 yes Query response time under 100ms for common context queries 1
REQ-008-037 yes Index optimization for frequent query patterns 4
REQ-008-038 yes Sharding support for large portfolios with thousands of projects none
REQ-008-039 yes Memory-efficient query patterns prevent resource exhaustion 4
REQ-008-040 yes Distributed query processing for high-concurrency environments 1
REQ-008-041 yes CXP protocol integration for memory context references 3
REQ-008-042 yes PAM++ integration for ownership boundary enforcement 2
REQ-008-043 yes Session management integration for temporal session tracking 4
REQ-008-044 yes Governance engine integration for policy enforcement 3
REQ-008-045 yes Prolog system integration for dynamic state synchronization 3
REQ-008-046 yes Multi-project context injection verification 1
REQ-008-047 yes Temporal query accuracy testing 1
REQ-008-048 yes Portfolio relationship validation 1
REQ-008-049 yes Agent coordination testing across multiple projects 1
REQ-008-050 yes Performance testing under load with large codebases 1
REQ-008-051 yes Comprehensive API documentation for memory interface none
REQ-008-052 yes Graph schema documentation with node and relationship definitions 4
REQ-008-053 yes Query pattern documentation for common agent scenarios 3
REQ-008-054 yes Integration guide for existing Orchestrata components none
REQ-008-055 yes Performance tuning guide for large-scale deployments none
REQ-008-056 yes CodeParser.resolve_calls builds a name→function index across all analyzed files and emits a CALLS edge for every call-site match found in a function's calls[] list 8
REQ-008-057 yes Resolved CALLS edges are deduplicated per caller→callee pair so a repeated call site never produces a duplicate graph edge 5
REQ-008-058 yes Self-calls (a function calling itself, e.g. recursion) are excluded from CALLS edge resolution 4
REQ-008-060 yes CALLS edges carry a confidence score (_call_confidence) that ranks same-file > same-package > global-scope resolution, attenuated when the callee name is ambiguous across multiple candidates 3
REQ-008-062 yes CodeParser.resolve_inheritance builds a name→class index across all analyzed files to resolve base-class names to target ClassNodes 4
REQ-008-063 yes Resolved inheritance edges are deduplicated per child→parent pair 3
REQ-008-064 yes Self-inheritance edges are excluded from inheritance resolution 1
REQ-008-065 yes Base-class names are extracted from the AST (ast.Name and dotted ast.Attribute access) before being handed to inheritance resolution 2
REQ-008-066 yes Base-class names produced via ast.dump (unresolved attribute access) are stripped of their dump wrapper before name-index lookup 1
REQ-008-067 yes CodeParser.resolve_imports builds a module-path→file mapping across all analyzed files to resolve import statements to target File nodes 5
REQ-008-068 yes Import resolution falls back to partial (prefix) module-path matching when an exact module path is not found in the index 3
REQ-008-069 yes Resolved import edges are deduplicated per source-file→target-file pair 1
REQ-008-071 yes Self-imports (a file resolving to itself) are excluded from import edge resolution 1
REQ-008-072 yes _extract_class_with_methods/ClassExtractor._extract_methods extract a class's methods as separate FunctionNodes, each carrying signature, parameters, return type, decorators, and docstring 6
REQ-008-073 yes Extracted method FunctionNodes have class_id set to their owning ClassNode's id, establishing the Class→Function hierarchy 5
REQ-008-074 yes Method return-type unparsing failures are caught and logged rather than raised, so extraction continues for the remaining methods 2
REQ-008-075 yes _extract_class_with_methods returns the ClassNode paired with its method FunctionNodes as a single unit for downstream sync 2
REQ-008-092 yes ASTAnalyzer.__init__ wires a CodeParser, ClassExtractor, and FunctionExtractor (each defaulting to a fresh instance when not injected) to coordinate file/project analysis 1
REQ-008-098 yes ASTAnalyzer.analyze_file parses a single file via CodeParser.parse_file and returns its FileAnalysis 2
REQ-008-099 yes ASTAnalyzer.analyze_project walks a project directory (honoring extension filters and ignore-dir patterns), aggregates per-file analyses into total class/function/predicate/line counts, and records elapsed parse time 2
REQ-008-100 yes ClassExtractor.extract returns all top-level class definitions found in a module's AST 1
REQ-008-101 yes CodeParser._extract_function extracts a function/method's name, signature, parameters, and metadata from its AST node 1
REQ-008-059 yes AnomalyDetector.__init__ wires the Neo4j client, FileSynchronizer, project id, and an optional asyncio event loop needed for anomaly detection/correction 1
REQ-008-061 yes AnomalyDetector.connect ensures the underlying Neo4j client connection is established (idempotent — a no-op when already connected) before detection begins 1
REQ-008-070 yes AnomalyDetector._get_loop returns the explicitly-provided event loop when open, otherwise creates/reuses a loop for synchronous correction calls 2
REQ-008-076 yes _check_single_file flags a STALE_FILE anomaly when a graph File node's path no longer exists on disk, and skips the remaining checks for that file 1
REQ-008-077 yes _check_hash flags a HASH_MISMATCH anomaly when the on-disk file hash differs from the hash recorded on the graph File node 1
REQ-008-078 yes _check_line_count flags a LINE_COUNT_DRIFT anomaly when the on-disk line count differs from the graph File node's recorded line_count 1
REQ-008-079 yes _check_entities re-parses a file's AST and compares class/function names against the graph's recorded entities to detect drift and orphans 2
REQ-008-080 yes _check_entity_kind flags an ORPHAN_RELATIONSHIP anomaly for each graph entity (class or function) whose name is absent from the current AST 1
REQ-008-081 yes _find_missing_files walks the project directory (honoring SyncConfig ignore patterns) and flags a MISSING_FILE anomaly for every on-disk file absent from the graph 1
REQ-008-082 yes _correct_stale_file corrects a STALE_FILE anomaly by cascade-deleting the file's nodes from the graph 2
REQ-008-087 yes _correct_missing_file corrects a MISSING_FILE anomaly by syncing the file into the graph via FileSynchronizer.sync_file 1
REQ-008-088 yes _correct_hash_mismatch corrects a HASH_MISMATCH anomaly by invalidating the cached file hash and re-syncing the file 1
REQ-008-089 yes _correct_orphan_relationship corrects an ORPHAN_RELATIONSHIP anomaly by deleting the orphaned node from the graph 2
REQ-008-090 yes _correct_line_count_drift corrects a LINE_COUNT_DRIFT anomaly by updating the graph File node's line_count property to match disk 2
REQ-008-091 yes _apply_corrections routes each detected anomaly through auto-correction (mode='auto') or per-anomaly user confirmation (mode='interactive'), moving uncorrectable or failed anomalies into the report's uncorrectable list 2
REQ-008-083 yes TemporalManager.version_node closes the previous version (valid_until = now) before creating a new version with valid_from = now and valid_until = None 1
REQ-008-084 yes Each node version is assigned a unique version id and stores a snapshot of the node's properties, independent of later mutations to the caller's dict 2
REQ-008-085 yes version_node persists the new property state to Neo4j (updated_at + properties) when a connected client is available, and degrades gracefully (logs a warning) when persistence fails 1
REQ-008-086 yes TemporalManager.get_state_at returns the node version whose [valid_from, valid_until) window contains the requested timestamp, or None if no version was valid at that point in time 1
REQ-008-093 yes SpikeAuditor.log_packet persists a routed CXP packet as a (:CXPPacket) node keyed by message_id via an idempotent MERGE (safe to log the same packet more than once) 2
REQ-008-094 yes The (:CXPPacket) node carries the packet's envelope metadata — thread_id, from_agent, to_agent, subject, serialized payload, and timestamp 1
REQ-008-095 yes The (:CXPPacket) node also carries priority, delivery_status, and work_status so the audit trail can be queried for routing/delivery/work state 1
REQ-008-096 yes log_packet failures (e.g. Neo4j unavailable) are caught and logged rather than raised, so a missing audit trail never breaks packet routing 3
REQ-008-097 yes SpikeAuditor.log_routing records a [:ROUTED_TO {subject, thread_id}] relationship between two existing (:CXPPacket) nodes by message_id, reconstructing the routing path for a thread 2
REQ-008-102 yes GraphContext.to_prompt assembles the files/relationships/tests/recent-changes/requirements/decisions sections into a single instructive text block and truncates it to fit max_context_tokens before returning it for a volk prompt 11
REQ-008-103 yes GraphContext.recent_changes is populated from explicit (:File)-[:CHANGED_IN]->(:Change) records, (:File)-[:NEXT_VERSION]->(:File) version chains, or file timestamp properties 2
REQ-008-104 yes GraphContext.similar_patterns is populated with files whose classes share base classes or implemented protocols with the target files none
REQ-008-105 yes GraphContext.semantic_files is populated by querying the Memgraph semantic-graph chunk store and mapping chunk file paths back to Neo4j File roots none
REQ-008-106 yes GraphContext.requirements is populated by resolving TRACES_TO links from target symbols to RequirementItem nodes and unifying them with parent Requirement/Spec chains 1
REQ-008-107 yes GraphContext.decisions is populated by querying (:Decision)-[:APPLIES_TO]->(file|symbol) relationships 1
REQ-008-108 yes Requirement closure walks (:Requirement)-[:REQUIRES]->(:Requirement) edges from traced requirements up to a bounded depth none
REQ-008-109 yes Requirement closure deduplicates results by canonical requirement id and records shortest hop distance none
REQ-008-110 yes RuntimeSignalWriter persists runtime signals (Message, ToolCall, Decision, GatewayEvent) to the Neo4j graph with deterministic ids none
REQ-008-111 yes Runtime signals are linked to mentioned File/Class/Function nodes via MENTIONS edges none
REQ-008-112 yes Inter-agent messages are written as Message nodes carrying thread_id, sender, recipient, subject, and summary none
REQ-008-113 yes Tool invocations are written as ToolCall nodes carrying tool_name, arguments_json, result_summary, and outcome none
REQ-008-114 yes Governance decisions are written as Decision nodes carrying rationale, linked to requirements via JUSTIFIED_BY, and to volks via MADE none
REQ-008-115 yes Gateway audit events are written as GatewayEvent nodes carrying event_type, outcome, and summary 1
REQ-008-116 yes PipelineKGMixin exposes a runtime signal writer and persists decisions via sync_decisions_to_kg none
REQ-008-117 yes BaseAgent exposes a runtime-signal writer setter and writes tool-call signals none
REQ-008-118 yes Kernel pipeline dispatch writes Message signals for routed CXP packets none
REQ-008-119 yes Both kernel and orchestrator runners configure agents with the runtime signal writer none
REQ-008-120 yes GraphContextValidator validates an LLM response against the core entities cited in graph_context none
REQ-008-121 yes ValidatorLoop retries an LLM call with expanded context when validation reports missing core citations none
REQ-008-122 yes ContextExpansion carries extra_hops, include_tested_by, include_requirement_closure, and limit_multiplier controls 1
REQ-008-123 yes Each retry applies a broader expansion while preserving the original payload as the base for every attempt none

Code that traces this spec

Module Symbols Requirements
orchestrata_ultimate/gateway/handlers/knowledge 2 2
orchestrata_ultimate/kernel/pipeline_kg 16 8
orchestrata_ultimate/kernel/pipeline_session 1 1
orchestrata_ultimate/knowledge_graph/anomaly_detector 25 16
orchestrata_ultimate/knowledge_graph/ast_analyzer 3 3
orchestrata_ultimate/knowledge_graph/class_extractor 5 6
orchestrata_ultimate/knowledge_graph/code_parser 17 21
orchestrata_ultimate/knowledge_graph/config 3 3
orchestrata_ultimate/knowledge_graph/context_injector 24 7
orchestrata_ultimate/knowledge_graph/context_validator_loop 1 1
orchestrata_ultimate/knowledge_graph/cxp_auditor 6 6
orchestrata_ultimate/knowledge_graph/exceptions 1 1
orchestrata_ultimate/knowledge_graph/file_watcher 10 1
orchestrata_ultimate/knowledge_graph/function_extractor 1 1
orchestrata_ultimate/knowledge_graph/graph_client 3 3
orchestrata_ultimate/knowledge_graph/graph_context_validator 2 2
orchestrata_ultimate/knowledge_graph/graph_node_mixins 12 7
orchestrata_ultimate/knowledge_graph/history 5 4
orchestrata_ultimate/knowledge_graph/interfaces 7 11
orchestrata_ultimate/knowledge_graph/kg_design 1 1
orchestrata_ultimate/knowledge_graph/nodes 3 1
orchestrata_ultimate/knowledge_graph/pam_integration 3 2
orchestrata_ultimate/knowledge_graph/portfolio 6 4
orchestrata_ultimate/knowledge_graph/project_resolver 1 1
orchestrata_ultimate/knowledge_graph/prolog_bridge 7 5
orchestrata_ultimate/knowledge_graph/query_engine 13 13
orchestrata_ultimate/knowledge_graph/relationships 2 3
orchestrata_ultimate/knowledge_graph/schema 2 2
orchestrata_ultimate/knowledge_graph/search 1 5
orchestrata_ultimate/knowledge_graph/sync 26 10
orchestrata_ultimate/knowledge_graph/synchronizer 23 16
orchestrata_ultimate/knowledge_graph/temporal 4 9
orchestrata_ultimate/knowledge_graph/test_results_store 3 1
orchestrata_ultimate/knowledge_graph/types 7 11
orchestrata_ultimate/knowledge_graph/types_enums 2 2
orchestrata_ultimate/knowledge_graph/types_nodes 6 4
orchestrata_ultimate/knowledge_graph/versioning 7 2
orchestrata_ultimate/orchestrator/pipeline_runner 1 3
orchestrata_ultimate/session/kg_sync/__init__ 1 1
orchestrata_ultimate/session/kg_sync/_base 1 2
orchestrata_ultimate/session/kg_sync/_stage_code 1 1
orchestrata_ultimate/session/kg_sync/_stage_session 3 4

Checklists

checklists/constitutional.md

Knowledge Graph Constitutional Checklist

Security and Governance Principles
Data Integrity and Consistency
Privacy and Data Protection
System Reliability and Resilience
Ethical and Responsible AI
Compliance and Regulatory Requirements
Performance and Resource Management
Interoperability and Standards
Transparency and Explainability
Innovation and Future-Proofing
Human-AI Collaboration
Environmental and Sustainability Considerations
Community and Open Source Principles

checklists/requirements.md

The requirement list above comes from this file; 123 of 123 checkbox items are ticked.

checklists/testing.md

Knowledge Graph Testing Checklist

Functional Testing
Portfolio Management Testing
Agent Memory Interface Testing
Code Analysis Integration Testing
Synchronization Architecture Testing
Temporal Awareness Testing
Security and Governance Testing
Performance and Scalability Testing
Integration Testing
Multi-Project Testing
Edge Case Testing
Failure Mode Testing
Compatibility Testing
Documentation Testing

Other tracked files

Full spec text

Verbatim from specs/008-knowledge-graph/spec.md; headings are pushed down two levels.

SPEC-008: Knowledge Graph

Metadata


Overview

What

The Neo4j Knowledge Graph is the persistent memory system for Orchestrata's multi-agent coordination. It serves as shared institutional memory that enables agents to maintain context across sessions, understand project relationships, and coordinate effectively without filling agent context windows.

Why
How

User Scenarios & Stories

US-001: Temporal Knowledge Tracking (P1)

As an agent I want to access time-stamped project knowledge So that I understand project evolution over time

Acceptance Criteria:


US-002: Portfolio-Based Organization (P1)

As a portfolio manager I want to organize projects into portfolios So that I can manage cross-project context

Acceptance Criteria:


US-003: Agent Memory Interface (P1)

As an agent I want to query the knowledge graph for task context So that I get relevant information without disk reads

Acceptance Criteria:


US-004: Code Analysis Integration (P1)

As the system I want to parse code into the knowledge graph So that agents understand code structure

Acceptance Criteria:


US-005: Knowledge Synchronization (P1)

As the system I want to sync project files to the knowledge graph So that graph stays consistent with code

Acceptance Criteria:


US-006: Multi-Hop Retrieval (P2)

As an agent I want to perform complex multi-hop queries So that I can gather comprehensive context

Acceptance Criteria:


Functional Requirements

Graph Schema

FR-001: Node Types (P1)

FR-002: Relationship Types (P1)

FR-003: Temporal Properties (P1)

Context Injection

FR-004: Context Injection Protocol (P1)

FR-005: Multi-Hop Query Support (P2)

Code Analysis

FR-006: Python Parsing (P1)

FR-007: Prolog Parsing (P1)

Synchronization

FR-008: File Watching (P1)

FR-009: Incremental Updates (P1)

FR-010: Anomaly Correction (P2)

Phase 2 Context-Injection Expansion (2026-07-14)

FR-011: Expanded Context Sections (P1)

FR-012: Tier-H Runtime Signal Ingestion (P1)

FR-013: Validator Feedback Loop (P2)


Non-Functional Requirements

Performance

NFR-001: Query Performance

NFR-002: Synchronization Performance

NFR-003: Scalability

Reliability

NFR-004: Data Consistency

NFR-005: Availability

Security

NFR-006: Access Control


Technical Design

Architecture
┌─────────────────────────────────────────────────────────┐
│              Knowledge Graph System                      │
├─────────────────────────────────────────────────────────┤
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────┐     │
│  │   Code      │  │   Context   │  │    Sync     │     │
│  │   Parser    │  │   Injector  │  │   Engine    │     │
│  │ (Tree-sitter)│  │             │  │             │     │
│  └──────┬──────┘  └──────┬──────┘  └──────┬──────┘     │
│         │                │                │             │
│         ▼                ▼                ▼             │
│  ┌─────────────────────────────────────────────────┐   │
│  │              Neo4j Graph Database                │   │
│  │  - Nodes: File, Class, Function, Volk, etc.    │   │
│  │  - Relationships: DEFINES, CALLS, OWNS, etc.   │   │
│  └─────────────────────────────────────────────────┘   │
└─────────────────────────────────────────────────────────┘
Node Schema
# Core Nodes
class PortfolioNode:
    name: str
    description: str
    created_at: datetime

class ProjectNode:
    name: str
    path: str
    status: str
    created_at: datetime

class FileNode:
    path: str
    language: str
    hash: str
    line_count: int
    created_at: datetime

class ClassNode:
    name: str
    file: str
    line_start: int
    line_end: int
    bases: List[str]
    created_at: datetime

class FunctionNode:
    name: str
    class_name: Optional[str]
    file: str
    line_start: int
    line_end: int
    complexity: int
    created_at: datetime

class VolkNode:
    alias: str
    role: str
    model: str
    status: str
    created_at: datetime
Cypher Query Patterns

Component Ownership Query:

MATCH (v:Volk {alias: $volk_alias})-[:OWNS]->(c:Component {name: $component_name})
MATCH (c)<-[:APPLIES_TO]-(d:Decision)
MATCH (c)<-[:REQUIRES]-(t:Task {status: 'in_progress'})
MATCH (s:Session)-[:CONTAINS]->(t)
RETURN c, d, t, s

Recent Decisions Query:

MATCH (v:Volk)-[:MADE]->(d:Decision)-[:APPLIES_TO]->(c:Component)
WHERE d.created_at > datetime() - duration({days: 7})
RETURN v, d, c
ORDER BY d.created_at DESC

AST Subtree Query:

MATCH (f:File {path: $file_path})
OPTIONAL MATCH (f)-[:DEFINES]->(c:Class)
OPTIONAL MATCH (c)-[:HAS_FUNCTION]->(m:Method)
OPTIONAL MATCH (f)-[:DEFINES]->(fn:Function)
OPTIONAL MATCH (f)-[:IMPORTS]->(i:Import)
RETURN f, c, m, fn, i
Integration Points
Component Integration
orchestrata-cxp KG context references in packet headers
orchestrata-governance PAM++ ownership in queries
orchestrata-session Session persistence as graph
orchestrata-agents Context injection for Volks

Success Criteria

  1. Schema Complete: All 13 node types and 19 relationship types implemented
  2. Performance: Context queries < 50ms, Multi-hop < 100ms
  3. Coverage: Python and Prolog parsing functional
  4. Sync: File changes reflected in graph within 5 seconds
  5. Scale: Support 100K+ nodes per portfolio

Dependencies


Revision History

Date Version Author Changes
2026-01-15 1.0 Mohamed Initial specification
2026-03-07 1.1 Mohamed Standardized format, added numbered requirements