Laurent00TT/PharosRAG

Pharos — local-first agentic RAG for your team's document library: multi-format ingest, hybrid retrieval, enterprise ACL, dual HTTP + MCP exits.

291 ★0 forksPythonUpdated 16d ago

What you need to know

A self-built multi-format agentic RAG system that turns PDFs, scans, docx, pptx, and xlsx into a local knowledge base with enterprise access control (ACL) and page-traceable citations. Two exits share one semantics: an HTTP API (closed-pipeline QA) and MCP (agentic RAG), running as a resident daemon under systemd.

Install

pip install -e '.[dev]' (src-layout, editable install)
docker compose --env-file .env.compose up -d --scale pharos=3 (three-tier scale-out)

Usage

  • python -m pharos ask "What do we have on X?" (closed-pipeline QA with citations)
  • Admin: python -m pharos index --corpus <parsed_dir> --dest ~/rag_real (stop daemon first — single-client lock)
  • For Claude Code agentic mode: copy .mcp.json.example to .mcp.json, fill in PHAROS_API_KEY and local paths
  • python -m pharos health; no daemon? use 'pharos mcp --direct' (loads GPU model itself)

Key features

  • Two exits: HTTP API (pharos serve, /v1/ask: retrieve → grounding → DeepSeek → cited answer) and MCP (pharos mcp) sharing one tool contract (toolcore)
  • Enterprise ACL: X-API-Key → identity → tenant/principals, hard filtering at retrieval; fail-closed (unknown/absent key = 401)
  • Runs over 77 real documents and 7,652 chunks; every retrieved passage tagged trust: untrusted against prompt injection
  • Resident daemon design (MCP is a thin HTTP adapter); three-tier scale-out (inference GPU / pharos app / Qdrant server)
  • Ships a 12-piece Chinese-language RAG learning and interview-prep series (4,122 lines)

Best for

Teams that need a locally-hosted, access-controlled RAG knowledge base over internal documents with page-level citations, served to both humans (HTTP) and agents (MCP).

Caveats

  • Documentation is in Chinese (code, CLI, and commit history are in English)
  • Runs under systemd; daemon must be running for MCP mode (or use pharos mcp --direct)
  • Requires DEEPSEEK_API_KEY for the /v1/ask closed-pipeline generation
  • HTTPS and public exposure are explicit non-goals — tunnel in for remote access; binds 127.0.0.1 by default
  • Throughput ceiling is the forward speed of a single inference GPU card (GPU serialises); replicas add concurrency, not throughput
  • Single-client lock on embedded Qdrant — stop the daemon before indexing
Platforms: Linux (systemd)Clients: Claude Code
Documentation ↗

Reviewed 2026-08-07

Topics

agentic-ragembeddingsfastapihybrid-searchknowledge-basellmlocal-firstmcpmodel-context-protocolpythonqdrantragretrieval-augmented-generationself-hosted
View on GitHub ↗
Stars
291★
Forks
0
Language
Python
License
MIT
Created
2026-05-25
Last push
2026-07-22