# seyaff/autonomous-agents architecture

> Architecture diagram of the GitHub repository seyaff/autonomous-agents, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/seyaff/autonomous-agents
- Repository: https://github.com/seyaff/autonomous-agents

## Overview

This is a multi-tenant restaurant operations and founder-growth platform, with a web dashboard and FastAPI backend. The principal customer workflow accepts a WhatsApp interaction, routes it through the master agent, builds customer context, and uses support tools for knowledge lookup or order operations. The repository also contains account and tenant management, analytics, founder lead/outreach, and document knowledge features. Several endpoint and agent implementations are unsampled, so their capabilities are represented from the source index and routing declarations; uncertain runtime links are omitted.

Main entry points: [`app/api/v1/routes.py`](https://github.com/seyaff/autonomous-agents/blob/main/app/api/v1/routes.py) (API router), [`app/agents/customer_support/tools.py`](https://github.com/seyaff/autonomous-agents/blob/main/app/agents/customer_support/tools.py) (Support tools), [`app/agents/customer_support/agent.py`](https://github.com/seyaff/autonomous-agents/blob/main/app/agents/customer_support/agent.py) (Support agent), [`app/core/database.py`](https://github.com/seyaff/autonomous-agents/blob/main/app/core/database.py) (MongoDB)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web dashboard"]
  node_dashboard["Dashboard<br/>[page.tsx]"]
  node_onboarding["Onboarding<br/>[page.tsx]"]
  node_agent_client["Agent client<br/>[agent.service.ts]"]
end

subgraph group_api["API and identity"]
  node_api_router["API router<br/>[routes.py]"]
  node_auth_api["Auth endpoints<br/>[auth.py]"]
  node_tenant_api["Tenant endpoints<br/>[tenant.py]"]
  node_agent_api["Agent endpoint<br/>[agent.py]"]
  node_whatsapp_api["WhatsApp endpoint<br/>[whatsapp.py]"]
  node_analytics_api["Analytics endpoint<br/>[analytics.py]"]
  node_founder_api["Founder endpoint<br/>[founder.py]"]
  node_knowledge_api["Knowledge endpoint<br/>[knowledge.py]"]
  node_auth_middleware["Auth middleware<br/>[auth_middleware.py]"]
end

subgraph group_agents["Agents and operations"]
  node_master_agent["Master agent<br/>[central_agent.py]"]
  node_support_agent["Support agent<br/>[agent.py]"]
  node_support_tools["Support tools<br/>[tools.py]"]
  node_founder_leads["Lead generation<br/>[lead_generator.py]"]
  node_founder_outreach["Founder outreach<br/>[outreach_agent.py]"]
  node_weekly_report["Weekly analytics<br/>[weekly_report.py]"]
end

subgraph group_knowledge["Knowledge and memory"]
  node_context_builder["Context builder<br/>[context_builder.py]"]
  node_customer_memory["Customer memory<br/>[customer_memory.py]"]
  node_checkpointer["Conversation checkpoint"]
  node_knowledge_ingest["Knowledge ingestion"]
  node_pdf_ingest["PDF ingestion<br/>[pdf_ingestion.py]"]
end

subgraph group_platform["Platform state"]
  node_mongo[("MongoDB<br/>[database.py]")]
  node_vector_store[("Pinecone vectors")]
end

node_user(("User"))
node_whatsapp(("WhatsApp"))

node_user -->|"uses"| node_dashboard
node_dashboard -.->|"requests agent"| node_agent_client
node_agent_client -.->|"calls"| node_agent_api
node_user -->|"sets up tenant"| node_onboarding
node_onboarding -.->|"configures tenant"| node_tenant_api
node_api_router -->|"routes to"| node_auth_api
node_api_router -->|"routes to"| node_tenant_api
node_api_router -->|"routes to"| node_agent_api
node_api_router -->|"routes to"| node_whatsapp_api
node_api_router -->|"routes to"| node_analytics_api
node_api_router -->|"routes to"| node_founder_api
node_api_router -->|"routes to"| node_knowledge_api
node_agent_api -->|"invokes"| node_master_agent
node_master_agent -->|"dispatches to"| node_support_agent
node_support_agent -->|"uses tools"| node_support_tools
node_support_agent -->|"builds context"| node_context_builder
node_context_builder -->|"reads state"| node_support_agent
node_context_builder -->|"loads profile"| node_customer_memory
node_support_agent -->|"checkpoints"| node_checkpointer
node_support_tools -->|"searches knowledge"| node_knowledge_ingest
node_support_tools -->|"uses PDF ingestion"| node_pdf_ingest
node_support_tools -->|"updates profile"| node_customer_memory
node_support_tools -->|"reads/writes orders"| node_mongo
node_knowledge_ingest -->|"records documents"| node_mongo
node_knowledge_ingest -->|"upserts and searches"| node_vector_store
node_pdf_ingest -->|"stores embeddings"| node_vector_store
node_auth_api -->|"manages accounts"| node_mongo
node_auth_api -->|"checks identity"| node_auth_middleware
node_auth_middleware -->|"loads user"| node_mongo
node_tenant_api -->|"manages tenant"| node_mongo
node_analytics_api -->|"uses report"| node_weekly_report
node_founder_api -->|"invokes"| node_founder_leads
node_founder_api -->|"invokes"| node_founder_outreach
node_whatsapp -.->|"sends messages"| node_whatsapp_api

click node_dashboard "https://github.com/seyaff/autonomous-agents/blob/main/frontend/src/app/(dashboard)/dashboard/page.tsx"
click node_onboarding "https://github.com/seyaff/autonomous-agents/blob/main/frontend/src/app/(dashboard)/onboarding/page.tsx"
click node_agent_client "https://github.com/seyaff/autonomous-agents/blob/main/frontend/services/agent/agent.service.ts"
click node_api_router "https://github.com/seyaff/autonomous-agents/blob/main/app/api/v1/routes.py"
click node_auth_api "https://github.com/seyaff/autonomous-agents/blob/main/app/api/v1/endpoints/auth.py"
click node_tenant_api "https://github.com/seyaff/autonomous-agents/blob/main/app/api/v1/endpoints/tenant.py"
click node_agent_api "https://github.com/seyaff/autonomous-agents/blob/main/app/api/v1/endpoints/agent.py"
click node_whatsapp_api "https://github.com/seyaff/autonomous-agents/blob/main/app/api/v1/endpoints/whatsapp.py"
click node_analytics_api "https://github.com/seyaff/autonomous-agents/blob/main/app/api/v1/endpoints/analytics.py"
click node_founder_api "https://github.com/seyaff/autonomous-agents/blob/main/app/api/v1/endpoints/founder.py"
click node_knowledge_api "https://github.com/seyaff/autonomous-agents/blob/main/app/api/v1/endpoints/knowledge.py"
click node_auth_middleware "https://github.com/seyaff/autonomous-agents/blob/main/app/middlewares/auth_middleware.py"
click node_master_agent "https://github.com/seyaff/autonomous-agents/blob/main/app/agents/central_agent.py"
click node_support_agent "https://github.com/seyaff/autonomous-agents/blob/main/app/agents/customer_support/agent.py"
click node_support_tools "https://github.com/seyaff/autonomous-agents/blob/main/app/agents/customer_support/tools.py"
click node_founder_leads "https://github.com/seyaff/autonomous-agents/blob/main/app/agents/founder/lead_generator.py"
click node_founder_outreach "https://github.com/seyaff/autonomous-agents/blob/main/app/agents/founder/outreach_agent.py"
click node_weekly_report "https://github.com/seyaff/autonomous-agents/blob/main/app/agents/analytics/weekly_report.py"
click node_context_builder "https://github.com/seyaff/autonomous-agents/blob/main/app/memory/context_builder.py"
click node_customer_memory "https://github.com/seyaff/autonomous-agents/blob/main/app/memory/customer_memory.py"
click node_checkpointer "https://github.com/seyaff/autonomous-agents/blob/main/app/memory/mongo_checkpointer.py"
click node_knowledge_ingest "https://github.com/seyaff/autonomous-agents/blob/main/app/services/knowledge_ingestion.py"
click node_pdf_ingest "https://github.com/seyaff/autonomous-agents/blob/main/app/services/pdf_ingestion.py"
click node_mongo "https://github.com/seyaff/autonomous-agents/blob/main/app/core/database.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_dashboard,node_onboarding,node_agent_client,node_user toneBlue
class node_api_router,node_auth_api,node_tenant_api,node_agent_api,node_whatsapp_api,node_analytics_api,node_founder_api,node_knowledge_api,node_auth_middleware toneAmber
class node_master_agent,node_support_agent,node_support_tools,node_founder_leads,node_founder_outreach,node_weekly_report toneMint
class node_context_builder,node_customer_memory,node_checkpointer,node_knowledge_ingest,node_pdf_ingest toneRose
class node_mongo,node_vector_store,node_whatsapp toneIndigo
```

## Components

### Web dashboard

- [Dashboard](https://github.com/seyaff/autonomous-agents/blob/main/frontend/src/app/(dashboard)/dashboard/page.tsx): `frontend/src/app/(dashboard)/dashboard/page.tsx`
- [Onboarding](https://github.com/seyaff/autonomous-agents/blob/main/frontend/src/app/(dashboard)/onboarding/page.tsx): `frontend/src/app/(dashboard)/onboarding/page.tsx`
- [Agent client](https://github.com/seyaff/autonomous-agents/blob/main/frontend/services/agent/agent.service.ts): `frontend/services/agent/agent.service.ts`

### API and identity

- [API router](https://github.com/seyaff/autonomous-agents/blob/main/app/api/v1/routes.py): `app/api/v1/routes.py`
- [Auth endpoints](https://github.com/seyaff/autonomous-agents/blob/main/app/api/v1/endpoints/auth.py): `app/api/v1/endpoints/auth.py`
- [Tenant endpoints](https://github.com/seyaff/autonomous-agents/blob/main/app/api/v1/endpoints/tenant.py): `app/api/v1/endpoints/tenant.py`
- [Agent endpoint](https://github.com/seyaff/autonomous-agents/blob/main/app/api/v1/endpoints/agent.py): `app/api/v1/endpoints/agent.py`
- [WhatsApp endpoint](https://github.com/seyaff/autonomous-agents/blob/main/app/api/v1/endpoints/whatsapp.py): `app/api/v1/endpoints/whatsapp.py`
- [Analytics endpoint](https://github.com/seyaff/autonomous-agents/blob/main/app/api/v1/endpoints/analytics.py): `app/api/v1/endpoints/analytics.py`
- [Founder endpoint](https://github.com/seyaff/autonomous-agents/blob/main/app/api/v1/endpoints/founder.py): `app/api/v1/endpoints/founder.py`
- [Knowledge endpoint](https://github.com/seyaff/autonomous-agents/blob/main/app/api/v1/endpoints/knowledge.py): `app/api/v1/endpoints/knowledge.py`
- [Auth middleware](https://github.com/seyaff/autonomous-agents/blob/main/app/middlewares/auth_middleware.py): `app/middlewares/auth_middleware.py`

### Agents and operations

- [Master agent](https://github.com/seyaff/autonomous-agents/blob/main/app/agents/central_agent.py): `app/agents/central_agent.py`
- [Support agent](https://github.com/seyaff/autonomous-agents/blob/main/app/agents/customer_support/agent.py): `app/agents/customer_support/agent.py`
- [Support tools](https://github.com/seyaff/autonomous-agents/blob/main/app/agents/customer_support/tools.py): `app/agents/customer_support/tools.py`
- [Lead generation](https://github.com/seyaff/autonomous-agents/blob/main/app/agents/founder/lead_generator.py): `app/agents/founder/lead_generator.py`
- [Founder outreach](https://github.com/seyaff/autonomous-agents/blob/main/app/agents/founder/outreach_agent.py): `app/agents/founder/outreach_agent.py`
- [Weekly analytics](https://github.com/seyaff/autonomous-agents/blob/main/app/agents/analytics/weekly_report.py): `app/agents/analytics/weekly_report.py`

### Knowledge and memory

- [Context builder](https://github.com/seyaff/autonomous-agents/blob/main/app/memory/context_builder.py): `app/memory/context_builder.py`
- [Customer memory](https://github.com/seyaff/autonomous-agents/blob/main/app/memory/customer_memory.py): `app/memory/customer_memory.py`
- [Conversation checkpoint](https://github.com/seyaff/autonomous-agents/blob/main/app/memory/mongo_checkpointer.py): `app/memory/mongo_checkpointer.py`
- [Knowledge ingestion](https://github.com/seyaff/autonomous-agents/blob/main/app/services/knowledge_ingestion.py): `app/services/knowledge_ingestion.py`
- [PDF ingestion](https://github.com/seyaff/autonomous-agents/blob/main/app/services/pdf_ingestion.py): `app/services/pdf_ingestion.py`

### Platform state

- [MongoDB](https://github.com/seyaff/autonomous-agents/blob/main/app/core/database.py): `app/core/database.py`
- **Pinecone vectors**

### Other components

- **User**
- **WhatsApp**

## Connections

- User → Dashboard: uses
- Dashboard → Agent client: requests agent
- Agent client → Agent endpoint: calls
- User → Onboarding: sets up tenant
- Onboarding → Tenant endpoints: configures tenant
- API router → Auth endpoints: routes to (evidence: `app/api/v1/routes.py`)
- API router → Tenant endpoints: routes to (evidence: `app/api/v1/routes.py`)
- API router → Agent endpoint: routes to (evidence: `app/api/v1/routes.py`)
- API router → WhatsApp endpoint: routes to (evidence: `app/api/v1/routes.py`)
- API router → Analytics endpoint: routes to (evidence: `app/api/v1/routes.py`)
- API router → Founder endpoint: routes to (evidence: `app/api/v1/routes.py`)
- API router → Knowledge endpoint: routes to (evidence: `app/api/v1/routes.py`)
- Agent endpoint → Master agent: invokes (evidence: `app/api/v1/endpoints/agent.py`)
- Master agent → Support agent: dispatches to (evidence: `app/agents/central_agent.py`)
- Support agent → Support tools: uses tools (evidence: `app/agents/customer_support/agent.py`)
- Support agent → Context builder: builds context (evidence: `app/memory/context_builder.py`)
- Context builder → Support agent: reads state (evidence: `app/memory/context_builder.py`)
- Context builder → Customer memory: loads profile (evidence: `app/memory/context_builder.py`)
- Support agent → Conversation checkpoint: checkpoints (evidence: `app/agents/customer_support/agent.py`)
- Support tools → Knowledge ingestion: searches knowledge (evidence: `app/agents/customer_support/tools.py`)
- Support tools → PDF ingestion: uses PDF ingestion (evidence: `app/agents/customer_support/tools.py`)
- Support tools → Customer memory: updates profile (evidence: `app/agents/customer_support/tools.py`)
- Support tools → MongoDB: reads/writes orders (evidence: `app/agents/customer_support/tools.py`)
- Knowledge ingestion → MongoDB: records documents (evidence: `app/services/knowledge_ingestion.py`)
- Knowledge ingestion → Pinecone vectors: upserts and searches (evidence: `app/services/knowledge_ingestion.py`)
- PDF ingestion → Pinecone vectors: stores embeddings (evidence: `app/services/pdf_ingestion.py`)
- Auth endpoints → MongoDB: manages accounts (evidence: `app/api/v1/endpoints/auth.py`)
- Auth endpoints → Auth middleware: checks identity (evidence: `app/api/v1/endpoints/auth.py`)
- Auth middleware → MongoDB: loads user (evidence: `app/middlewares/auth_middleware.py`)
- Tenant endpoints → MongoDB: manages tenant (evidence: `app/api/v1/endpoints/tenant.py`)
- Analytics endpoint → Weekly analytics: uses report (evidence: `app/api/v1/endpoints/analytics.py`)
- Founder endpoint → Lead generation: invokes (evidence: `app/api/v1/endpoints/founder.py`)
- Founder endpoint → Founder outreach: invokes (evidence: `app/api/v1/endpoints/founder.py`)
- WhatsApp → WhatsApp endpoint: sends messages
