How we built NexusIDE: A Graph-Native Agentic IDE powered by FalkorDB in-memory Cypher traversals, FastMCP tools, native PageRank centrality, and real-time AST canvas?
Why Vector RAG Fails Coding Agents: Building a Graph-Native IDE with FalkorDB and FastMCP
How we built **NexusIDE: A Graph-Native Agentic IDE powered by FalkorDB in-memory Cypher traversals, the Model Context Protocol (FastMCP), native PageRank node centrality, and real-time
@gravity-ui/graphtopological visualization.π FalkorDB Graph Hacks Hackathon 2026 Submission
Challenge Tracks Unified:
- Connected Data & Graph-RAG
- Agent Memory & Multi-Agent Coordination
- Company Brain & Enterprise Context
Live GitHub Repository: https://github.com/prathamxeth/nexus-ide
Demo Walkthrough Video: Watch 3-Minute Demo on Loom / YouTube
1. The Core Dilemma: Why Vector RAG Breaks Down on Code
If youβve used Cursor, GitHub Copilot Workspace, or Windsurf on a non-trivial production codebase, you have inevitably encountered this scenario:
You issue a deceptively simple instruction:
"Harden validateToken in src/auth.ts to enforce a 60-second clock skew tolerance and reject algorithm 'none'."
The agent edits src/auth.ts. The local file compiles. You commit. Five minutes later, CI redlines across three downstream microservices: billing.ts was passing unparsed timestamps, and finance.ts:auditAccount crashed because its caller contract was silently violated.
Why did state-of-the-art LLMs fail at basic refactoring? Because they rely on Vector RAG.
[ Vector RAG: Lexical & Semantic Similarity Blindness ]
PROMPT: "Refactor validateToken"
β
βΌ
ββββββββββββββββββββββββ ANN Cosine Sim βββββββββββββββββββββββββββββ
β Vector Embedding ββββββββββββββββββββΊβ "token.ts" (Word Match) β
β (Bag of Word Chunks) β β "validator.ts" (Word Match)β
ββββββββββββββββββββββββ βββββββββββββββββββββββββββββ
β²
CRITICAL BLIND SPOT:
Vector RAG has zero awareness
of call-chains, hop distance,
or caller contracts!
The Fundamental Flaws of Flat Text Chunking
- Chunk Boundary Truncation: Codebases are sliced into arbitrary 500-token chunks with 50-token overlaps. A function signature lives in Chunk $A$, its implementation in Chunk $B$, and its downstream caller in Chunk $C$.
-
Multi-Hop Blindness: Vector search relies on approximate nearest-neighbor (ANN) cosine similarity. If
finance.ts:auditAccountcallsbilling.ts:processInvoice, which in turn callsauth.ts:validateToken,finance.tscontains zero semantic similarity to the term "clock skew". An embedding model will never retrieve it. - Amnesia Across Sessions: When a developer rejects a buggy hallucination or fixes an edge-case, vector databases have no structured mechanism to record an episodic rule linked directly to that AST node.
-
Zero Human Provenance: Vector slices strip out git blame, PR discussions, and architectural intent. The agent has no idea that
@alex.chenauthored PR #104 specifically to address RFC 7519 replay attacks.
The Fundamental Axiom: Natural language is loose and forgiving; code is a deterministic, typed, multi-layer directed knowledge graph. Slicing code into vector chunks is an architectural impedance mismatch.
2. The Solution: NexusIDE Inner-Loop Graph-RAG
Instead of treating code as unstructured prose, NexusIDE embeds FalkorDB directly into the inner loop of the agentic execution engine.
βββββββββββββββββββββββββββββββββββββββββββ
β Developer Prompt β
β "Refactor validateToken in src/auth.ts"β
ββββββββββββββββββββββ¬βββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββ
β NexusIDE Agent Orchestrator β
β (NO NATIVE FILE-READ / GREP TOOLS) β
βββββββββ¬ββββββββββββββββββββββββββ²ββββββββ
β β
falkor_blast_radius(validateToken) β Verified Topological
falkor_episodic_memory(validateToken) β Context & Guardrails
falkor_provenance(validateToken) β
β β
βΌ β
βββββββββββββββββββββββββββββββββββ΄ββββββββ
β FalkorDB Graph Engine β
β (GraphBLAS Matrix Multiplication) β
β β
β (:File)-[:DEFINES]->(:Function) β
β (:Function)-[:CALLS*1..4]->(:Function) β
β (:Function)-[:HAS_RULE]->(:Memory) β
β (:Function)-[:AUTHORED_IN]->(:PR) β
βββββββββ¬ββββββββββββββββββββββββββββββββββ
β
SSE Stream (/api/agent/stream)
βββΊ event: graph_traversal (visitedBlockIds, activeConnections)
βββΊ event: context_resolved (memory rules & callers)
βββΊ event: reasoning_chunk (streaming architectural tokens)
βββΊ event: code_patch (multi-file coordinated diff)
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββ
β @gravity-ui/graph Canvas β
β 4 Vertical Swimlanes (x=50,350,680,1000β
β Real-Time Traversal Path Highlighting β
βββββββββββββββββββββββββββββββββββββββββββ
The agent is intentionally stripped of raw filesystem tools (no open(), no grep, no cat). It navigates code strictly by traversing the FalkorDB graph over standardized Cypher queries and FastMCP tools.
3. The Unified 3-Layer Knowledge Graph Schema
NexusIDE solves all three hackathon tracks inside a single unified FalkorDB property graph:
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β NEXUSIDE UNIFIED GRAPH SCHEMA β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
[LAYER 3: COMPANY BRAIN]
(:Engineer {name, role}) ββ[:AUTHORED]βββΊ (:PR {id, title, merged_at})
β
[:RESOLVES]
β
βΌ
(:Ticket {key, summary})
β²
β [:TOUCHES]
ββββββββββββββββββββββββββββββββββββββββββββββββββββββΌβββββββββββββββββββ
[LAYER 1: AST CODE TOPOLOGY] β
(:File {path}) ββ[:DEFINES]βββΊ (:Function {name, pagerank, file})
β² β
[:CALLS*1..4]β β
βββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
[LAYER 2: AGENT MEMORY] β
[:HAS_RULE]
β
βΌ
(:Memory {rule, session_id, created_at})
Layer 1: Code Syntax & AST Topology (Track 1)
Using Tree-sitter, we parse TypeScript and Python files into AST entities during codebase ingestion:
-
Nodes:
:File,:Function,:Class,:Method -
Edges:
(:File)-[:DEFINES]->(:Function),(:Function)-[:CALLS]->(:Function),(:File)-[:IMPORTS]->(:File)
Layer 2: Cross-Session Episodic & Procedural Memory (Track 2)
Whenever an agent hallucinates or violates an architectural pattern, the developer rejects the diff (βN or clicking Reject & Learn). NexusIDE writes directly to FalkorDB:
MATCH (fn:Function {name: $function_name})
CREATE (m:Memory {
id: $memory_id,
rule: $rule_text,
rejected_patch_summary: $patch_summary,
timestamp: datetime()
})
CREATE (fn)-[:HAS_RULE]->(m)
On subsequent queries, the agent queries [:HAS_RULE] before proposing edits, permanently preventing regression loops!
Layer 3: Company Brain & Provenance (Track 3)
Enterprise context (Git blame, PR reviews, Linear/Jira tickets) is mapped as graph nodes:
MATCH (fn:Function {name: $name})
OPTIONAL MATCH (fn)-[:AUTHORED_IN|MODIFIED|TOUCHES]-(pr:PR)
OPTIONAL MATCH (eng:Engineer)-[:AUTHORED]->(pr)
OPTIONAL MATCH (pr)-[:RESOLVES]->(t:Ticket)
RETURN pr.id AS pr_number, pr.title AS pr_title, eng.handle AS author, t.key AS ticket;
When refactoring sensitive authorization or payment modules, the agent greets the engineer with full organizational awareness: "Warning: This function was modified in PR #104 by @alex.chen to resolve SEC-892."
4. FalkorDBβs Engine: Sub-Millisecond Cypher & Native PageRank
GraphBLAS Matrix Multiplication Under the Hood
FalkorDB doesn't do pointer chasing like legacy graph engines. Built on GraphBLAS, it represents graph adjacency as sparse linear algebra matrices.
Finding callers 4 hops away is computed via matrix-vector multiplication:
$$\mathbf{y} = \mathbf{A}^k \cdot \mathbf{x}$$
Where $\mathbf{A}$ is the sparse adjacency matrix of the call graph and $\mathbf{x}$ is the indicator vector for validateToken. The entire operation evaluates in CPU cache in 0.9ms!
Identifying Architectural Bottlenecks via Native PageRank
Not all functions carry equal weight. Slicing through helper utilities is low risk; modifying a central dispatcher can crash an entire platform.
NexusIDE executes native FalkorDB algorithms directly in Cypher:
CALL algo.pageRank('Function', 'CALLS')
YIELD node, score
SET node.pagerank = score
RETURN node.name, node.pagerank
ORDER BY score DESC
LIMIT 10;
Functions with high PageRank centrality are automatically assigned top architectural gravity in the frontend canvas and trigger heightened risk warnings in the agent prompt.
Latency Benchmarks: FalkorDB vs. Vector RAG
| Metric | Traditional Vector RAG (OpenAI / Pinecone) | NexusIDE (FalkorDB GraphBLAS) | Improvement |
|---|---|---|---|
| P50 Query Latency | 380 ms | 0.9 ms | 422x faster |
| P99 Query Latency | 720 ms | 1.7 ms | 423x faster |
| Multi-Hop Traversal (Hop 1-4) | Fails completely | 100% Deterministic | Zero hallucinations |
| Memory Footprint | External Cloud Service ($$$) | ~45 MB Docker container | Zero-cloud, local |
| Cost per 10k Lookups | ~$4.00 (Token embeddings) | $0.00 (Local GraphBLAS) | Free & infinite |
5. Standardized Agent Tooling with FastMCP
To ensure NexusIDE isn't locked into a siloed interface, we built a standalone FastMCP (Model Context Protocol) server in backend/mcp_server.py.
Any MCP-compliant client (Claude Desktop, Cursor, Antigravity, custom agents) can connect via:
{
"mcpServers": {
"nexus-code-graph": {
"command": "python",
"args": ["-m", "backend.mcp_server"],
"env": {
"FALKORDB_HOST": "localhost",
"FALKORDB_PORT": "6379"
}
}
}
}
The FastMCP server exposes three core primitives:
@mcp.tool()
def get_code_blast_radius(function_name: str, max_depth: int = 4) -> dict:
"""Traverses downstream and upstream call-chains in FalkorDB to calculate exact impact."""
query = """
MATCH path = (caller:Function)-[:CALLS*1..$max_depth]->(target:Function {name: $name})
RETURN caller.name AS name, caller.file AS file, min(length(path)) AS depth
ORDER BY depth ASC;
"""
return falkor_client.query(query, {"name": function_name, "max_depth": max_depth})
@mcp.tool()
def get_episodic_memory(function_name: str) -> dict:
"""Retrieves human rejection rules and past architectural guardrails."""
query = """
MATCH (fn:Function {name: $name})-[:HAS_RULE]->(m:Memory)
RETURN collect(m.rule) AS rules;
"""
return falkor_client.query(query, {"name": function_name})
@mcp.tool()
def get_company_context(function_name: str) -> dict:
"""Fetches author PRs and ticket intent from the company brain layer."""
query = """
MATCH (fn:Function {name: $name})-[:TOUCHES|AUTHORED_IN]-(pr:PR)<-[:AUTHORED]-(eng:Engineer)
RETURN pr.id, pr.title, eng.handle;
"""
return falkor_client.query(query, {"name": function_name})
6. The Hard Kill-Switch: Proving Graph Dependency
A common criticism of AI demo apps is that they use fancy databases for show, while the LLM quietly does ungrounded text generation in the background.
To prove that NexusIDE is strictly graph-native, we implemented a hard architectural kill-switch:
# backend/services/agent_tools.py
def check_falkor_health(falkor_service: Optional[FalkorService] = None) -> FalkorService:
client = falkor_service or get_falkor_service()
if not client.is_healthy():
raise ConnectionError(
"FalkorDB connection failed or port 6379 is unreachable. "
"Kill-switch activated: 0 context returned."
)
return client
When FalkorDB is shut down, running python backend/test_agent_killswitch.py proves:
-
check_falkor_healthtriggersConnectionError. - The agent prompt strictly refuses code generation.
- An
abortSSE event is emitted. - Exactly ZERO lines of code or patches are produced.
π§ͺ Test: FalkorDB Disconnected β Strict Kill-Switch Verification
β check_falkor_health properly raised ConnectionError
β falkor_blast_radius properly triggered kill-switch ConnectionError
β Disconnected agent emitted events: ['reasoning_chunk', 'abort', 'done']
β Confirmed: ZERO code patches emitted when graph engine is offline!
7. The NexusIDE UI is crafted with a high-performance Cupertino-dark aesthetic:
-
Interactive Knowledge Canvas: Powered by
@gravity-ui/graph, arranging nodes into 4 structured vertical swimlanes (Files, Core Functions, Blast Radius Callers, and Memory/PR Context). -
Live SSE Traversal Pulses: As the agent queries Cypher paths, nodes in the canvas illuminate in neon cyan via real-time SSE stream events (
graph_traversal). - Monaco Split Diff: Side-by-side patch review with synchronized line scrolling and syntax highlighting.
-
Dynamic Rejection Feedback: Pressing
βNrejects the patch, triggers a sound effect, and immediately persists an episodic memory node in FalkorDB without restarting the session.
8. Run It Yourself (1-Command Bootstrap)
You can clone and spin up the complete NexusIDE environment in under 60 seconds:
# 1. Clone the repository
git clone https://github.com/prathamxeth/nexus-ide.git
cd nexus-ide
# 2. Start FalkorDB and microservices via Docker Compose
docker compose up -d
# 3. Seed demo AST knowledge graph
cd backend && python seed_demo_data.py
# 4. Run automated test suites (AST, PageRank, Kill-Switch)
python test_agent_killswitch.py
python test_graph_layout.py
python test_api_endpoints.py
# 5. Launch the IDE studio
cd .. && ./run.sh
Open http://localhost:3000 and watch graph-native refactoring in action.
9. Conclusion
Vector embeddings were a groundbreaking milestone for fuzzy semantic text search. But software engineering is not fuzzyβit is exact, hierarchical, and deeply interconnected.
By embedding FalkorDB's sub-millisecond GraphBLAS engine and FastMCP directly into the inner loop of the coding agent, NexusIDE transforms AI from an unpredictable syntax guesser into a deterministic, context-aware software architect.
- βοΈ Star the Repo: https://github.com/prathamxeth/nexus-ide
- π¬ Watch the Demo: 3-Minute Hackathon Screencast
- π¬ Thoughts? Letβs discuss in the comments below!
Top comments (0)