Skip to main content

CLAUDE.md — eidos-mail

Email service for Eidos AGI. IMAP sync, vector search, HTMX web UI, REST API.

Architecture

Migadu IMAP/SMTP <-> FastAPI (eidos-mail) <-> Postgres + pgvector
                         |
                    HTMX web UI (humans)
                    REST API (agents)

Stack

  • Python 3.12, FastAPI, uvicorn, asyncpg, pgvector
  • sentence-transformers (all-MiniLM-L6-v2, 384 dims)
  • HTMX 2.0.4 for web UI
  • Railway: Dockerfile + railway.toml + Postgres addon

Project Structure

eidos-mail/
├── CLAUDE.md
├── Dockerfile
├── railway.toml
├── requirements.txt
├── app/
│   ├── main.py           <- FastAPI app + HTMX routes + API routes
│   ├── config.py          <- Settings from env
│   ├── database.py        <- asyncpg pool + migrations
│   ├── sync.py            <- IMAP sync
│   ├── embeddings.py      <- Vector embedding generation
│   └── templates/
│       └── layout.html    <- HTMX UI
└── migrations/
    └── 001_init.sql       <- emails + email_vectors tables

Environment Variables

Variable Description
DATABASE_URL Postgres connection string (Railway provides this)
IMAP_HOST IMAP server (imap.migadu.com)
IMAP_PORT IMAP port (993)
SMTP_HOST SMTP server (smtp.migadu.com)
SMTP_PORT SMTP port (465)
EMAIL_ADDRESS Email address (daniel@eidosagi.com)
EMAIL_PASSWORD Email password

Endpoints

Web UI (HTMX)

  • GET / — inbox
  • GET /search — semantic search
  • GET /compose — compose form

API (agents)

  • POST /api/sync — trigger IMAP sync
  • GET /api/search?q=... — vector search (JSON)
  • GET /api/emails?recent=N — recent emails (JSON)
  • GET /api/emails/{id} — single email (JSON)
  • POST /api/send — send email (JSON)
  • POST /api/emails/mark-read — mark emails read/unread (JSON: {ids, read})
  • POST /api/emails/{id}/delete — soft-delete an email
  • POST /api/emails/{id}/reply — reply with threading (JSON: {body})
  • POST /api/emails/{id}/forward — forward email (JSON: {to, body})
  • POST /api/emails/{id}/undelete — restore a soft-deleted email from trash
  • GET /health — health check

Development

# Install deps
pip install -r requirements.txt

# Run locally
DATABASE_URL=postgresql://... python -m uvicorn app.main:app --reload --port 8000

Rules

  • No raw secrets in code — use environment variables
  • Soft deletes only (deleted_at column)
  • All queries filter WHERE deleted_at IS NULL

Metadata

Release files for eidos-mail 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for eidos-mail 0.1.0
File Size Uploaded Provenance
eidos_mail-0.1.0.tar.gz 78.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for eidos-mail 0.1.0
File Interpreter ABI Platform
eidos_mail-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 84.0 kB

Release files / eidos_mail-0.1.0.tar.gz

Download URL eidos_mail-0.1.0.tar.gz
Size 78.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4de4d57ea2aeae2a44865c8c737fd377d9a66ec5958b44922ef3bc46e3c6abe4
BLAKE2b-256 checksum
How to use checksums
95ec82c38d19c2828a857b51cb663c00d25bdf966e55bbeea94fd453797f44fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.7

Release files / eidos_mail-0.1.0-py3-none-any.whl

Download URL eidos_mail-0.1.0-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
801c863ea76ba89d819b9a8656340b61fe8f67c21d38648b454582df61b79fce
BLAKE2b-256 checksum
How to use checksums
e981eeb195f9f1169d3a0a2f61cd448dc61e364f0ea27cf783b46ea2d8ac5f6a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.7

Security for eidos-mail 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page