Skip to main content

RAG scaffolder + embedded library: Docker-free local mode, multi-backend (Qdrant/Milvus/Chroma/LanceDB/pgvector), Gemini advisor, SaaS Query API with auth + rate limit

Project description

perfectRAG

RAG scaffolder + embedded Python library. Run with Docker, without Docker, or as a SaaS API — your choice.

v1.1 adds: Docker-free local mode (from perfectrag import RAG), full component matrix (5 vector DBs × 5 embeddings × 4 rerankers × 6 LLM runtimes), Gemini advisor, and a built-in OpenAI-style Query API with bearer auth + rate limit.

Three ways to use it

# 1. Embedded Python library (no Docker)
from perfectrag import RAG
rag = RAG.from_config("perfectrag.yml")
rag.ingest("./docs")
print(rag.query("What is RAG?").answer)
# 2. Scaffolded docker-compose stack (same config, same API)
perfectrag init my-rag
cd my-rag && perfectrag up

# 3. SaaS API for external clients
perfectrag key issue --name "prod app" --rate 100 -p .
curl -H "Authorization: Bearer sk-rag-..." \
  -d '{"question":"..."}' http://localhost:8000/v1/query

Instead of gluing RAGFlow/Dify/LightRAG docker-compose files by hand, perfectrag:

  1. Detects hardware (CPU / NVIDIA / Apple Silicon / AMD) + VRAM tier.
  2. Asks use-case questions (Q&A / GraphRAG / agent / multimodal / code / web).
  3. Picks a recipe (LLM + embedding + reranker + vector DB + parser) tuned to your hardware.
  4. Scaffolds a full project (docker-compose.yml + .env + mcp.yaml + skills/ + optional addons).
  5. Orchestrates with perfectrag up / doctor / logs / eval / deploy.
  6. Ships a browser wizard (Next.js) if you'd rather click than type.

Install

pip install perfectrag           # CLI + core
pip install 'perfectrag[web]'    # + FastAPI backend for Next.js UI

Quickstart — the one-liner

perfectrag init my-rag --with eval,observability,paperclip
cd my-rag
perfectrag up

That gives you a RAG service, eval dashboard, observability gateway, and multi-agent orchestrator running on localhost in one shot.

Commands

Command What it does
perfectrag init [DIR] Wizard → scaffold a project
perfectrag init DIR --with a,b,c Install addons at init time
perfectrag init DIR --template ragflow-stack Force a specific backbone
perfectrag add mcp/skill/addon <name> Extend a generated project
perfectrag up / down / logs / doctor Orchestrate the generated project
perfectrag eval --dataset qa.jsonl Run RAGAS + DeepEval (needs eval addon)
perfectrag deploy helm/flyio/railway Render production deploy assets
perfectrag web Start FastAPI backend for Next.js UI
perfectrag list templates/mcp/skills/addons/installed Show catalogues
perfectrag hw Show detected hardware + tier

Templates (v1.0)

Template Use-case Backbone
custom-naive-rag Learning / CPU-only / tiny corpus FastAPI + Qdrant + Ollama + open-webui
ragflow-stack Production Q&A + hybrid search + agentic RAGFlow
lightrag-stack GraphRAG / multi-hop reasoning LightRAG
dify-stack Workflow / agent / no-code team Dify

Third-party templates: publish via [project.entry-points."perfectrag.templates"] — users get them after pip install.

Addons (v1.0)

Addon Purpose Based on
eval RAG quality measurement RAGAS, DeepEval
observability LLM gateway + tracing LiteLLM, Langfuse
context-eng Prompt compression + memory DSPy, LLMLingua, mem0
ingest-worker Scheduled web crawl → vector store Crawl4AI
notion-sync Notion → vector store notion-client
gdrive-sync Google Drive → vector store google-api-python-client
confluence-sync Confluence → vector store atlassian-python-api
paperclip Multi-agent orchestrator Paperclip

Each addon is a compose.<name>.yml overlay that perfectrag up auto-merges. See docs/addons.md.

Browser wizard

pip install 'perfectrag[web]'
perfectrag web           # backend on :7777

# in another terminal
cd ui && pnpm install && pnpm dev    # UI on :3001

See docs/ui.md.

Deploy to production

perfectrag deploy helm --project ./my-rag --out ./chart
helm lint ./chart
helm install my-rag ./chart

Also supports flyio and railway. See docs/deploy.md.

Docs

License

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

perfectrag-1.1.0.tar.gz (79.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

perfectrag-1.1.0-py3-none-any.whl (112.6 kB view details)

Uploaded Python 3

File details

Details for the file perfectrag-1.1.0.tar.gz.

File metadata

  • Download URL: perfectrag-1.1.0.tar.gz
  • Upload date:
  • Size: 79.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for perfectrag-1.1.0.tar.gz
Algorithm Hash digest
SHA256 eb0ab6311342b1759437bf103417e9cf8e1b3c351f805f0389941534c6e804e4
MD5 ec88a690b780ccdc90c2bf86f1b67a1b
BLAKE2b-256 8c1a5bac2f69e3d47b2b946b7f92452e5e34660b7bb769540eaa12b3d5249896

See more details on using hashes here.

File details

Details for the file perfectrag-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: perfectrag-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 112.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.11

File hashes

Hashes for perfectrag-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 16d3c3d105eb6e7dfe7cc1d3da6b4fec711ca475908eb245780a7479969c01f6
MD5 840d5a6a0d1989cf46d049074dd13a35
BLAKE2b-256 4981cd98a0e90f1450698d3d32ff996f9682e9652b29b6a7b8785d65f2c863fa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page