raglab-trace
v1.1.5
Published
Central Command CLI and Local Runtime Bootstrapper for RAG Laboratory
Maintainers
Readme
RAG Laboratory
Visual workflow editor for a real AI/RAG pipeline. The canvas is a debugger on top of a FastAPI execution engine. Node colors, counters, confidence, latency, retrieved chunks, and LLM text come from actual operations — nothing is simulated in the UI.
Stack
- Frontend: React, TypeScript, Vite, React Flow, Tailwind
- Backend: Python, FastAPI, SQLAlchemy, SSE
- Data: PostgreSQL + pgvector (one database)
- Default model host: local Ollama
Prerequisites
- Docker (for PostgreSQL)
- Python 3.11+
- Node.js 20+
- Ollama running locally
Pull at least one chat model and one embedding model:
ollama pull qwen2.5
ollama pull nomic-embed-textnomic-embed-text is 768-dimensional, which matches EMBEDDING_DIM in .env.
Run
cp .env.example .env
docker compose up -d
cd backend
python -m venv .venv
# Windows: .venv\Scripts\activate
pip install -r requirements.txt
cd ..
uvicorn app.main:app --reload --app-dir backend --port 8000In another terminal:
cd frontend
npm install
npm run devOpen http://localhost:5173.
NVIDIA and GitHub Models are optional. Set NVIDIA_API_KEY or GITHUB_TOKEN in .env (server-side only). Switch the provider on an LLM or Embedding node without changing the graph.
Demo workflow
On first boot the backend seeds a 3-page PDF (energy_efficiency_practices.pdf) and a workflow with:
- PDF → chunker → embeddings → PostgreSQL/pgvector
- User query → orchestrator → prompt → LLM → confidence → branch
- Low confidence → query embedding → vector search → prompt → LLM → confidence → output
Use Run workflow. Click a node for input/output/telemetry. Click an edge for the payload that actually crossed it. Delete the Vector Search node and run again: if confidence is below the configured threshold, the run fails with a retrieval-path error.
Notes
- Query embeddings are not stored as knowledge. Document embeddings are.
- Confidence is a weighted combination of observable signals (completeness, consistency, evidence coverage, answer validation), not an LLM self-score.
- Pause / resume / stop are honored between nodes, not mid-token.
