Source-grounded RAG workspaces β 100% local embeddings, BYOK or fully offline generation.
GopherNotebook is an open-source document intelligence platform. Upload PDFs, Word docs, spreadsheets, and web pages into isolated workspaces called Notebooks, then chat with them using any LLM you choose β cloud or fully local. Your files never leave your machine during ingestion; embeddings, chunking, and reranking all run locally via Weaviate and Qwen3 GGUF models.
- Features
- Architecture
- Tech Stack
- Quick Start
- Configuration
- Usage Guide
- Supported LLM Providers
- Supported File Types
- Security & Privacy
- Roadmap
- Project Structure
- Contributing
- License
| Feature | Description |
|---|---|
| Local embeddings | Files are chunked and vectorized entirely on your machine via Qwen3 (GGUF Q4_K_M) and LocalAI β no data leaves your network |
| Hybrid search | Combines dense vector similarity (HNSW cosine) with BM25 keyword matching (Ξ± = 0.5) for best-of-both retrieval |
| Cross-encoder reranking | A second Qwen3 model re-scores the top candidates using full pairwise attention before they reach the LLM |
| HyDE retrieval | Hypothetical Document Embedding β generates a fake answer, embeds it, and uses that as the query vector for better recall on abstract questions |
| Semantic deduplication | Skips near-duplicate chunks at ingest time (cosine distance < 0.03 threshold, configurable) to keep the index clean |
| Source filtering | Pin retrieval scope to specific uploaded files per chat turn |
| Adjustable retrieval params | Per-query control over retrieval limit (1β50), reranker top-N, and LLM temperature via the Settings panel |
| Feature | Description |
|---|---|
| Isolated workspaces | Every notebook is a self-contained project with its own documents, chat history, and system prompt |
| Notebook tags | Label notebooks with filterable tags; filter the dashboard by any tag with one click |
| Custom system prompts | Override the default assistant persona per notebook |
| Multi-notebook search | Search across all notebooks from the dashboard β pure retrieval, no API key needed |
| Feature | Description |
|---|---|
| Multi-file upload | Drag-and-drop or browse; up to 50 MB per file, processed concurrently via a Go worker pool |
| URL ingestion | Paste any http/https URL; the backend fetches, strips HTML, and ingests it as a source |
| Re-ingest | Re-process any previously uploaded file from disk without re-uploading (after config changes or model swaps) |
| Format support | PDF, DOCX, XLSX, PPTX, TXT, HTML β parsed and semantically chunked (~800 tokens, 800-char overlap) |
| Feature | Description |
|---|---|
| Streaming responses | Tokens stream token-by-token via Server-Sent Events β no waiting for the full reply |
| Granular citations | Every assistant response links claims to the exact source file and page number |
| Message edit & regenerate | Hover any user message and click the pencil icon to truncate history and re-ask from that point |
| Export chat | Download the full conversation as a Markdown file |
| Clear chat history | Wipe the conversation without deleting your documents |
| Feature | Description |
|---|---|
| 7 providers | OpenAI, Anthropic, Google Gemini, Groq, OpenRouter, Ollama, LM Studio |
| BYOK | API keys live exclusively in browser localStorage β the backend never sees them |
| Live model discovery | Queries the provider API on key entry to enumerate real available models β no stale hardcoded lists |
| Model search | Fuzzy-search through 300+ OpenRouter models instantly |
| Ollama auto-start | start.sh detects a local Ollama installation and starts the server automatically |
GopherNotebook uses a three-stage RAG pipeline: Ingest β Retrieve β Generate.
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β INGEST PIPELINE β
β β
β File/URL βββΊ Go Worker Pool βββΊ Semantic Chunker (~800 tok) β
β β β
β LocalAI (Qwen3 embed) β
β β β
β [Semantic dedup check via nearVector query] β
β β β
β Weaviate (HNSW + BM25 index) β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β RETRIEVE PIPELINE β
β β
β User query βββΊ [optional HyDE: generate fake answer, embed it] β
β βββΊ Hybrid search (vector Ξ±=0.5 + BM25) β
β βββΊ Top 20 candidates β
β βββΊ Cross-encoder reranker (Qwen3-Reranker-0.6B) β
β βββΊ Top N ranked chunks β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β GENERATE PIPELINE β
β β
β Ranked chunks + system prompt + history βββΊ langchaingo β
β βββΊ OpenAI / Anthropic / Gemini / Groq / OpenRouter β
β / Ollama / LM Studio β
β βββΊ Streaming SSE βββΊ Next.js frontend β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Service | Port | Technology | Purpose |
|---|---|---|---|
| Frontend | 3000 | Next.js 16 + React 19 | Chat UI, dashboard, settings |
| Backend | 8090 | Go + Gin | REST API, SSE streaming, RAG orchestration |
| Weaviate | 8080 | Weaviate 1.28 | Vector DB β HNSW + BM25 |
| LocalAI | 8081 | LocalAI (llama.cpp) | Qwen3 embedding model |
| Reranker | 8082 | llama.cpp server | Qwen3-Reranker-0.6B cross-encoder |
Backend
- Go 1.22+ β concurrent worker pool, streaming handlers
- Gin β HTTP router
- langchaingo β LLM provider abstraction
- tabula β document parsing (PDF, DOCX, XLSX, PPTX)
- Weaviate Go client β vector DB operations
- google/uuid β notebook/message IDs
Frontend
- Next.js 16.2 + React 19
- Tailwind CSS v4 + shadcn/ui (base-nova style)
- Framer Motion β animations
- date-fns, react-markdown, remark-gfm
Infrastructure
- Weaviate β vector database with HNSW + inverted index
- LocalAI β self-hosted inference for the embedding model
- llama.cpp server β self-hosted cross-encoder reranker
- Docker Compose β service orchestration
Models (GGUF, auto-downloaded on first run)
qwen3-embedding-0.6b-q4_k_m.ggufβ 1024-dim text embeddingsQwen3-Reranker-0.6B.Q4_K_M.ggufβ cross-encoder reranker
| Tool | Minimum Version | Install |
|---|---|---|
| Docker + Docker Compose | Latest | docs.docker.com |
| Go | 1.22+ | go.dev/dl |
| Node.js / npm | 20+ | nodejs.org |
Ollama is optional β install from ollama.com for fully local, offline generation.
# 1. Clone git clone https://github.com/RobinMillford/GopherNotebook.git cd GopherNotebook # 2. Launch (downloads ~1.5 GB of models on first run) chmod +x start.sh ./start.sh
The script handles everything:
- Checks and auto-installs missing dependencies (Go, Node, Docker) where possible
- Downloads Qwen3 embedding + reranker GGUF models if absent
- Starts Weaviate, LocalAI, and the reranker via Docker Compose and waits for health checks
- Starts the Go backend on
http://localhost:8090 - Starts the Next.js frontend on
http://localhost:3000 - Auto-starts Ollama if it is installed
Press Ctrl+C to gracefully shut down all services.
# Backend cd backend && go run ./cmd/server # Frontend (separate terminal) cd frontend && npm run dev # Docker infra only docker compose up -d
All backend settings are driven by environment variables. Defaults work out of the box for local development.
| Variable | Default | Description |
|---|---|---|
SERVER_PORT |
8090 |
Go backend HTTP port |
LOCALAI_URL |
http://localhost:8081 |
LocalAI endpoint for embeddings |
EMBEDDING_MODEL |
qwen3-embed |
Model name registered in LocalAI |
EMBEDDING_DIM |
1024 |
Output dimension of the embedding model |
RERANKER_URL |
http://localhost:8082 |
llama.cpp reranker endpoint |
RERANKER_MODEL |
Qwen3-Reranker-0.6B |
Reranker model identifier |
RERANKER_TOP_N |
5 |
Default number of chunks after reranking |
WEAVIATE_HOST |
localhost:8080 |
Weaviate host:port |
WEAVIATE_SCHEME |
http |
http or https |
NOTEBOOK_DATA_DIR |
./data/notebooks |
Notebook JSON storage directory |
UPLOAD_DIR |
./data/uploads |
Uploaded files directory |
SEMANTIC_DEDUP_THRESHOLD |
0.03 |
Cosine distance dedup threshold (set 0 to disable) |
API keys are browser-only β stored in
localStorage, sent per-request viaX-API-Keyheader. The backend never stores or logs them.
Click New Notebook on the dashboard. Give it a name, an optional description, and tags. Tags let you filter the dashboard grid and keep projects organized.
Open a notebook and drag files onto the upload area, or click to browse. Supported formats: PDF, DOCX, XLSX, PPTX, TXT, HTML (up to 50 MB per file). The backend chunks and embeds them locally β a progress bar streams updates in real time.
You can also ingest a URL (click the link icon in the sidebar) to fetch and process any public web page.
To re-process a file (e.g. after changing the chunk size or embedding model), hover the file in the sidebar and click the refresh icon.
Click Settings in the left sidebar:
- Provider β pick cloud (OpenAI, Anthropic, Gemini, Groq, OpenRouter) or local (Ollama, LM Studio)
- API Key β paste your key; available models are fetched live. Keys never leave your browser.
- Model β search and select from the live list
- System Prompt β override the assistant persona for this notebook
- HyDE β toggle Hypothetical Document Embedding for better recall on vague queries
- Retrieval Limit / Reranker Top N / Temperature β fine-tune chunk retrieval and response creativity
Ask your question and hit Send. Responses stream token-by-token. Citations link each claim back to the exact source file and page.
- Edit a message β hover any user turn and click the pencil icon to truncate history and re-ask
- Export β download the full conversation as Markdown via the icon at the top of the chat area
- Filter sources β check/uncheck files in the sidebar to restrict retrieval scope (shown when 2+ sources exist)
From the dashboard, use the search bar at the top to find relevant chunks across all notebooks at once. No API key required β pure local retrieval. Click any result to navigate to that notebook.
| Provider | Local? | Key Source | Notes |
|---|---|---|---|
| Ollama | Yes | None | Auto-started by start.sh. Run ollama pull <model> to add models. |
| LM Studio | Yes | None | Start the Local Server inside LM Studio first. |
| OpenAI | No | platform.openai.com | GPT-4o, o1, GPT-4 Turbo. Live model fetch. |
| Anthropic | No | console.anthropic.com | Claude 3.7, 3.5 Sonnet, Haiku, Opus. Live model fetch. |
| Google Gemini | No | aistudio.google.com | Gemini 2.5 Flash, 2.0 Flash, 1.5 Pro. Live model fetch. |
| Groq | No | console.groq.com | Llama 3.3, Mixtral, Gemma 2. Ultra-fast inference. Live model fetch. |
| OpenRouter | No | openrouter.ai/keys | 300+ models. Live model fetch + in-app search. |
| Format | Extension | Parser |
|---|---|---|
.pdf |
tabula | |
| Word | .docx |
tabula |
| Excel | .xlsx |
tabula |
| PowerPoint | .pptx |
tabula |
| Plain text | .txt |
native |
| HTML / Web pages | .html |
native (also via URL ingest) |
- Embeddings are local. Files are chunked and vectorized on your machine. LocalAI and Weaviate have no internet access by default.
- API keys are browser-only. Stored in
localStorage. Sent directly to the LLM provider per-request. The Go backend never receives, stores, or logs them. - SSRF prevention. The URL ingestion endpoint validates
http/httpsscheme before fetching. - Path traversal prevention. File names are sanitized with
filepath.Basebefore any disk access. - No telemetry. GopherNotebook sends no analytics or usage data anywhere.
Known gaps and improvement areas. Contributions are welcome on any of these.
- GPU acceleration β expose
--gpu-layersto LocalAI and the reranker container via env var (currently CPU-only) - Document summarization β auto-generate a 1-paragraph summary per file after ingestion
- Notebook export/import β archive a notebook (metadata + uploads) as a zip; import on another machine
- Conversation branching β fork chat history at any message to explore multiple response paths
- Dark / light theme toggle β UI is currently dark-only
- Optional auth β single-user password gate for LAN-exposed deployments
- Streaming rerank indicator β show a "Rerankingβ¦" status in the UI while the cross-encoder runs
- Weaviate multi-tenancy β isolate each notebook into a separate Weaviate tenant for stronger data boundaries
- Pluggable embedding models β swap Qwen3-Embed for any GGUF embedding model without rebuilding Docker images
- Auto conversation titles β generate a short title from the first user message
- Keyboard shortcuts β
/focus search,Ctrl+Entersend,Escclose dialogs
- Multi-modal ingestion β image OCR and audio transcription via Whisper
- Agent mode β let the LLM decide which notebooks to search and when to stop retrieving
- REST API SDK β typed Python/TypeScript client for programmatic notebook and chat access
- Collaborative notebooks β real-time multi-user chat on a shared notebook
- OIDC / SSO β enterprise-ready auth for team deployments
GopherNotebook/
βββ backend/
β βββ cmd/server/ # Entry point (main.go)
β βββ internal/
β βββ api/ # Gin handlers and router
β βββ config/ # Env-based configuration
β βββ db/ # Weaviate schema + query helpers
β βββ generate/ # langchaingo LLM streaming + HyDE
β βββ ingest/ # Parsing, chunking, embedding, worker pool
β βββ notebook/ # CRUD + message history (JSON on disk)
β βββ retrieve/ # Hybrid search + reranking
βββ frontend/
β βββ src/
β βββ app/
β β βββ dashboard/ # Notebook grid, tag filter, global search
β β βββ notebook/ # Chat UI, file upload, settings panel
β β βββ api/models/ # Route handler for live model enumeration
β βββ components/ui/ # shadcn/ui components
β βββ lib/api.ts # Typed API client
βββ models/ # GGUF model files (git-ignored, auto-downloaded)
βββ data/ # Weaviate volumes + notebook JSON (git-ignored)
βββ scripts/
β βββ download_models.sh # Model downloader
βββ docker-compose.yml
βββ start.sh # Full-stack launcher
Contributions are welcome! Please read CONTRIBUTING.md first.
# Backend tests cd backend && go test ./... # Backend lint cd backend && go vet ./... # Frontend type-check + build cd frontend && npm run build
Branch naming: feature/<name>, fix/<name>, docs/<name>
Commit style: Conventional Commits β feat:, fix:, docs:, chore:, etc.
Please open an issue before starting large PRs to align on approach.
Distributed under the MIT License. See LICENSE for details.