Your autonomous intelligence platform for tasks, finance, and research β self-hosted, privacy-first, production-ready.
Nexus is a comprehensive AI assistant that unifies task management, financial intelligence, and research workflows into a single, privacy-first system. Built for technical users who value data sovereignty, production-grade reliability, and extensibility.
Status: All 5 phases complete β | 162 tests passing + 1 skipped | 60% coverage
- π Privacy-First β Self-hosted, zero telemetry, end-to-end encrypted sensitive fields
- π§ Learning System β ML categorization improves from corrections, tracks accuracy
- β‘ Production-Grade β MFA, audit logs, Prometheus metrics, circuit breakers, automated backups
- π― Multi-Interface β CLI, Web PWA, REST API, SMS gateway, voice I/O
- π Intelligent β Budget forecasting, conflict detection, semantic search, multi-source synthesis
Get Nexus running in 5 minutes:
- Python 3.11+ β Download
- Docker & Docker Compose β Install Docker
- Git β For cloning the repository
# Clone and enter
git clone https://github.com/calvin/nexus.git
cd nexus
# Setup virtual environment
python3.11 -m venv venv
source venv/bin/activate
pip install -e ".[dev]"
# Configure environment
cp .env.example .env
# Edit .env with your credentials (see Configuration section)
# Start infrastructure (PostgreSQL + pgvector, Redis, MinIO)
docker-compose up -d
# Run migrations
alembic upgrade head
# Start API server (terminal 1)
uvicorn nexus.api.main:app --host 0.0.0.0 --port 8000
# Start Celery worker (terminal 2)
celery -A nexus.workers.app worker --loglevel=info
# Start Celery beat scheduler (terminal 3)
celery -A nexus.workers.app beat --loglevel=info
# Start Next.js web dashboard (terminal 4, optional)
cd web && npm install && npm run dev# Register and login
nexus auth register --email you@example.com --password <password>
nexus auth login
# Create a task with smart scheduling
nexus task add "Review budget" --due "tomorrow 3pm"
# Check for scheduling conflicts
nexus task suggest-slot --date tomorrow
# Log a transaction
nexus finance log 50 "Coffee" --category Dining
# Query balance and recent transactions
nexus finance balance
nexus finance recent --limit 5
# Run budget forecast
nexus finance forecast --months 3
# Create a research note
nexus note add "Investment Strategy" --content "Compare index funds vs ETFs" --tags finance,research
# Search notes semantically
nexus note search "investment options"
# Synthesize multiple research sources
nexus research synthesize --note-ids 1,2,3 --save
# Voice input (requires OpenAI API key)
nexus voice record
nexus voice speak "Your task is ready"
# SMS gateway (requires Twilio)
# Text "50 coffee" to your Twilio number β logs transaction| Feature | Status | Description |
|---|---|---|
| CLI Task CRUD | β | Create, list, update, complete, delete tasks via CLI |
| Web Dashboard | β | Next.js + shadcn/ui with real-time WebSocket updates |
| Recurring Tasks | β | RRULE format, Celery beat scheduler, hourly generation |
| Smart Scheduling | β | NL date parsing ("tomorrow 3pm"), conflict detection, free slot suggestions |
| Task Dependencies | β | Dependency graph utility (dependencies.py) |
API Endpoints:
GET /tasks, POST /tasks, GET /tasks/{id}, PATCH /tasks/{id}, DELETE /tasks/{id}, GET /tasks/suggest-time, GET /tasks/{id}/conflicts, GET /tasks/suggest-slot
CLI Commands:
nexus task add/list/complete/delete, nexus task parse-date, nexus task suggest-slot
| Feature | Status | Description |
|---|---|---|
| Transaction CRUD | β | Multi-account tracking with encrypted notes |
| CSV Import | β | Bank statement import with validation |
| Receipt OCR | β | Tesseract + ML categorization with 86% test coverage |
| ML Categorization | β | Rule-based + LLM fallback, learns from corrections |
| Accuracy Tracking | β | Logs predictions, computes precision/recall per category |
| Vendor Normalization | β | Fuzzy matching (>80% threshold) for consistent vendor names |
| Budget Forecasting | β | Per-category moving average with confidence intervals |
| Analytics | β | Spending by category/vendor, balance tracking |
API Endpoints:
GET /finance/transactions, POST /finance/transactions, POST /finance/import, GET /finance/analytics/spending, GET /finance/analytics/forecast, GET /finance/analytics/categorizer-accuracy, GET /vendors, POST /vendors/merge
CLI Commands:
nexus finance log/list/balance/recent, nexus finance import, nexus finance forecast, nexus finance vendors, nexus finance merge-vendor
| Feature | Status | Description |
|---|---|---|
| MFA (TOTP) | β | Encrypted secret storage, QR code generation, backup codes |
| Field Encryption | β | AES encryption for sensitive fields (notes, MFA secrets, SMS) |
| Audit Logging | β | Tracks all auth, finance, task, research operations with IP/user-agent |
| Session Management | β | JWT with refresh tokens, session invalidation, refresh_sessions Celery task |
| Prometheus Metrics | β | /metrics endpoint, request latency, LLM usage tracking |
| Backup Scripts | β | Automated DB + MinIO backup with retention policy |
| Systemd Templates | β | Service files for API, worker, beat scheduler |
| Circuit Breakers | β | Resilience patterns for external services (OpenAI, Twilio, Tesseract) |
| LLM Cost Tracking | β | LLMUsage model tracks provider, model, tokens, cost per request |
API Endpoints:
POST /auth/register, POST /auth/login, POST /auth/mfa/setup, POST /auth/mfa/verify, POST /auth/refresh, GET /audit/logs, GET /metrics
CLI Commands:
nexus auth register/login/mfa-setup/mfa-verify, nexus audit logs
| Feature | Status | Description |
|---|---|---|
| Note CRUD | β | Markdown notes with tags, credibility scoring |
| Wiki-Links | β | [[Note Title]] syntax with bidirectional link tracking |
| Semantic Search | β | pgvector embeddings (OpenAI text-embedding-3-small) + FTS5 hybrid |
| arXiv Integration | β | Search and import academic papers by query/ID |
| Research Plans | β | LLM-generated research plans with deliverables and milestones |
| Export Formats | β | Markdown, JSON, PDF (via pandoc) |
| Git Versioning | β | Auto-commit on note create/update, history, restore |
| Multi-Source Synthesis | β | Credibility-weighted LLM synthesis from 2+ notes β findings, contradictions, insights |
API Endpoints:
GET /notes, POST /notes, GET /notes/{id}, PATCH /notes/{id}, DELETE /notes/{id}, GET /notes/search, GET /notes/{id}/history, POST /notes/{id}/restore, POST /research/arxiv, POST /research/plan, POST /research/synthesize
CLI Commands:
nexus note add/list/search/export, nexus note history, nexus note restore, nexus research arxiv, nexus research plan
| Feature | Status | Description |
|---|---|---|
| Voice Input | β | OpenAI Whisper transcription + regex/LLM intent parsing |
| Voice Output | β | OpenAI TTS-1 (6 voices: alloy/echo/fable/onyx/nova/shimmer) |
| SMS Gateway | β | Twilio webhook with HMAC signature validation, rate limiting (10/h) |
| Mobile PWA | β | Manifest, icons, viewport meta, fixed bottom nav, safe-area utilities |
| Notifications | β | Email/SMS delivery for tasks, finance alerts |
| Portfolio Tracking | π‘ | Asset CRUD, market data API (implementation 73% coverage) |
SMS Commands:
50 coffeeβ Log transactionbalanceβ Account balancerecentβ Last 5 transactionsremind me to Xβ Create task
API Endpoints:
POST /voice/transcribe, POST /voice/speak, POST /sms/webhook, GET /notifications, POST /notifications, GET /portfolio/assets
CLI Commands:
nexus voice record/parse/speak, nexus notify send
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Interfaces β
β CLI (Click+Rich) β Web (Next.js) β SMS β Voice β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββββΌββββββββββββββββββ
β β β
βββββββΌββββββ ββββββββΌβββββββ βββββββΌββββββ
β FastAPI ββββββ€ WebSocket β β Twilio β
β Routers β β Manager β β Webhook β
βββββββ¬ββββββ βββββββββββββββ βββββββββββββ
β
βββββββΌββββββββββββββββββββββββββββββββββββββ
β Service Layer β
β (Business Logic, ML, Orchestration) β
βββββββ¬ββββββββββββββββββββββββββββββββββββββ
β
βββββββββΌββββββββββββββββββββ¬ββββββββββββββ
β β β β
βββββΌββββ βββΌβββββββ βββββββββββΌββββββ ββββββΌβββββ
β DB β β Redis β β Celery Workersβ β MinIO β
β PG β β Cache β β (Tasks) β β (S3 API)β
β+vectorβ β Queue β β Beat β β β
βββββββββ ββββββββββ βββββββββββββββββ βββββββββββ
Tech Stack:
| Layer | Technology |
|---|---|
| Backend | FastAPI 0.104+, Python 3.11+ |
| Database | PostgreSQL 16 + pgvector 0.7 |
| Queue | Celery 5.3 + Redis 7.2 |
| Storage | MinIO (S3-compatible) |
| Frontend | Next.js 14 + shadcn/ui |
| CLI | Click 8.1 + Rich 13.7 |
| ML/AI | OpenAI API (Whisper, TTS, embeddings, GPT-4), scikit-learn 1.5 |
| OCR | Tesseract 5+ |
| Monitoring | Prometheus /metrics endpoint |
nexus/
βββ src/nexus/ # Main application
β βββ api/ # FastAPI application
β β βββ main.py # App factory, CORS, middleware
β β βββ routers/ # Route handlers
β β β βββ auth.py # Auth endpoints (register, login, MFA)
β β β βββ tasks.py # Task CRUD + smart scheduling
β β β βββ finance.py # Transactions, OCR, forecasting, vendors
β β β βββ research.py # Notes, search, arXiv, synthesis
β β β βββ voice.py # Whisper transcription, TTS
β β β βββ sms.py # Twilio webhook handler
β β β βββ notifications.py
β β β βββ portfolio.py
β β β βββ audit.py # Audit log queries
β β β βββ ws.py # WebSocket connections
β β βββ ws_manager.py # WebSocket broadcast manager
β βββ models/ # SQLAlchemy ORM models
β β βββ user.py # User, encrypted MFA/SMS fields
β β βββ task.py # Task with recurrence
β β βββ finance.py # Transaction, VendorAlias, encrypted notes
β β βββ research.py # Note, Wikilink
β β βββ notification.py
β β βββ portfolio.py
β β βββ session.py # Session tokens
β β βββ llm_usage.py # LLM cost tracking
β β βββ automation.py
β βββ services/ # Business logic layer
β β βββ audit.py # Audit log creation
β β βββ embeddings.py # OpenAI embeddings + pgvector
β β βββ forecasting.py # ML budget forecasting (scikit-learn)
β β βββ market.py # Market data API (Alpha Vantage)
β β βββ notifications.py # Email/SMS delivery
β β βββ portfolio.py # Asset tracking
β β βββ research.py # Research plans, synthesis
β β βββ scheduling.py # NL date parsing, conflict detection
β β βββ sessions.py # JWT token management
β β βββ sms.py # Twilio signature validation, command parsing
β β βββ voice.py # Whisper, TTS, intent parsing
β βββ workers/ # Celery background tasks
β β βββ app.py # Celery app config
β β βββ tasks.py # Scheduled tasks (recurring, refresh, backups)
β βββ cli/ # Click CLI commands
β β βββ main.py # All CLI commands
β βββ utils/ # Utilities
β β βββ categorizer.py # ML transaction categorization
β β βββ credibility.py # Source credibility scoring
β β βββ dependencies.py # Task dependency graph
β β βββ metrics.py # Prometheus metrics
β β βββ ocr.py # Tesseract receipt OCR
β β βββ ratelimit.py # Rate limiting
β β βββ recurrence.py # RRULE task recurrence
β β βββ resilience.py # Circuit breakers
β β βββ security.py # Password hashing, MFA
β β βββ storage.py # MinIO file storage
β β βββ vendors.py # Vendor normalization (fuzzy matching)
β β βββ versioning.py # Git-backed note versioning
β β βββ wikilinks.py # [[WikiLink]] parsing
β β βββ arxiv_api.py # arXiv search
β βββ config.py # Settings (Pydantic BaseSettings)
β βββ database.py # SQLAlchemy async engine
βββ web/ # Next.js frontend
β βββ src/
β β βββ app/ # App router pages
β β βββ components/ # React components (mobile-nav, etc.)
β β βββ lib/ # API client, utilities
β βββ public/
β βββ manifest.json # PWA manifest
βββ tests/ # Test suite (163 tests)
β βββ conftest.py # Pytest fixtures
β βββ test_tasks.py
β βββ test_finance.py
β βββ test_forecasting.py
β βββ test_categorizer_accuracy.py
β βββ test_vendor_normalization.py
β βββ test_research.py
β βββ test_versioning.py
β βββ test_synthesis.py
β βββ test_voice.py
β βββ test_sms.py
β βββ test_scheduling.py
β βββ ...
βββ alembic/ # Database migrations
β βββ versions/ # 8+ migration files
βββ scripts/ # Operational scripts
β βββ backup.sh # Automated backups
β βββ restore.sh
βββ config/ # Systemd service templates
β βββ nexus-api.service
β βββ nexus-worker.service
β βββ nexus-beat.service
βββ docker-compose.yml # Infrastructure stack
βββ pyproject.toml # Python dependencies
βββ .env.example # Environment template
βββ README.md # This file
βββ SPECIFICATION.md # Technical architecture
βββ ROADMAP.md # 20-week development plan (100% complete)
βββ CHANGELOG.md # Release history
βββ CONTRIBUTING.md # Contributor guide
βββ LICENSE # MIT License
Copy .env.example to .env and configure:
# Database
DATABASE_URL=postgresql+asyncpg://nexus:password@localhost:5432/nexus_db
# Redis
REDIS_URL=redis://localhost:6379/0
# Security
NEXUS_SECRET_KEY=<generate with: openssl rand -hex 32>
NEXUS_ENCRYPTION_KEY=<generate with: openssl rand -hex 32>
# Environment
NEXUS_ENV=development # or production# OpenAI (required for voice, embeddings, LLM features)
OPENAI_API_KEY=sk-...
# Twilio (required for SMS gateway)
TWILIO_ACCOUNT_SID=AC...
TWILIO_AUTH_TOKEN=...
TWILIO_PHONE_NUMBER=+1...
# MinIO (S3-compatible storage)
MINIO_ENDPOINT=localhost:9000
MINIO_ACCESS_KEY=minioadmin
MINIO_SECRET_KEY=minioadmin
MINIO_BUCKET=nexus
# Market Data (optional for portfolio)
ALPHA_VANTAGE_API_KEY=...
# Email (optional for notifications)
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=you@gmail.com
SMTP_PASSWORD=...# Full suite (163 tests)
pytest
# With coverage
pytest --cov=nexus --cov-report=html
# Specific file
pytest tests/test_scheduling.py -v
# Watch mode
pytest-watch# Type checking
mypy src/
# Linting
ruff check src/
# Formatting
black src/ tests/# Create migration
alembic revision --autogenerate -m "Add vendor_aliases table"
# Apply
alembic upgrade head
# Rollback
alembic downgrade -1
# Check current
alembic current# Terminal 1: API server with hot reload
uvicorn nexus.api.main:app --reload --host 0.0.0.0 --port 8000
# Terminal 2: Celery worker
celery -A nexus.workers.app worker --loglevel=info
# Terminal 3: Celery beat scheduler
celery -A nexus.workers.app beat --loglevel=info
# Terminal 4: Next.js dev server (optional)
cd web && npm run dev
# Terminal 5: Run tests on file change
pytest-watch| Feature | Implementation |
|---|---|
| Authentication | JWT access (15min) + refresh tokens (7d) |
| MFA | TOTP (30s window), encrypted secrets, backup codes |
| Encryption | AES-256 for sensitive fields (notes, MFA, SMS phone) |
| Password Hashing | bcrypt with salt |
| Rate Limiting | Per-user, per-endpoint (10 req/h for SMS) |
| Audit Logging | All mutations logged with IP, user-agent, timestamp |
| Session Management | Token invalidation, auto-refresh Celery task |
| Circuit Breakers | External service resilience (OpenAI, Twilio, OCR) |
| CORS | Configurable origins in production |
Best Practices:
- Rotate
NEXUS_SECRET_KEYandNEXUS_ENCRYPTION_KEYquarterly - Enable MFA for all users
- Review audit logs weekly (
nexus audit logs) - Use HTTPS in production (configure reverse proxy)
- Backup database daily (see
scripts/backup.sh)
See SECURITY.md for vulnerability disclosure.
Available at GET /metrics:
http_requests_totalβ Request count by method/endpoint/statushttp_request_duration_secondsβ Latency histogramllm_usage_tokens_totalβ Token usage by provider/modelllm_usage_cost_totalβ Cumulative cost
curl http://localhost:8000/health
# {"status": "healthy", "env": "development"}# Backup (PostgreSQL + MinIO)
./scripts/backup.sh
# Restore
./scripts/restore.sh /path/to/backup.tar.gz# Install service files
sudo cp config/*.service /etc/systemd/system/
sudo systemctl daemon-reload
# Start services
sudo systemctl enable nexus-api nexus-worker nexus-beat
sudo systemctl start nexus-api nexus-worker nexus-beat
# Check status
sudo systemctl status nexus-api| Document | Description |
|---|---|
| SPECIFICATION.md | Complete technical architecture (140 pages) |
| ROADMAP.md | 20-week development plan (100% complete) |
| CHANGELOG.md | Release history and migration notes |
| CONTRIBUTING.md | Contributor guidelines |
| GETTING_STARTED.md | 30-minute tutorial |
| docs/OPERATIONS.md | Production deployment guide |
| docs/FAQ.md | 40+ common questions |
| SECURITY.md | Security policy and best practices |
Nexus is a personal project, but contributions are welcome!
How to Contribute:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Write tests for new functionality
- Ensure all tests pass (
pytest) - Run code quality checks (
black src/ && mypy src/ && ruff check src/) - Commit with conventional commits (
feat:,fix:,docs:, etc.) - Push and open a Pull Request
See CONTRIBUTING.md for detailed guidelines.
| Phase | Weeks | Status | Key Deliverables |
|---|---|---|---|
| Phase 1 | 1-4 | β 100% | Infrastructure, Task Management, Smart Scheduling |
| Phase 2 | 5-8 | β 100% | Financial Intelligence, OCR, ML, Forecasting |
| Phase 3 | 9-12 | β 100% | Security, MFA, Monitoring, Backups |
| Phase 4 | 13-16 | β 100% | Research, Semantic Search, Git Versioning, Synthesis |
| Phase 5 | 17-20 | β 100% | Voice I/O, SMS Gateway, Mobile PWA |
| Total | 20 | β 100% | Full-featured Personal AI System |
See ROADMAP.md for task-level breakdown.
| Metric | Value |
|---|---|
| Tests | 163 passing |
| Coverage | 61% (3,282 statements) |
| Lines of Code | ~8,500 (src/) |
| API Endpoints | 40+ |
| CLI Commands | 30+ |
| Database Tables | 12 |
| Celery Tasks | 6 (recurring, refresh, backups) |
| Dependencies | 35 (production), 12 (dev) |
For questions, bug reports, or feature requests:
- π Getting Started Guide β 30-minute tutorial
- π FAQ β 40+ common questions answered
- π¬ GitHub Discussions β General questions
- π Bug Reports β Use the bug template
- β¨ Feature Requests β Use the feature template
- π§ Private Contact β calvinbrady8@gmail.com
Note: This is a personal project maintained during free time. Response times may vary, but all issues and PRs are reviewed.
MIT License β see LICENSE for details.
Built with β€οΈ for personal productivity, privacy, and autonomy.