<IN DEVELOPMENT - NOT CURRENTLY WORKING>
WikiTalk is an offline, conversational AI assistant that allows users to talk about history, science, and culture using a local copy of Wikipedia. It understands natural questions, supports follow-up questions and contextual discussion, and speaks answers aloud via Piper TTS.
- Offline knowledge: Runs entirely from a local Wikipedia dataset (FineWiki Parquet files)
- Natural conversation: Multi-turn dialogue with context retention and topic continuity
- Voice interaction: Speaks answers using Piper TTS
- Grounded knowledge: Uses retrieved, cited chunks from Wikipedia to reduce hallucinations
- Mac-native: Optimized for Apple Silicon performance
# Install dependencies
python setup.py
# Or manually install requirements
pip install -r requirements.txt# This will create SQLite and FAISS indexes from the parquet files
python data_processor.pyNote: This step can take several hours depending on your system. The process will:
- Parse all parquet files in
finewiki/data/enwiki/ - Create text chunks with overlap
- Build SQLite FTS5 index for BM25 search
- Generate embeddings and create FAISS index for dense retrieval
You need a local LLM server running. Options:
Option A: LM Studio
- Download LM Studio from https://lmstudio.ai/
- Load a model like
Qwen2.5-14B-InstructorLlama-3.1-8B-Instruct - Start the local server (usually on port 1234)
Option B: llama.cpp
# Download and build llama.cpp
git clone https://github.com/ggerganov/llama.cpp
cd llama.cpp
make
# Download a model (example with Qwen2.5-14B)
# Start server
./server -m models/qwen2.5-14b-instruct.gguf --port 1234For voice output, download Piper TTS voices:
# Create voices directory
mkdir -p voices
# Download a voice (example)
wget https://huggingface.co/rhasspy/piper-voices/resolve/v1.0.0/en/en_US/amy/medium/en_US-amy-medium.onnx -O voices/en_US-amy-medium.onnx
wget https://huggingface.co/rhasspy/piper-voices/resolve/v1.0.0/en/en_US/amy/medium/en_US-amy-medium.onnx.json -O voices/en_US-amy-medium.onnx.jsonpython wikitalk.pyOnce running, you can:
- Ask questions: "Tell me about the Meiji Restoration"
- Follow up: "And how did it affect Korea?"
- Get voice responses (if TTS is configured)
- Type
clearto start a new conversation - Type
quitto exit
User Input → Query Rewriter → Hybrid Retrieval → LLM → Response → TTS → Audio
↓
Conversation Memory ← SQLite + FAISS Indexes
- Data Processor: Parses parquet files and creates search indexes
- Hybrid Retriever: Combines BM25 (SQLite FTS5) and dense (FAISS) search
- LLM Client: Interfaces with local LLM for response generation
- TTS Client: Converts text to speech using Piper or macOS
say - Conversation Manager: Handles multi-turn dialogue context
Edit config.py to customize:
- Data paths and model settings
- Retrieval parameters (top-k, chunk size)
- LLM server URL and model
- TTS voice settings
- Python 3.8+
- 8GB+ RAM (for embeddings and FAISS index)
- 30GB+ disk space (for full English Wikipedia)
- Local LLM server (LM Studio or llama.cpp)
- Optional: Piper TTS for voice output
- Ensure parquet files are in
finewiki/data/enwiki/ - Check available disk space (30GB+ needed)
- Monitor memory usage during processing
- Verify LLM server is running on correct port
- Check
LLM_URLin config.py - Test with:
curl http://localhost:1234/v1/models
- Check Piper installation:
which piper - Verify voice files in
voices/directory - Falls back to macOS
saycommand if Piper unavailable
- Retrieval: <1 second for most queries
- Total response time: <10 seconds
- Memory usage: ~8GB for full English Wikipedia
- Storage: ~30GB for complete dataset
This project uses Wikipedia data under CC BY-SA 4.0 license.