LIVE SYSTEM  ·  Case Study 01  ·  AI Engineering

NEURAFLOW AI

AI-Powered Document Intelligence with Multi-LLM Orchestration — routing queries intelligently across Gemini, Groq & OpenRouter with a RAG backbone.

● LIVE V.3.2.0 Built 2025 Python LangChain RAG
98%
Answer Accuracy
120ms
Avg. Inference
4+
LLMs Orchestrated

Why One LLM Was Never Enough

Working through large research PDFs and technical documents, I kept hitting the same wall: no single LLM was reliably best at everything. Gemini excelled at structured multi-step reasoning, Groq was blazing fast for quick factual lookups, and OpenRouter models offered the best creative synthesis. Manually switching between tools destroyed the flow.

The deeper problem: LLMs hallucinate badly on questions about specific documents they haven't seen. Every answer needed to be grounded in retrieved context — not fabricated from training weights. The solution required combining RAG for document grounding with intelligent query routing to dispatch each question to its optimal model.

System Design

NeuraFlow uses a two-stage pipeline: a RAG layer that grounds every response in retrieved document chunks, followed by a routing layer that dispatches queries to the optimal LLM based on query type, latency budget, and cost.

User Query
LangChain Orchestrator
RAG Pipeline
ChromaDB / FAISS
Document Ingestion
Query Router
Gemini Flash
|
Groq LLaMA-3
|
OpenRouter
Grounded Response → User

The Query Router classifies each query into factual lookup, analytical reasoning, or creative synthesis — then dispatches to the appropriate LLM. Simple lookups hit Groq at 120ms; complex reasoning flows to Gemini Flash; creative tasks go to OpenRouter. Cost and quality are both optimised automatically.

Built With

🐍 Python 3.11 🔗 LangChain v0.2 ✦ Gemini Flash API ⚡ Groq LLaMA-3 🌐 OpenRouter 🗄️ ChromaDB 🔍 FAISS 📊 Streamlit 📄 PyMuPDF 🧠 Sentence Transformers

What It Achieved

What I'd Do Differently

Lesson 01

Build the eval benchmark first

I shipped the router before defining a proper evaluation suite. Next time I'd write the benchmark questions and scoring criteria before writing a single line of pipeline code.

Lesson 02

Chunk size beats model choice

Large 1000-token chunks caused context overflow and retrieval noise. Smaller, semantically coherent chunks with 20% overlap improved precision more than any model swap.

Lesson 03

Cache embeddings aggressively

Re-embedding on every restart added a 15-second penalty. Persisting ChromaDB to disk cut cold-start from 15s to under 2 seconds — a 7× improvement with one config flag.

Lesson 04

Source citations build trust

Early beta users didn't trust answers without provenance. Adding chunk-level citations with page numbers dramatically increased engagement and reported confidence.

Want to see it live?

The full demo is deployed on Streamlit — upload any PDF and interrogate it across four LLMs simultaneously.

// Other Case Studies ← MindMesh AI AI Trading Coach →