- Create global wrapper script in /usr/local/bin/rag-mini - Automatically handles virtual environment activation - Suppress virtual environment warnings when using global wrapper - Update installation scripts to install global wrapper automatically - Add comprehensive timing documentation (2-3 min fast, 5-10 min slow internet) - Add agent warnings for background process execution - Update all documentation with realistic timing expectations - Fix README commands to use correct syntax (rag-mini init -p .) Major improvements: - Users can now run 'rag-mini' from anywhere without activation - Installation creates transparent global command automatically - No more virtual environment complexity for end users - Comprehensive agent/CI/CD guidance with timeout warnings - Complete documentation consistency across all files 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
11 KiB
🛠️ Troubleshooting Guide - Common Issues & Solutions
Having problems? You're not alone! Here are solutions to the most common issues beginners encounter.
🚀 Installation & Setup Issues
❌ "Command not found: ollama"
Problem: The system can't find Ollama
Solution:
# Install Ollama
curl -fsSL https://ollama.ai/install.sh | sh
# Or on Mac: brew install ollama
# Start Ollama
ollama serve
Alternative: Use the system without Ollama - it will automatically fall back to other embedding methods.
❌ "Permission denied" when running scripts
Problem: Script files aren't executable
Solution:
chmod +x rag-mini.py rag-tui.py install_mini_rag.sh
# Or run with python directly:
python3 rag-mini.py --help
❌ "Module not found" or import errors
Problem: Python dependencies not installed
Solution:
# Install dependencies
pip3 install -r requirements.txt
# If that fails, try:
pip3 install --user -r requirements.txt
❌ Installation script fails
Problem: ./install_mini_rag.sh doesn't work
Solution:
# Make it executable first
chmod +x install_mini_rag.sh
# Then run
./install_mini_rag.sh
# Or use proven manual method (100% reliable):
python3 -m venv .venv
.venv/bin/python -m pip install -r requirements.txt # 2-8 minutes
.venv/bin/python -m pip install . # ~1 minute
source .venv/bin/activate
python3 -c "import mini_rag; print('✅ Installation successful')"
❌ Installation takes too long / times out
Problem: Installation seems stuck or takes forever
Expected Timing: 2-3 minutes fast internet, 5-10 minutes slow internet
Solutions:
-
Large dependencies are normal:
- LanceDB: 36MB (vector database)
- PyArrow: 43MB (data processing)
- PyLance: 44MB (language parsing)
- Total ~123MB + dependencies
-
For agents/CI/CD - run in background:
./install_mini_rag.sh --headless & # Monitor with: tail -f install.log -
Check if installation is actually progressing:
# Check pip cache (should be growing) du -sh ~/.cache/pip # Check if Python packages are installing ls -la .venv/lib/python*/site-packages/ -
Slow connection fallback:
# Increase pip timeout .venv/bin/python -m pip install -r requirements.txt --timeout 1000
🔍 Search & Results Issues
❌ "No results found" for everything
Problem: Search isn't finding anything
Diagnosis & Solutions:
-
Check if project is indexed:
./rag-mini status /path/to/project # If not indexed: ./rag-mini index /path/to/project -
Lower similarity threshold:
- Edit config file, change
similarity_threshold: 0.05 - Or try:
./rag-mini search /path/to/project "query" --threshold 0.05
- Edit config file, change
-
Try broader search terms:
- Instead of: "getUserById"
- Try: "user function" or "get user"
-
Enable query expansion:
- Edit config:
expand_queries: true - Or use TUI which enables it automatically
- Edit config:
❌ Search results are irrelevant/weird
Problem: Getting results that don't match your search
Solutions:
-
Increase similarity threshold:
search: similarity_threshold: 0.3 # Higher = more picky -
Use more specific terms:
- Instead of: "function"
- Try: "login function" or "authentication method"
-
Check BM25 setting:
search: enable_bm25: true # Helps find exact word matches
❌ Search is too slow
Problem: Takes too long to get results
Solutions:
-
Disable query expansion:
search: expand_queries: false -
Reduce result limit:
search: default_top_k: 5 # Instead of 10 -
Use faster embedding method:
embedding: preferred_method: hash # Fastest but lower quality -
Smaller batch size:
embedding: batch_size: 16 # Instead of 32
🤖 AI/LLM Issues
❌ "LLM synthesis unavailable"
Problem: AI explanations aren't working
Solutions:
-
Check Ollama is running:
# In one terminal: ollama serve # In another: ollama list # Should show installed models -
Install a model:
ollama pull qwen2.5:3b # Good balance of speed and quality # Or: ollama pull qwen3:4b # Larger but better quality -
Test connection:
curl http://localhost:11434/api/tags # Should return JSON with model list
❌ AI gives weird/wrong answers
Problem: LLM responses don't make sense
Solutions:
-
Lower temperature:
llm: synthesis_temperature: 0.1 # More factual, less creative -
Try different model:
ollama pull qwen3:1.7b # Recommended: excellent quality (default priority) ollama pull qwen3:0.6b # Surprisingly good for CPU-only ollama pull qwen3:4b # Highest quality, slower -
Use synthesis mode instead of exploration:
./rag-mini search /path "query" --synthesize # Instead of: ./rag-mini explore /path
💾 Memory & Performance Issues
❌ "Out of memory" or computer freezes during indexing
Problem: System runs out of RAM
Solutions:
-
Reduce batch size:
embedding: batch_size: 8 # Much smaller batches -
Lower streaming threshold:
streaming: threshold_bytes: 512000 # 512KB instead of 1MB -
Index smaller projects first:
# Exclude large directories ./rag-mini index /path/to/project --exclude "node_modules/**,dist/**" -
Use hash embeddings:
embedding: preferred_method: hash # Much less memory
❌ Indexing is extremely slow
Problem: Taking forever to index project
Solutions:
-
Exclude unnecessary files:
files: exclude_patterns: - "node_modules/**" - ".git/**" - "*.log" - "build/**" - "*.min.js" # Minified files -
Increase minimum file size:
files: min_file_size: 200 # Skip tiny files -
Use simpler chunking:
chunking: strategy: fixed # Faster than semantic -
More workers (if you have good CPU):
./rag-mini index /path/to/project --workers 8
⚙️ Configuration Issues
❌ "Invalid configuration" errors
Problem: Config file has errors
Solutions:
-
Check YAML syntax:
python3 -c "import yaml; yaml.safe_load(open('config.yaml'))" -
Copy from working example:
cp examples/config.yaml .mini-rag/config.yaml -
Reset to defaults:
rm .mini-rag/config.yaml # System will recreate with defaults
❌ Changes to config aren't taking effect
Problem: Modified settings don't work
Solutions:
-
Restart TUI/CLI:
- Configuration is loaded at startup
- Exit and restart the interface
-
Check config location:
# Project-specific config: /path/to/project/.mini-rag/config.yaml # Global config: ~/.mini-rag/config.yaml -
Force re-index after config changes:
./rag-mini index /path/to/project --force
🖥️ Interface Issues
❌ TUI looks broken/garbled
Problem: Text interface isn't displaying correctly
Solutions:
-
Try different terminal:
# Instead of basic terminal, try: # - iTerm2 (Mac) # - Windows Terminal (Windows) # - GNOME Terminal (Linux) -
Use CLI directly:
./rag-mini --help # Skip TUI entirely -
Check terminal size:
# Make terminal window larger (TUI needs space) # At least 80x24 characters
❌ "Keyboard interrupt" or TUI crashes
Problem: Interface stops responding
Solutions:
-
Use Ctrl+C to exit cleanly:
- Don't force-quit if possible
-
Check for conflicting processes:
ps aux | grep rag-tui # Kill any stuck processes -
Use CLI as fallback:
./rag-mini search /path/to/project "your query"
📁 File & Path Issues
❌ "Project not found" or "Permission denied"
Problem: Can't access project directory
Solutions:
-
Check path exists:
ls -la /path/to/project -
Check permissions:
# Make sure you can read the directory chmod -R +r /path/to/project -
Use absolute paths:
# Instead of: ./rag-mini index ../my-project # Use: ./rag-mini index /full/path/to/my-project
❌ "No files found to index"
Problem: System doesn't see any files
Solutions:
-
Check include patterns:
files: include_patterns: - "**/*.py" # Only Python files - "**/*.js" # Add JavaScript - "**/*.md" # Add Markdown -
Check exclude patterns:
files: exclude_patterns: [] # Remove all exclusions temporarily -
Lower minimum file size:
files: min_file_size: 10 # Instead of 50
🔍 Quick Diagnostic Commands
Check system status:
./rag-mini status /path/to/project
Test embeddings:
python3 -c "from mini_rag.ollama_embeddings import OllamaEmbedder; e=OllamaEmbedder(); print(e.get_embedding_info())"
Verify installation:
python3 -c "import mini_rag; print('✅ RAG system installed')"
Test Ollama connection:
curl -s http://localhost:11434/api/tags | python3 -m json.tool
Check disk space:
df -h .mini-rag/ # Make sure you have space for index
🆘 When All Else Fails
-
Start fresh:
rm -rf .mini-rag/ ./rag-mini index /path/to/project -
Use minimal config:
# Simplest possible config: chunking: strategy: fixed embedding: preferred_method: auto search: expand_queries: false -
Try a tiny test project:
mkdir test-project echo "def hello(): print('world')" > test-project/test.py ./rag-mini index test-project ./rag-mini search test-project "hello function" -
Get help:
- Check the main README.md
- Look at examples/ directory
- Try the basic_usage.py example
💡 Prevention Tips
For beginners:
- Start with default settings
- Use the TUI interface first
- Test with small projects initially
- Keep Ollama running in background
For better results:
- Be specific in search queries
- Use the glossary to understand terms
- Experiment with config settings on test projects first
- Use synthesis mode for quick answers, exploration for learning
Remember: This is a learning tool! Don't be afraid to experiment and try different settings. The worst thing that can happen is you delete the .mini-rag directory and start over. 🚀