Static Git Graph RAG · Case Study 05

Astra Knowledge Graph Engine

I built a file-based Graph RAG layer inside the repo. The build writes graph and MiniSearch indexes. Runtime loads them into memory and serves cached results quickly.

status

PRODUCTION

environment

Git-controlled static JSON + in-memory MiniSearch

ingress

Next.js API Routes

runtime graph

5 nodes / 4 edges

System map

Astra Knowledge Graph Engine

Env: Git-controlled static JSON + in-memory MiniSearchIngress: Next.js API Routes

Problem: I wanted fast site retrieval without a managed vector database. The system needed low token use, fast lookup, and a Git-friendly build path.

My engineering note

I built a file-based Graph RAG layer inside the repo. The build writes graph and MiniSearch indexes. Runtime loads them into memory and serves cached results quickly.

Live path

deserialization: Manifest Index -> MiniSearch trie

Path running

Mini Map
Interactive map

Zones, edges, and logs come from the case-study data model.

Architecture Decision

Why I chose this design.

Short decision notes tied to the code or config that mattered.

Decision

lib/context.ts

I chose build-time indexing because the site content already lives in Git. It keeps retrieval cheap, fast, and easy to deploy.

lib/context.tstypescript
typescript
import { getCompressedContext } from "@/lib/context";import { runManojFastAgent } from "@/lib/manoj-agent";
// Eager index deserialization eliminates runtime overhead// Warm memory cache resolves identical queries in ~0.1msconst cache = new Map<string, CompressedContext>();
export function getContext(query: string) {  const key = query.trim().toLowerCase();  if (cache.has(key)) return cache.get(key);
  const context = getCompressedContext(query);  cache.set(key, context);  return context;}
Next case study

AI Home Lab API Gateway

Python FastAPI gateway - I built a local OpenAI-compatible gateway so my site, agents, and scripts could call one stable /v1 contract. Ollama, Po...

Read next

Work With Me

Need this level of architecture review?

Bring the hard system constraint: retrieval quality, agent failure modes, latency, evaluation, deployment topology, or technical market education.