![]() |
|
[Quantum] My journey building Graph-RAG in production - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Artificial Intelligence (https://hackforums.net/forumdisplay.php?fid=460) +---- Forum: AI Programming and Vibe Coding (https://hackforums.net/forumdisplay.php?fid=462) +---- Thread: [Quantum] My journey building Graph-RAG in production (/showthread.php?tid=6309348) |
My journey building Graph-RAG in production - Oh_Well - Sep 30, 2025 My journey building Graph-RAG in production
Hi guys, so I've been building production Graph-RAG systems for serious orgs (EU/US defense orgs/contractors etc). I was preparing a thread like this but honestly it was nightmare thinking the sequence of all that information. I've been putting together this knowledge and work for almost a year now so I hope this thread becomes a go-to resource that people return to when exploring Graph-RAG and one they recommend to others looking to prioritize their workflow. I think now it's the right time to share it and consider it as my 2nd entry to this amazing contest. Quantum Thread Contest #1 - Win BTC & HackForums Awards! - Recruitment Why this was needed in 2025 I walked into environments where mission-critical intel lived in PDFs, wikis, tickets, and legacy DBs. Vector similarity found "close" text but couldn't explain why claims were true or trace dependencies across projects and time. Graph-RAG turned silos into a living map you can reason over. Graph-RAG gave us:
Graph-RAG in one line Fuse a knowledge graph (entities + typed edges) with RAG so your LLM retrieves paths with provenance, not just similar paragraphs. Week 1: Ship a walking skeleton
Code source_id, url, timestamp, confidence
tip: Keep a raw-docs bucket (S3/GCS) - - store hashes and versions for reproducible answers. Work on a minimal retrieval loop that actually works
Graph expansion:
Make the LLM play by your rules Use a system prompt that forces citations like [DOC-123] and allows "Insufficient evidence". Assemble context as subgraphs with human-readable paths: Code PATH: Component X -> DEPENDS_ON -> System Y -> INCIDENT -> Ticket #4412This single change killed most hallucinations for me. Chunking that won't break everything Keep semantic units intact (headers/sections/tables). My default: ~400–1200 tokens per chunk. Use one embedding provider, and store embedding version + dimension on each chunk so you can migrate later. A schema that actually survives on a production env Start simple:
Index setup & author-linking (no code):
Two game changing moments
Validate before you insert (avoid a dirty graph) Or better - how to avoid garbage in - garbage out lol LLMs extract noisy triples. I run a validator: "Is this relationship supported by the snippet? Return 0..1." Insert only if ≥0.7 and always connect via evidence. Validated insert flow - what happens (no code):
Entity resolution Cache canonical names - reconcile nightly with string sim + embedding sim + org IDs. Keep a manual override list. Basically treat this as a service, not a one-off script. Performance & cost cheats
The prompt & path trick Render edge types with tiny natural-language glossaries (e.g., Code DEPENDS_ON = "requires to function"LLMs reason better when edge semantics are explicit!!!! Evaluation that won trust
Build a 30–50 question eval set from real stakeholders. Re-run after every change. When you dont want heavy pre-processing Look at lightweight/"lazy" Graph-RAG approaches that reduce up-front indexing (useful for pilots). You can also auto-tune prompts per domain if your corpora vary a lot. Orchestration
A tiny 30-day plan that worked repeatedly Week 1: ingest ~300 docs, naive extraction, barebones endpoint: /ask Week 2: hybrid retrieval (KNN > graph hops), re-ranker, strict citations. Week 3: eval harness, logging/traces, hallucination checks. Week 4: caching + indices, RBAC on nodes/edges, target P50 < 2.5s. What you don't want
What this enabled in practice Analysts got answers with traceable "whys". Engineers saw downstream blast radius. Support agents got troubleshooting chains instead of isolated KB hits. They trusted it because every non-obvious claim had a doc ID and a path. Copy-paste snippets System prompt for cited, grounded answers: Code SYSTEM: You are a precise analyst. Only use the provided CONTEXT.Simple rerank scoring (fast + effective): Code score = 0.5semantic_sim(query, text)Nightly graph quality checks (no code):
Sources & starter kits
There is also CrewAI but I didn't include it because I'm currently working with it - so I will probably come back with a separate thread if I find it extraordinary. If you're building something similar and want a second pair of eyes, drop a reply or send me a message and I will share exact patterns that worked for me. If you read this whole thing - you're an absolute legend. ✌ RE: [QTC] My journey building Graph-RAG in production - kapakie - Sep 30, 2025 Nice read, you covered it very well RE: [QTC] My journey building Graph-RAG in production - Hackers - Sep 30, 2025 Awesome, this is definitely a hot topic here are my two favorite comments from you: Over-modeling the schema. Keep it small ---- grow with real questions!!!! Ignoring timestamps. Stale edges look authoritative to LLMs. We specifically dealt with these two in a past project and came to the same conclusions. Timestamps for data is absolutely required for organizations that can change processes, priorities, and update info over time. Even if it's old static data... timestamp it, order it, etc if you can. If you can't, make sure you go through and remove contradictions that can't be assessed properly. "I was sad yesterday, I am happy today" is much different than "I am sad, I am happy". Allowing our system to adjust with real user feedback (reject, approve, real comments) was way more useful. It's "obvious" but at the same time, the improvements we saw after implementing this was night & day, to the point where it was not as "obvious" how impactful it would be ahead of time. > Be careful of contamination / bad users / mistakes in data. > We actually don't allow the overall system (in the specific project I'm referencing) to be influenced by everyone. Customers are isolated, and within customer accounts there's separation between entry types, entries, etc. RE: [QTC] My journey building Graph-RAG in production - itcorp - Oct 1, 2025 Interesting read my friend, definitely high quality content. RE: My journey building Graph-RAG in production - Oh_Well - Oct 3, 2025 (Sep 30, 2025 03:32 PM)kapakie Wrote: Nice read, you covered it very well (Sep 30, 2025 08:46 PM)enki Wrote: Awesome, this is definitely a hot topic Good points! (Oct 1, 2025 10:20 AM)itcorp Wrote: Interesting read my friend, definitely high quality content. Thank you, mate! RE: My journey building Graph-RAG in production - greenhunter2 - Jul 14, 2026 Good points! |