An intelligent, multi-agent customer support platform built with LangGraph, hybrid RAG retrieval, and multi-model routing (Groq Llama 3 + Google Gemini). FlowDesk automatically classifies customer intent, retrieves relevant documentation, generates grounded answers with confidence scoring, and seamlessly escalates to human agents when necessary.
User Query
│
▼
┌──────────┐
│ Router │ ← Groq Llama 3.3 (intent classification)
│ Agent │
└────┬─────┘
│
├── faq ──────────► ┌───────────┐
│ │ RAG Agent │ ← Hybrid Search + Cross-Encoder Reranking
│ │ │ → Groq (short) / Gemini (complex/retry)
│ └─────┬─────┘
│ │
│ confidence < 0.6?
│ ┌────┴────┐
│ │ Yes │ No
│ │ Retry │ → ✅ Return Answer
│ │ (wider │
│ │ search,│
│ │ switch │
│ │ model) │
│ └─────────┘
│
├── action ───────► ┌──────────────┐
│ │ Action Agent │ ← Tool-calling (orders, refunds, account)
│ └──────────────┘
│
└── complex ──────► ┌────────────────────┐
│ Escalation Agent │ ← Human handoff
└────────────────────┘
- Hybrid Retrieval Pipeline: Combines dense semantic search (Gemini embeddings) with sparse keyword search (BM25) using Reciprocal Rank Fusion (RRF), followed by Cross-Encoder reranking for high precision.
- Dynamic Model Routing: Routes latency-sensitive or simple queries to Groq (Llama 3.3), while reserving Gemini for complex reasoning and conversational retries.
- LLMOps & Telemetry: Every interaction is logged to a PostgreSQL database, tracking confidence scores, groundedness metrics, and explicit user feedback (thumbs up/down) for continuous improvement.
- Graceful Degradation: Built-in fallbacks ensure the system remains operational (e.g., seamlessly dropping to sparse-only search if the embedding API is unreachable).
- Orchestration: LangGraph (StateGraph with conditional edges + self-correction)
- LLMs: Groq (Llama 3.3 70B) & Google Gemini (3.5 Flash / 2.5 Pro)
- Embeddings: Google
models/gemini-embedding-2 - Vector Database: Pinecone (Serverless)
- Reranking: Sentence Transformers (
cross-encoder/ms-marco-MiniLM-L-6-v2) - Database: PostgreSQL (Supabase) / SQLite (Local Dev)
- API: FastAPI + Uvicorn + Server-Sent Events (SSE) Streaming
- UI: Next.js (App Router) Demo Frontend + Tailwind CSS
- CI/CD: GitHub Actions → Google Cloud Run (Backend) & Vercel (Frontend)
- Python 3.11+
- uv package manager
- Node.js 18+ (for the frontend)
Backend:
git clone https://github.com/tonystalker/FlowDesk.git
cd FlowDesk
uv syncFrontend:
cd flowdesk-demo
npm install# Backend (.env)
cp .env.example .env
# Edit .env with your API keys:
# GEMINI_API_KEY, GROQ_API_KEY, PINECONE_API_KEY, PINECONE_ENV, DATABASE_URL
# Frontend (flowdesk-demo/.env.local)
echo "BACKEND_URL=http://127.0.0.1:8000" > flowdesk-demo/.env.localuv run alembic upgrade headuv run python -m retrieval.ingestStart the REST API (Backend):
uv run uvicorn gateway.main:app --reload
# Available at http://localhost:8000Start the Next.js UI (Frontend):
cd flowdesk-demo
npm run dev
# Opens at http://localhost:3000The platform includes a comprehensive test suite and evaluation harness to benchmark retrieval accuracy and agent reliability.
# Run the test suite (50+ tests)
uv run pytest -v
# Run the linter
uv run ruff check .
# Run the evaluation harness for retrieval metrics
uv run python -m evaluation.eval_harnessFlowDesk/
├── gateway/ # FastAPI + Gradio UI
├── orchestrator/ # LangGraph multi-agent system & state
│ └── agents/ # Router, RAG, Action, and Escalation agents
├── retrieval/ # Hybrid RAG pipeline (Ingest, Dense/Sparse, Reranking)
├── evaluation/ # Benchmarking & confidence scoring
├── db/ # SQLAlchemy models & Alembic migrations
├── docs/ # Support knowledge base documents
├── tests/ # Pytest suite
├── Dockerfile # Multi-stage production build
├── .github/workflows/ # CI/CD pipeline
└── config.py # Centralized environment configuration
The project is configured to deploy automatically to Google Cloud Run via GitHub Actions on every push to the main branch.
The CI pipeline automatically:
- Lints the codebase with
ruff - Runs the full
pytestsuite - Builds the Docker container
- Deploys to Cloud Run
Required GitHub Secrets: GCP_SA_KEY, PROJECT_ID, GEMINI_API_KEY, GROQ_API_KEY, PINECONE_API_KEY, PINECONE_ENV, DATABASE_URL