Privacy-First Local Workspace
Cheeserag Studio
An end-to-end, fully offline AI workspace. Upload PDFs, CSVs, and transcripts, then chat with them through a rich 3-panel web interface. Every answer is strictly grounded in your documents — no hallucinations, no data leakage, zero cloud calls.
What's Inside
Cheesebrain
C++20 | LLM InferenceOpenAI-compatible server (/v1/chat/completions, /v1/embeddings).
PomaiDB
C++20 + Python | Vector DBMulti-membrane edge vector DB with zero-OOM guarantees.
Cheese API
Python / FastAPI | OrchestratorWorkspace CRUD, async ingest, citation metadata, audio overviews.
Cheesepath Agent
Go | Autonomous AgentCLI agent with ReAct, planning, multi-role panel, tool registry.
Studio UI
TypeScript / Next.js 14 | UI3-panel workspace: sources, chat, notes with exact PDF citations.
Edge AI Design Philosophy
"I could have easily integrated the OpenAI API, but my goal was to engineer a highly secure, air-gapped, local-first RAG workspace capable of running on resource-constrained hardware. By designing a micro-agent pipeline architecture and integrating it tightly with PomaiDB, I successfully mitigated the reasoning limitations of a 0.5B model. This kept the total memory footprint under 1 GB while maintaining high extraction accuracy and zero data leakage."
Tactic 1: Algorithmic Citation
The LLM is never asked to place citation markers. The backend runs TF-IDF cosine similarity between the generated answer and retrieved chunks. Footnote markers are programmatically inserted, ensuring zero hallucinated citations.
Tactic 2: Prompt Chaining
Audio overviews run sequentially: extract bullet points, aggregate via pure Python, and synthesize dialogue. Each LLM call is kept under 512 tokens, well within the reliable context window of a 0.5B model.
Tactic 3: Constrained Generation
Enforcing max_tokens to 150 prevents rambling. Using completion-style prompts ending with a colon forces the model to fill a blank rather than drift into uncontrolled generation.
Recommended Start (Docker Compose)
The easiest path. Docker builds all three C++ submodules automatically inside containers.
docker-compose up --build -d| Service | URL |
|---|---|
| Studio Web UI | http://localhost:3000 |
| Cheese API | http://localhost:9090/docs |
| Cheesebrain | http://localhost:8080 |
Manual Build & Installation
1. Submodules & PomaiDB
git clone https://github.com/pomagrenate/cheeserag.git cd cheeserag git submodule update --init --recursive cd third_party/pomaidb git submodule update --init third_party/palloc cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=g++ -DPOMAI_BUILD_TESTS=OFF cmake --build build -j$(nproc) cd ../..2. Cheesebrain & Go Agent
cd third_party/cheesebrain cmake -B build -DCMAKE_BUILD_TYPE=Release cmake --build build --config Release -j$(nproc) cd ../.. go build -o build/cheeserag-agent ./cmd/cheeserag-agent/3. Python API Setup
python3 -m venv .venv source .venv/bin/activate pip install --upgrade pip pip install -r requirements.txt export POMAI_C_LIB=$(pwd)/third_party/pomaidb/build/libpomai_c.so export PYTHONPATH=$(pwd)/third_party/pomaidb/python:$PYTHONPATHMinimum Prerequisites
- CMake: 3.20+
- Compiler: C++20 capable (GCC 11+, Clang 14+)
- Go: 1.23+
- Python: 3.10+
- Node.js: 18+
System Data Flow
Browser
│ drag-drop PDF
▼
Studio (Next.js :3000)
│ POST /api/v1/ingest (multipart)
▼
Cheese API (FastAPI :9090)
│ 1. process_file_with_meta()
│ 2. fetch_embedding()
│ 3. put_chunk_with_text()
│ 4. store_chunk_meta()
│ SSE progress → browser
▼
PomaiDB (libpomai_c.so — in-process)
Chat query
Browser ──────────────────────────────────────►
Cheese API
│ embed query
│ search_rag_membrane()
│ if max_score < 0.35 → "not found"
│ else: build grounded system prompt
│ stream /v1/chat/completions
▼
Cheesebrain (:8080)