# MailSubsystem Core Overview

MailSubsystem Core is a local-first email intelligence application written in Rust. It connects to an IMAP mailbox, stores runtime state in PostgreSQL, and runs a fault-tolerant agent pipeline for classification, summarization, threat detection, folder recommendation, and filing.

## Who It Is For

Developers and technical operators who want serious inbox automation they can audit. The Core runs on your hardware, with your database, your model provider choices, and logs you can inspect.

## Status

The Core is being prepared for open-source release under AGPL v3. The repository is in pre-release hardening, with Phase 5 gap closure and production hardening in progress. Treat current builds as developer-focused pre-release software until the release criteria are met.

| Area | Current direction |
| --- | --- |
| License | AGPL v3 intended for OSS publication |
| Repository | https://github.com/iamcobolt/MailSubsystem.git |
| Runtime | Rust application with PostgreSQL source of truth and IMAP integration |
| Hardening | Phase 5 focuses on production readiness, sandbox safety, observability, and reliable autonomous operation |

## Architecture

Expanded product direction:

```text
IMAP IDLE -> Ingest -> Analyze -> Embed -> Action Dispatch -> Location -> File
```

Day-one README workflow:

```text
Sync -> Analyze -> Locate -> File
```

## Responsibility Map

- Core owns intelligence: LLM workflows, RAG, classification, summarization, threat detection, action dispatch, folder recommendation, and filing logic.
- PostgreSQL owns state: email records, folders, durable queues, agent checkpoints, analysis output, embeddings, sender behavior, and audit-friendly run history.
- Agents are declarative: specs use Markdown conventions and shared runtime behavior.
- Models are pluggable: local LM Studio or Ollama first, with selected hosted provider escalation.

