Your Private Second Brain: An Personal Knowledge base that turns your documents, notes, and PDFs into an interlinked, fully searchable Wikipedia—entirely offline and private.
Imagine a Personal Second brain living in your computer. You drop your research papers, meeting notes, PDFs, and images into a folder, and it instantly categorizes, reads, and writes an interlinked Personal Wikipedia-style article for you. Best of all? It's 100% private, runs offline, and doesn't send a single byte of your data to the cloud.
(Drop your files in the sidebar and start chatting instantly!)
- 100% Offline & Private: Powered by your local LLM via Ollama. Your personal files stay on your machine.
- Auto-Ingestion Engine: Just drop
.pdf,.docx,.txt, or.png(built-in OCR) into theraw/folder. The Watchdog automatically compiles a comprehensive Wiki page. - MediaWiki Aesthetics: A beautifully styled web UI that looks and feels like Wikipedia, complete with markdown rendering and bidirectional link styling.
- Chat with your Wiki: Built-in Chatbot that uses local RAG to automatically retrieve pages from your wiki and provide contextual answers.
The project relies on a decoupled two-loop architecture: the Ingestion Engine (Invisible Librarian) and the Web Interface.
graph TD
User([User]) -->|Uploads PDF, DOCX, TXT| Raw[raw/ folder]
User -->|Views & Chats| UI[Streamlit App app.py]
subgraph Ingestion Engine ingest.py
Watchdog[Folder Watchdog] -->|Detects new file| Parser[Document Parser]
Parser --> |Extracts Text| Compiler[Wiki Compiler]
Compiler --> |Prompts LLM| Ollama[Local Ollama]
Ollama --> |Returns Markdown| Compiler
Compiler --> |Saves .md| Pages[wiki/pages/ folder]
Compiler --> |Moves original| Archive[archive/ folder]
end
Raw --> Watchdog
Pages -.->|Read by| UI
UI -->|Queries Wiki| Ollama
Before you start, ensure you have the following installed:
- Python 3.8+
- Ollama (The local LLM runner)
- Tesseract OCR (For image support):
- Mac:
brew install tesseract - Linux:
sudo apt install tesseract-ocr
- Mac:
1. Clone the repository:
git clone https://github.com/aswin-pn/Personal-wiki-using-Gemma-4.git
cd Personal-wiki-using-Gemma-42. Set up the Virtual Environment:
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt3. Pull the Default LLM:
ollama pull gemma4:e4b4. Configuration:
Copy .env.example to .env to configure your preferred LLM.
cp .env.example .envTo run the wiki, you must start both the Librarian and the Web UI in two separate terminals.
Terminal 1: Start the Background Librarian
This script watches for incoming files and converts them into Wiki format automatically.
source venv/bin/activate
python ingest.pyTerminal 2: Start the Web UI
This is your Wikipedia viewer and Chat UI.
source venv/bin/activate
streamlit run app.pyContributions, issues, and feature requests are welcome! Feel free to check the issues page.
This project is licensed under the MIT License.