Skip to content

JiwaniZakir/aegis

Repository files navigation

Aegis

Self-hosted personal intelligence platform.

Aggregate 15+ data sources. Surface actionable insights with RAG. Publish autonomously.

CI Python FastAPI Docker License Stars Forks


Overview

Aegis connects to your financial accounts, email, calendars, social media, health devices, and more β€” then uses a RAG pipeline powered by Claude to deliver intelligent briefings, trend analysis, and autonomous content publishing. Everything runs on a single VPS behind Cloudflare Tunnel with zero public ports and AES-256-GCM encryption at rest.


✨ Features

Personal Intelligence

  • 🏦 Financial analysis β€” Spending trends, recurring charges, and portfolio tracking via Plaid + Schwab
  • βœ‰οΈ Email intelligence β€” Automated categorization, priority scoring, and relationship extraction
  • πŸŽ“ Academic tracking β€” Assignment deadlines and grade monitoring across Canvas, Blackboard, and Pearson
  • πŸ§‘β€πŸ€β€πŸ§‘ Contact graph β€” Relationship mapping across email, social, calendar, and messaging
  • ❀️ Health optimization β€” Activity trends and sleep analysis from Apple Health + Garmin

Content Engine

  • πŸ€– RAG pipeline β€” Qdrant vector store with sentence-transformer embeddings over all ingested data
  • πŸ“° Autonomous publishing β€” Daily thought-leadership posts to LinkedIn and X from your knowledge base
  • 🧠 Claude-powered analysis β€” Anthropic Claude API for content generation and insight synthesis

Security-First Architecture

  • πŸ”’ Zero attack surface β€” No public ports; all access through Cloudflare Tunnel
  • πŸ›‘οΈ AES-256-GCM encryption β€” All sensitive data encrypted at rest with authenticated encryption
  • πŸ”‘ SOPS + age β€” Secrets managed with Mozilla SOPS, encrypted with age keys
  • πŸ“ Audit logging β€” Every data access operation logged with tamper-evident trails

πŸ—οΈ Architecture

                         Cloudflare Tunnel (zero public ports)
                                      |
                    +-----------------+-----------------+
                    |                 |                 |
               Web Console      Mobile App       Automated
              (Next.js 15)    (React Native)     Publishing
                    |                 |           (LinkedIn/X)
                    +--------+--------+--------+
                             |
                    +--------v--------+
                    |     Traefik     |         Single VPS
                    |  (internal RP)  |      Docker Compose
                    +--------+--------+
                             |
          +------------------+------------------+
          |                  |                  |
   +------v------+   +------v------+   +-------v--------+
   |   FastAPI    |   |   Celery    |   | Content Engine |
   |   (REST +    |   |  (Workers   |   |  (RAG + Claude |
   |  WebSocket)  |   |   + Beat)   |   |   pipeline)    |
   +------+-------+   +------+------+   +-------+--------+
          |                  |                  |
          +------------------+------------------+
          |            |            |            |
   +------v--+  +-----v---+  +----v----+  +----v----+
   | Postgres |  |  Redis  |  | Qdrant  |  |  MinIO  |
   |+pgvector |  | (broker |  |(vectors)|  |(objects)|
   |          |  |+ cache) |  |         |  |         |
   +----------+  +---------+  +---------+  +---------+

πŸ”Œ Data Integrations

Category Sources Method
Banking Chase, TD, PNC, Discover, Amex Plaid API
Investments Fidelity / Schwab Schwab API (schwab-py)
Email Gmail Gmail API + IMAP fallback
Education Canvas LMS, Blackboard, Pearson REST APIs + Playwright
Social LinkedIn, X / Twitter Platform APIs + scraper fallback
Calendar Google Calendar, Outlook Google Calendar API, Microsoft Graph
Messaging WhatsApp whatsapp-web.js Node.js bridge
Health Apple Health, Garmin HealthKit export, Garmin Connect API
Productivity Mac Screen Time, iPhone Swift agent + iOS Shortcuts
News NewsAPI, RSS feeds newsapi-python, feedparser
Web General web Playwright + BeautifulSoup

πŸ› οΈ Tech Stack

Python FastAPI Celery PostgreSQL Redis Qdrant

Next.js React Native Tailwind Docker Traefik Anthropic


πŸš€ Quick Start

Prerequisites

  • Docker + Docker Compose 2.29+
  • Python 3.12+
  • Node.js 20+

1. Clone and configure

git clone https://github.com/JiwaniZakir/aegis.git
cd aegis
cp .env.example .env
# Edit .env with your API credentials (Plaid, Google, Anthropic, etc.)

2. Start all services

docker compose up -d

3. Run database migrations

docker compose exec api alembic upgrade head

4. Open the console

open http://localhost:3000

Development

# Backend only (with hot reload)
cd backend && uv sync --extra dev && uv run uvicorn app.main:app --reload

# Install all optional extras (integrations + ml + dev)
cd backend && uv sync --all-extras

# Console only
cd console && npm install && npm run dev

# Run tests (338 tests)
cd backend && uv sync --extra dev && uv run pytest

# Lint + format
make lint
make format

See the Makefile for all available commands.


πŸ—‚οΈ Project Structure

aegis/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ main.py                 # FastAPI application factory
β”‚   β”‚   β”œβ”€β”€ config.py               # Pydantic settings
β”‚   β”‚   β”œβ”€β”€ celery_app.py           # Task queue + Beat schedule
β”‚   β”‚   β”œβ”€β”€ database.py             # Async SQLAlchemy engine
β”‚   β”‚   β”œβ”€β”€ api/v1/                 # 12 REST routers
β”‚   β”‚   β”œβ”€β”€ integrations/           # 15 data source clients
β”‚   β”‚   β”œβ”€β”€ services/               # 10 business logic modules
β”‚   β”‚   β”œβ”€β”€ models/                 # 14 SQLAlchemy models
β”‚   β”‚   β”œβ”€β”€ security/               # Auth, encryption, audit
β”‚   β”‚   └── tasks/                  # 9 Celery task definitions
β”‚   β”œβ”€β”€ tests/                      # 338 tests
β”‚   β”œβ”€β”€ alembic/                    # Database migrations
β”‚   └── pyproject.toml
β”œβ”€β”€ console/                        # Next.js 15 web dashboard
β”‚   └── src/
β”‚       β”œβ”€β”€ app/                    # 10 dashboard pages
β”‚       β”œβ”€β”€ components/             # shadcn/ui components
β”‚       └── lib/                    # API client, Zustand stores
β”œβ”€β”€ mobile/                         # React Native voice app (Expo)
β”œβ”€β”€ whatsapp-bridge/                # Node.js WhatsApp sidecar
β”œβ”€β”€ infrastructure/
β”‚   β”œβ”€β”€ Dockerfile.*                # Multi-stage container builds
β”‚   β”œβ”€β”€ cloudflared/                # Tunnel configuration
β”‚   β”œβ”€β”€ traefik/                    # Reverse proxy config
β”‚   β”œβ”€β”€ postgres/                   # DB initialization
β”‚   └── scripts/                    # deploy.sh, backup.sh, rotate-secrets.sh
β”œβ”€β”€ secrets/                        # SOPS-encrypted credentials
β”œβ”€β”€ docker-compose.yml              # Development stack
β”œβ”€β”€ docker-compose.prod.yml         # Production overrides
β”œβ”€β”€ Makefile                        # Dev workflow commands
└── .env.example                    # Environment template

πŸ“† Scheduled Tasks

Task Frequency Description
Financial sync Every 6 hours Pull transactions and balances via Plaid
Email analysis Every 30 minutes Categorize and extract insights from new emails
Calendar sync Every 15 minutes Sync events from Google Calendar + Outlook
Social monitoring Every 2 hours Track LinkedIn and X activity
Health sync Hourly Process Apple Health + Garmin data
Content publishing Daily 7:00 AM Generate and publish thought-leadership content
WhatsApp sync Every 30 minutes Sync messages via WhatsApp bridge
Meeting transcription Every 2 hours Transcribe and analyze recordings
Garmin sync Every 4 hours Pull fitness and sleep metrics

🀝 Contributing

Contributions are welcome. Please read the contributing guidelines before opening a pull request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feat/my-feature)
  3. Commit your changes (git commit -m 'feat: add my feature')
  4. Push to the branch (git push origin feat/my-feature)
  5. Open a Pull Request

This project follows Conventional Commits (feat:, fix:, chore:, docs:, security:).


πŸ“„ License

This project is licensed under the MIT License. See the LICENSE file for details.


Built by Zakir Jiwani

About

Self-hosted personal intelligence platform. Aggregates 15+ data sources with RAG-powered insights and autonomous content generation.

Topics

Resources

Contributing

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages