GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com β€” GitHub - RobinMillford/GopherNotebook: Source-grounded RAG workspaces powered by blazingly fast Golang and local AI infrastructure.

BranchesTags
Open more actions menu

Latest commit

 

History

12 Commits
12 Commits

Folders and files

NameName
Last commit message
Last commit date
.claude
.claude
 
 
.github/workflows
.github/workflows
 
 
backend
backend
 
 
frontend
frontend
 
 
models
models
 
 
scripts
scripts
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.mcp.json
.mcp.json
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
docker-compose.yml
docker-compose.yml
 
 
start.sh
start.sh
 
 

Repository files navigation

πŸ€ GopherNotebook

Source-grounded RAG workspaces β€” 100% local embeddings, BYOK or fully offline generation.

Go Next.js Weaviate License: MIT PRs Welcome


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.


Table of Contents

  • Features
  • Architecture
  • Tech Stack
  • Quick Start
  • Configuration
  • Usage Guide
  • Supported LLM Providers
  • Supported File Types
  • Security & Privacy
  • Roadmap
  • Project Structure
  • Contributing
  • License

✨ Features

RAG Core

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

Notebook Management

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

Ingestion

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)

Chat & UX

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

LLM Flexibility

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

πŸ— Architecture

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 Map

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

πŸ›  Tech Stack

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 embeddings
  • Qwen3-Reranker-0.6B.Q4_K_M.gguf β€” cross-encoder reranker

πŸš€ Quick Start

Prerequisites

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.

Install & Run

# 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:

  1. Checks and auto-installs missing dependencies (Go, Node, Docker) where possible
  2. Downloads Qwen3 embedding + reranker GGUF models if absent
  3. Starts Weaviate, LocalAI, and the reranker via Docker Compose and waits for health checks
  4. Starts the Go backend on http://localhost:8090
  5. Starts the Next.js frontend on http://localhost:3000
  6. Auto-starts Ollama if it is installed

Press Ctrl+C to gracefully shut down all services.

Development (when Docker is already running)

# Backend
cd backend && go run ./cmd/server

# Frontend (separate terminal)
cd frontend && npm run dev

# Docker infra only
docker compose up -d

βš™οΈ Configuration

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 via X-API-Key header. The backend never stores or logs them.


πŸ“– Usage Guide

1 β€” Create a Notebook

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.

2 β€” Upload Documents

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.

3 β€” Configure Your LLM

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

4 β€” Chat

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)

5 β€” Multi-Notebook Search

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.


πŸ€– Supported LLM Providers

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.

πŸ“„ Supported File Types

Format Extension Parser
PDF .pdf tabula
Word .docx tabula
Excel .xlsx tabula
PowerPoint .pptx tabula
Plain text .txt native
HTML / Web pages .html native (also via URL ingest)

πŸ›‘ Security & Privacy

  • 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/https scheme before fetching.
  • Path traversal prevention. File names are sanitized with filepath.Base before any disk access.
  • No telemetry. GopherNotebook sends no analytics or usage data anywhere.

πŸ—Ί Roadmap

Known gaps and improvement areas. Contributions are welcome on any of these.

Short-term

  • GPU acceleration β€” expose --gpu-layers to 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

Medium-term

  • 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+Enter send, Esc close dialogs

Long-term

  • 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

πŸ— Project Structure

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

🀝 Contributing

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.


πŸ“„ License

Distributed under the MIT License. See LICENSE for details.


Made with Go and Next.js  Β·  Report a bug  Β·  Request a feature

About

Source-grounded RAG workspaces powered by blazingly fast Golang and local AI infrastructure.

Topics

gogolangnotebookrag

Resources

Readme
MIT license

Contributing

Contributing
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 β€” GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800Γ—600. No cookies required.