This guide provides multiple ways to set up DocuChat Agent on your system.
# Make setup script executable
chmod +x setup_docuchat.sh
# Run interactive setup
./setup_docuchat.sh
# Or run automated setup
./setup_docuchat.sh --auto# Run the Windows setup script
setup_docuchat.bat
# Or run automated setup
setup_docuchat.bat /autoThe setup script automatically installs and configures:
-
System Tools
- Docker (if not present)
- Tesseract OCR
- Git and curl utilities
-
Services
- Neo4j Community Edition (Docker container)
- Ollama LLM server with gemma2:2b model
-
Python Environment
- Virtual environment (
venv/) - All Python dependencies
- spaCy language model
- Playwright browsers
- DocuChat package installation
- Virtual environment (
-
Configuration
- Data directories structure
- ChromaDB initialization
- Hardware profile generation
- Service connectivity testing
./setup_docuchat.sh- Asks for confirmation before major installations
- Shows progress and detailed output
- Recommended for first-time setup
./setup_docuchat.sh --auto- No prompts, installs everything automatically
- Ideal for CI/CD or scripted deployments
- Uses safe defaults for all configurations
./setup_docuchat.sh --resume-from=3- Resume from phase 3 (System Tools Installation)
- Useful if setup was interrupted
- Phases: 1=System Check, 2=Neo4j, 3=Tools, 4=Python, 5=Config, 6=Verification
./setup_docuchat.sh --skip-docker --skip-ollama- Skip Docker/Neo4j setup (use existing installation)
- Skip Ollama installation (use existing or cloud LLMs)
- Useful for custom configurations
The setup process consists of 6 phases:
- Detects operating system and package manager
- Checks Python 3.10+ availability
- Verifies Docker installation
- Tests internet connectivity
- Ensures sufficient disk space and memory
- Pulls Neo4j 5.15 Community Edition image
- Creates persistent data volumes
- Configures authentication (neo4j/docuchat123)
- Sets up APOC plugin
- Optimizes memory settings for performance
- Installs Tesseract OCR for document image processing
- Downloads and installs Ollama LLM server
- Downloads gemma2:2b model (lightweight, fast)
- Configures system services
- Creates isolated virtual environment
- Installs all Python dependencies from requirements.txt
- Downloads spaCy English language model
- Installs Playwright browsers for web scraping
- Installs DocuChat package in development mode
- Creates data directory structure
- Initializes ChromaDB vector database
- Tests Neo4j connectivity
- Generates hardware optimization profile
- Creates default configuration files
- Tests DocuChat CLI functionality
- Verifies all service connections
- Creates sample test documents
- Runs basic ingestion test
- Generates setup completion report
- OS: Linux, macOS, or Windows with WSL2
- RAM: 4GB minimum, 8GB+ recommended
- Storage: 10GB free space
- Python: 3.10 or later
- Internet: Required for downloads
- CPU: 4+ cores for optimal performance
- RAM: 16GB for large document processing
- Storage: SSD for better I/O performance
- GPU: Not required (CPU-optimized)
1. Docker Permission Errors
# Add user to docker group (Linux)
sudo usermod -aG docker $USER
# Log out and back in2. Neo4j Container Won't Start
# Check container logs
docker logs docuchat-neo4j
# Restart container
docker restart docuchat-neo4j3. Python Module Not Found
# Ensure virtual environment is activated
source venv/bin/activate # Linux/macOS
# or
venv\Scripts\activate.bat # Windows
# Reinstall packages
pip install -r requirements.txt4. Ollama Service Not Responding
# Check Ollama status
curl http://localhost:11434/api/version
# Restart Ollama (Linux)
sudo systemctl restart ollama5. Port Conflicts
# Check what's using the ports
netstat -tulpn | grep -E "(7474|7687|11434)"
# Stop conflicting services or change portsThe setup script creates detailed logs:
- Setup log:
setup_docuchat.log - Docker logs:
docker logs docuchat-neo4j - Service status:
python -m docuchat status --check-all
To completely remove DocuChat Agent:
# Stop and remove containers
docker stop docuchat-neo4j
docker rm docuchat-neo4j
# Remove Docker images (optional)
docker rmi neo4j:5.15-community
# Remove Python environment
rm -rf venv/
# Remove data directories (⚠️ this deletes all your data)
rm -rf data/ chroma/
# Uninstall system packages (optional)
# This varies by system - remove manually if desiredDefault ports used by DocuChat Agent:
- 7474: Neo4j HTTP interface
- 7687: Neo4j Bolt protocol
- 11434: Ollama API server
If running on a server, ensure these ports are accessible:
# Ubuntu/Debian
sudo ufw allow 7474
sudo ufw allow 7687
sudo ufw allow 11434
# CentOS/RHEL
sudo firewall-cmd --permanent --add-port=7474/tcp
sudo firewall-cmd --permanent --add-port=7687/tcp
sudo firewall-cmd --permanent --add-port=11434/tcp
sudo firewall-cmd --reload- Neo4j: Username
neo4j, Passworddocuchat123 - Ollama: No authentication (local access only)
For production use, consider:
- Change default Neo4j password
- Enable HTTPS for Neo4j
- Configure firewall rules
- Use environment variables for secrets
- Regular security updates
Create data/neo4j/conf/neo4j.conf for custom settings:
# Increase memory for large datasets
dbms.memory.heap.initial_size=2G
dbms.memory.heap.max_size=4G
# Enable query logging
dbms.logs.query.enabled=trueAdd extra packages to requirements-local.txt:
# Your additional dependencies
jupyter>=1.0.0
matplotlib>=3.5.0
Then install: pip install -r requirements-local.txt
Create .env file for custom configuration:
# Neo4j Configuration
NEO4J_URI=bolt://localhost:7687
NEO4J_USER=neo4j
NEO4J_PASSWORD=docuchat123
# Ollama Configuration
OLLAMA_BASE_URL=http://localhost:11434
# Data Paths
DATA_DIR=./data
CHROMA_PATH=./chromaIf you encounter issues not covered here:
- Check the logs:
setup_docuchat.log - Run diagnostics:
python -m docuchat status --check-all - Search documentation: Check
docs/directory - Report issues: GitHub Issues (include logs and system info)
To update DocuChat Agent:
# Pull latest changes
git pull
# Update Python dependencies
source venv/bin/activate
pip install -r requirements.txt --upgrade
# Restart services if needed
docker restart docuchat-neo4jReady to get started? Run the setup script and start exploring your documents with AI! 🚀