Architecture
Mansa is composed of three integrated software components delivered as a single working system. Each component has a distinct responsibility and communicates with the others via well-defined interfaces.
System Components
Section titled “System Components”
graph TD
subgraph Anthropic["Anthropic — Claude Managed Agents"]
Mansa["Mansa
Coordinator"]
EP["Email Processor
up to 15 per round · 25 per session"]
MA["Meeting Agent"]
Dreamer["Dreamer"]
MemStores["Memory Stores
patterns.md per agent"]
Mansa -->|spawns| EP
Dreamer -->|compacts| MemStores
end
subgraph BKRInfra["BKR Capital Azure · Canada Central"]
EmailAPI["BKR Email API
FastAPI · Azure Container Apps"]
AzFunc["Azure Function API
Azure SQL"]
end
subgraph ExtServices["External Services"]
Graph["Microsoft 365
Microsoft Graph API"]
Attio["Attio CRM
MCP Server"]
GSlides["Google Slides API"]
end
Mansa -->|read and search emails| EmailAPI
Mansa -->|send digest| EmailAPI
AzFunc -->|check_duplicate| Mansa
Mansa -->|log_processed_email| AzFunc
EP -->|read and label emails| EmailAPI
EP -->|fetch slide decks| GSlides
EP -->|create and update records| Attio
Attio -->|notify of meeting| MA
MA -->|update pipeline and assign tasks| Attio
MA -->|send weekly recap| EmailAPI
EmailAPI -->|OAuth via MSAL| Graph
Component Responsibilities
Section titled “Component Responsibilities”BKR Agent (bkr-claude-managed-agent)
Section titled “BKR Agent (bkr-claude-managed-agent)”The AI workforce. Runs on Anthropic Claude Managed Agents. Four agents across two patterns:
Coordinator + worker (daily pipeline):
- Mansa (Coordinator): pulls unread emails, spawns Email Processor subagents in parallel, collects results, and sends the digest
- Email Processor (Worker): handles one or more similar emails per instance; up to 15 run in parallel per round, up to 25 per session across multiple rounds
Independently triggered (separate scheduled jobs):
- Meeting Agent: triggered by an Attio webhook when a Deal Intro meeting is logged; reads meeting notes, updates Attio pipeline stages, assigns tasks
- Dreamer: triggered separately each week to compact agent memory stores
See BKR Agent for full detail.
BKR Email API (bkr-email-api)
Section titled “BKR Email API (bkr-email-api)”A FastAPI service that gives agents safe, scoped access to the BKR Capital shared mailbox (pipeline@bkrcapital.ca). It wraps Microsoft Graph API behind a REST interface with scoped API key authentication.
See Email API for full detail.
Key Design Decisions
Section titled “Key Design Decisions”Coordinator + Worker Pattern
Section titled “Coordinator + Worker Pattern”The daily pipeline uses a coordinator-worker pattern. Mansa spawns Email Processor subagents in parallel batches of up to 15. Each processor handles one or more emails when Mansa judges them similar enough to group. A session can run multiple rounds, with up to 25 processors total. The Meeting Agent is triggered by an Attio webhook. The Dreamer runs on a separate weekly schedule.
Persistent Memory Stores
Section titled “Persistent Memory Stores”Each agent maintains a patterns.md file that persists across runs. This gives agents cross-session learning without requiring a vector database or fine-tuning. The Dreamer agent compacts these files weekly to prevent unbounded growth.
Idempotent Setup Scripts
Section titled “Idempotent Setup Scripts”Two scripts (agents.py, skills.py) create and update every Anthropic resource. They are fully idempotent, so they are safe to re-run at any time without creating duplicates.
Email as Integration Boundary
Section titled “Email as Integration Boundary”The system communicates with the BKR team entirely via email (daily digest, weekly recap). This requires no new tool adoption by the team and ensures the output is archived automatically in the shared mailbox.
Deployment
Section titled “Deployment”| Component | Platform | Region |
|---|---|---|
| BKR Agent | Anthropic Claude Managed Agents | Anthropic-hosted |
| BKR Email API | Azure Container Apps (BKR Capital Azure account) | Canada Central |
| Azure SQL | BKR Capital Azure account | Canada Central |
Data Flow: Daily Run
Section titled “Data Flow: Daily Run”
sequenceDiagram
participant Scheduler
participant Mansa
participant Processor as Email Processor (up to 15/round)
participant EmailAPI as BKR Email API
participant Attio
participant AzFunc as Azure Function API
Scheduler->>Mansa: Trigger daily run
Mansa->>EmailAPI: GET /emails (unread)
EmailAPI-->>Mansa: Email list
AzFunc->>Mansa: check_duplicate
Mansa->>Processor: Delegate unprocessed emails (parallel)
Processor->>EmailAPI: GET /emails/{id} + attachments
Processor->>Attio: Deduplicate + create/update records
Processor->>EmailAPI: POST /drafts/reply
Processor->>EmailAPI: POST /emails/{id}/label (ai-processed)
Processor-->>Mansa: Results
Mansa->>EmailAPI: POST /send (digest email)
Mansa->>AzFunc: log_processed_email (one per email)
