Offline Development Assistant powered by Ollama and ChromaDB
Project description
GangDan (纲担)
LLM-powered knowledge management and teaching assistant with offline support.
GangDan (纲担) — Principled and Accountable.
Features
Knowledge Management
- Unified Literature Search — Search arXiv, bioRxiv, medRxiv, Semantic Scholar, CrossRef, OpenAlex, DBLP, PubMed, and GitHub in one interface. AI-powered query refinement with automatic translation and synonym expansion.
- Batch Operations — Multi-select, select-all, batch convert (PDF/HTML/TeX to Markdown with image and formula preservation), batch add to knowledge base. Sort by relevance, date, or title.
- Smart Renaming — Downloaded papers automatically renamed to citation format:
Author et al. (Year) - Title.pdf - LLM-Generated Wiki — Build structured wiki pages from knowledge base content with cross-KB concept linking.
- Image Gallery — Browse and search images stored in knowledge bases with context and source attribution.
- Document Manager — One-click download and indexing of 30+ library docs (Python, Rust, Go, JS, CUDA, Docker, etc.). Upload custom docs, batch operations, GitHub repo search, web search to KB.
Teaching Assistant
- Question Generator — MCQ, short answer, fill-in-the-blank, true/false from KB content.
- Guided Learning — Auto-extract knowledge points, generate interactive lessons with Q&A.
- Deep Research — Multi-phase research pipeline: topic decomposition → RAG research → comprehensive reports.
- Lecture Maker — Generate structured lecture content from KB materials.
- Exam Generator — Create complete exam papers with answer keys from KB content.
Core
- RAG Chat — Streaming chat with knowledge base retrieval and web search. Strict KB mode ensures grounded answers.
- AI Command Assistant — Natural language → shell commands, draggable to terminal.
- Built-in Terminal — Run commands with stdout/stderr display.
- Literature Review & Paper Writer — Generate academic reviews and papers from KB content.
- Conversation Save/Load — JSON export/import for session continuity.
- 10-Language UI — Chinese, English, Japanese, French, Russian, German, Italian, Spanish, Portuguese, Korean.
- Dark/Light Theme — Full theme support with CSS variables.
- Offline by Design — Runs entirely on your machine. No cloud APIs required.
CLI
- Streaming chat (
gangdan chat "question"), interactive REPL (gangdan cli) - KB operations, doc management, config, conversation persistence
- AI command generation, shell execution with safety checks
Requirements
- Python 3.10+
- Ollama running locally (default
http://localhost:11434) - Chat model (e.g.
ollama pull qwen2.5) - Embedding model (e.g.
ollama pull nomic-embed-text)
Installation
pip install gangdan
gangdan # Web GUI
gangdan cli # Interactive CLI
gangdan --port 8080 # Custom port
From source:
git clone https://github.com/cycleuser/GangDan.git
cd GangDan
pip install -e .
gangdan
Open http://127.0.0.1:5000 in your browser.
Ollama Setup
ollama serve
ollama pull qwen2.5
ollama pull nomic-embed-text
Project Structure
GangDan/
├── pyproject.toml
├── README.md / README_CN.md
├── gangdan/
│ ├── __init__.py / __main__.py
│ ├── cli.py / cli_app.py # CLI entry + REPL
│ ├── app.py # Flask backend
│ ├── learning_routes.py # Learning module blueprint
│ ├── preprint_routes.py # Preprint search + convert
│ ├── research_routes.py # Paper search
│ ├── kb_routes.py # Custom KB management
│ ├── export_routes.py # Export API
│ ├── core/ # Shared modules
│ │ ├── config.py # Config, i18n, translations
│ │ ├── ollama_client.py # Ollama API
│ │ ├── chroma_manager.py # ChromaDB
│ │ ├── vector_db.py # Multi-backend vector DB
│ │ ├── kb_manager.py # Custom KB CRUD
│ │ ├── conversation.py # Chat history
│ │ ├── doc_manager.py # Doc download/index
│ │ ├── wiki_builder.py # LLM wiki generation
│ │ ├── preprint_fetcher.py # Preprint search
│ │ ├── preprint_converter.py # HTML/TeX/PDF → MD
│ │ ├── pdf_converter.py # PDF → MD (marker/mineru/docling)
│ │ ├── export_manager.py # Batch convert/export
│ │ ├── web_searcher.py # Web search
│ │ └── ...
│ ├── templates/index.html # Main SPA template
│ └── static/{css,js}/ # Frontend assets
├── tests/ # Test suite
├── images/ # Screenshots
└── removed/ # Deprecated files
Architecture
┌──────────────┐ ┌──────────────┐
│ Flask GUI │ │ CLI / REPL │
│ (app.py) │ │ (cli_app.py) │
└──────┬───────┘ └──────┬───────┘
│ │
┌──────┴───────────────────┴──────┐
│ gangdan/core/ │
└─────────────────────────────────┘
│ │
┌──────┴───────┐ ┌──────┴───────┐
│ Ollama │ │ ChromaDB │
└──────────────┘ └──────────────┘
Configuration
All settings through the Settings tab: Ollama URL, chat/embedding/reranker models, proxy, context length, output language, vector DB type.
Testing
pip install pytest pytest-cov
pytest tests/ -v
pytest tests/ --cov=gangdan
License
GPL-3.0-or-later. See LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gangdan-1.0.25.tar.gz.
File metadata
- Download URL: gangdan-1.0.25.tar.gz
- Upload date:
- Size: 398.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18d42fed476da4d16e2c2d594be075cf110f0388fddd0a6a82fd6113f04df980
|
|
| MD5 |
5b6b1a54f2bba24b215573d27b9a5ed1
|
|
| BLAKE2b-256 |
dcdd60bdff6ddfe0a55fe8d832ac115beb7ac3b3b2572dd205cc7ce1e7aa0252
|
File details
Details for the file gangdan-1.0.25-py3-none-any.whl.
File metadata
- Download URL: gangdan-1.0.25-py3-none-any.whl
- Upload date:
- Size: 401.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
248d4e8dd24998b1a7c795b945445d6e3eaeff23e0430565ce8fc80c5ab1f016
|
|
| MD5 |
27a26cb6cfc064034481df9d3d147b9b
|
|
| BLAKE2b-256 |
b188a4936a66dd3f85d5576be07d4990d3320d6119c41f6078ed04aa576c9856
|