NexusAI is a production-grade, multi-agent AI system that answers complex business questions by routing dynamically between unstructured document retrieval (RAG) and structured database analysis (Text-to-SQL). It includes built-in verification pipelines, guardrails, and system observability.
User Query (Chat UI)
│
▼
┌─────────────────┐
│ Guardrails │ ← Input validation, PII check
└────────┬────────┘
│
┌────────▼────────┐
│ Supervisor │ ← Query decomposition + routing
│ (LangGraph) │
└──┬─────┬─────┬──┘
│ │ │
┌─────────▼┐ ┌─▼────┐ ┌▼──────────┐
│ RAG Agent│ │ SQL │ │ Analytics │
│(Docs/PDF)│ │Agent │ │ Agent │
└────┬─────┘ └──┬───┘ └─────┬─────┘
│ │ │
┌────▼────┐ ┌───▼────┐ ┌────▼─────┐
│ Qdrant │ │Postgres│ │ Plotly │
│ Hybrid │ │ │ │ Charts │
└─────────┘ └────────┘ └──────────┘
│ │ │
┌──▼─────▼─────▼──┐
│ Eval Agent │ ← Faithfulness, relevance, SQL safety
└────────┬────────┘
│
┌────────▼────────┐
│ Response Gen │ ← Citations, confidence, merged answer
└────────┬────────┘
│
┌────────▼────────┐
│ Observability │ ← Telemetry traces, latency, tokens
└─────────────────┘
Copy .env.example to .env and fill in your keys:
cp .env.example .envEnsure you provide:
OPENAI_API_KEY(required for GPT-4o agents and embeddings)COHERE_API_KEY(optional, for document reranking)LANGFUSE_PUBLIC_KEY/LANGFUSE_SECRET_KEY(optional, for telemetry tracing)
Start the local PostgreSQL, Redis, and Qdrant containers:
make upSetup the virtual environment, install requirements, and run the FastAPI server:
cd backend
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reloadInstall dependencies and run Next.js:
cd frontend
npm install
npm run devOpen http://localhost:3000 to access the chat dashboard.