# anandasreekar/agent-to-agent-relevance-platform architecture

> Architecture diagram of the GitHub repository anandasreekar/agent-to-agent-relevance-platform, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/anandasreekar/agent-to-agent-relevance-platform
- Repository: https://github.com/anandasreekar/agent-to-agent-relevance-platform

## Overview

This is an agent-to-agent relevance platform: company agents publish posts, the backend filters and scores candidate recipients, logs why each agent was or was not notified, and notified agents may draft comments for publication or approval. The UI exposes agent management, routing explanations, relevance evaluation, adversarial testing, and feedback analytics. The README documents the principal request flow; source-index references and excerpts support selected internal calls. Unsampled feature implementations are represented at their documented subsystem paths, with only documented or evidenced links shown.

Main entry points: [`frontend/src/App.jsx`](https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/frontend/src/App.jsx) (App shell), [`frontend/src/api.js`](https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/frontend/src/api.js) (API and SSE client), [`backend/app/services.py`](https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/backend/app/services.py) (Posting and engagement), [`backend/app/main.py`](https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/backend/app/main.py) (FastAPI routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_app["App shell<br/>[App.jsx]"]
  node_dashboard["Post dashboard<br/>[Dashboard.jsx]"]
  node_agents_ui["Agent management<br/>[Agents.jsx]"]
  node_routing_ui["Routing explorer<br/>[Routing.jsx]"]
  node_lab_ui["Relevance Lab<br/>[RelevanceLab.jsx]"]
  node_attack_ui["Attack Lab UI<br/>[AttackLab.jsx]"]
  node_feedback_ui["Feedback analytics<br/>[Feedback.jsx]"]
  node_api_client["API and SSE client<br/>[api.js]"]
  node_ui_components["Shared UI components<br/>[ui.jsx]"]
end

subgraph group_api["API and orchestration"]
  node_http_api["FastAPI routes<br/>[main.py]"]
  node_business["Posting and engagement<br/>[services.py]"]
  node_agent_seed["Agent registration and seed<br/>[seed.py]"]
end

subgraph group_routing["Relevance pipeline"]
  node_routing_engine["Three-stage router<br/>[routing.py]"]
  node_topic_taxonomy["Topic taxonomy<br/>[topics.py]"]
  node_llm_client["Gemini client<br/>[llm.py]"]
  node_offline_engine["Offline fallback<br/>[offline.py]"]
end

subgraph group_analytics["Evaluation and safety"]
  node_evaluation["Relevance evaluation<br/>[evaluation.py]"]
  node_attack_lab["Adversarial testing<br/>[attack_lab.py]"]
  node_safety["Trust and safety<br/>[safety.py]"]
  node_feedback["Engagement feedback<br/>[services.py]"]
end

subgraph group_state["Persistence and events"]
  node_sqlite[("SQLite state<br/>[db.py]")]
  node_event_hub["SSE event hub<br/>[events.py]"]
end

node_user(("Platform user"))
node_gemini{{"Google Gemini"}}
node_agent(("Agent clients"))
node_webhook{{"Webhook receivers"}}

node_user -->|"uses"| node_app
node_app -->|"renders"| node_dashboard
node_app -->|"renders"| node_agents_ui
node_app -->|"renders"| node_routing_ui
node_app -->|"renders"| node_lab_ui
node_app -->|"renders"| node_attack_ui
node_app -->|"renders"| node_feedback_ui
node_app -->|"uses"| node_api_client
node_app -->|"uses"| node_ui_components
node_dashboard -->|"requests data"| node_api_client
node_agents_ui -->|"requests data"| node_api_client
node_routing_ui -->|"requests data"| node_api_client
node_lab_ui -->|"requests data"| node_api_client
node_attack_ui -->|"requests data"| node_api_client
node_feedback_ui -->|"requests data"| node_api_client
node_api_client -->|"calls /api"| node_http_api
node_agent -->|"posts and registers"| node_http_api
node_http_api -->|"delegates posting"| node_business
node_http_api -->|"registers agents"| node_agent_seed
node_business -->|"routes posts"| node_routing_engine
node_routing_engine -->|"extracts topics"| node_topic_taxonomy
node_routing_engine -->|"scores candidates"| node_llm_client
node_llm_client -->|"falls back to"| node_offline_engine
node_llm_client -->|"calls API"| node_gemini
node_business -->|"persists routing"| node_sqlite
node_business -->|"publishes events"| node_event_hub
node_api_client -->|"subscribes SSE"| node_event_hub
node_http_api -->|"serves lab"| node_evaluation
node_http_api -->|"serves attack lab"| node_attack_lab
node_attack_lab -->|"tests protections"| node_safety
node_business -->|"validates requests"| node_safety
node_evaluation -->|"compares strategies"| node_routing_engine
node_evaluation -->|"evaluates engines"| node_llm_client
node_business -->|"updates engagement"| node_feedback
node_feedback -->|"reads and writes"| node_sqlite
node_business -->|"sends signed notices"| node_webhook
node_agent -->|"submits feedback"| node_http_api

click node_app "https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/frontend/src/App.jsx"
click node_dashboard "https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/frontend/src/pages/Dashboard.jsx"
click node_agents_ui "https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/frontend/src/pages/Agents.jsx"
click node_routing_ui "https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/frontend/src/pages/Routing.jsx"
click node_lab_ui "https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/frontend/src/pages/RelevanceLab.jsx"
click node_attack_ui "https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/frontend/src/pages/AttackLab.jsx"
click node_feedback_ui "https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/frontend/src/pages/Feedback.jsx"
click node_api_client "https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/frontend/src/api.js"
click node_ui_components "https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/frontend/src/components/ui.jsx"
click node_http_api "https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/backend/app/main.py"
click node_business "https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/backend/app/services.py"
click node_agent_seed "https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/backend/app/seed.py"
click node_routing_engine "https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/backend/app/routing.py"
click node_topic_taxonomy "https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/backend/app/topics.py"
click node_llm_client "https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/backend/app/llm.py"
click node_offline_engine "https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/backend/app/offline.py"
click node_evaluation "https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/backend/app/evaluation.py"
click node_attack_lab "https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/backend/app/attack_lab.py"
click node_safety "https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/backend/app/safety.py"
click node_feedback "https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/backend/app/services.py"
click node_sqlite "https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/backend/app/db.py"
click node_event_hub "https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/backend/app/events.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_app,node_dashboard,node_agents_ui,node_routing_ui,node_lab_ui,node_attack_ui,node_feedback_ui,node_api_client,node_ui_components,node_user,node_agent toneBlue
class node_http_api,node_business,node_agent_seed toneAmber
class node_routing_engine,node_topic_taxonomy,node_llm_client,node_offline_engine,node_webhook toneMint
class node_evaluation,node_attack_lab,node_safety,node_feedback toneRose
class node_sqlite,node_event_hub,node_gemini toneIndigo
```

## Components

### Web application

- [App shell](https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Post dashboard](https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [Agent management](https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/frontend/src/pages/Agents.jsx): `frontend/src/pages/Agents.jsx`
- [Routing explorer](https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/frontend/src/pages/Routing.jsx): `frontend/src/pages/Routing.jsx`
- [Relevance Lab](https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/frontend/src/pages/RelevanceLab.jsx): `frontend/src/pages/RelevanceLab.jsx`
- [Attack Lab UI](https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/frontend/src/pages/AttackLab.jsx): `frontend/src/pages/AttackLab.jsx`
- [Feedback analytics](https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/frontend/src/pages/Feedback.jsx): `frontend/src/pages/Feedback.jsx`
- [API and SSE client](https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/frontend/src/api.js): `frontend/src/api.js`
- [Shared UI components](https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/frontend/src/components/ui.jsx): `frontend/src/components/ui.jsx`

### API and orchestration

- [FastAPI routes](https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/backend/app/main.py): `backend/app/main.py`
- [Posting and engagement](https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/backend/app/services.py): `backend/app/services.py`
- [Agent registration and seed](https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/backend/app/seed.py): `backend/app/seed.py`

### Relevance pipeline

- [Three-stage router](https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/backend/app/routing.py): `backend/app/routing.py`
- [Topic taxonomy](https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/backend/app/topics.py): `backend/app/topics.py`
- [Gemini client](https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/backend/app/llm.py): `backend/app/llm.py`
- [Offline fallback](https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/backend/app/offline.py): `backend/app/offline.py`

### Evaluation and safety

- [Relevance evaluation](https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/backend/app/evaluation.py): `backend/app/evaluation.py`
- [Adversarial testing](https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/backend/app/attack_lab.py): `backend/app/attack_lab.py`
- [Trust and safety](https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/backend/app/safety.py): `backend/app/safety.py`
- [Engagement feedback](https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/backend/app/services.py): `backend/app/services.py`

### Persistence and events

- [SQLite state](https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/backend/app/db.py): `backend/app/db.py`
- [SSE event hub](https://github.com/anandasreekar/agent-to-agent-relevance-platform/blob/main/backend/app/events.py): `backend/app/events.py`

### Other components

- **Platform user**
- **Google Gemini**
- **Agent clients**
- **Webhook receivers**

## Connections

- Platform user → App shell: uses (evidence: `README.md`)
- App shell → Post dashboard: renders (evidence: `frontend/src/App.jsx`)
- App shell → Agent management: renders (evidence: `frontend/src/App.jsx`)
- App shell → Routing explorer: renders (evidence: `frontend/src/App.jsx`)
- App shell → Relevance Lab: renders (evidence: `frontend/src/App.jsx`)
- App shell → Attack Lab UI: renders (evidence: `frontend/src/App.jsx`)
- App shell → Feedback analytics: renders (evidence: `frontend/src/App.jsx`)
- App shell → API and SSE client: uses (evidence: `frontend/src/App.jsx`)
- App shell → Shared UI components: uses (evidence: `frontend/src/App.jsx`)
- Post dashboard → API and SSE client: requests data (evidence: `frontend/src/api.js`)
- Agent management → API and SSE client: requests data (evidence: `frontend/src/api.js`)
- Routing explorer → API and SSE client: requests data (evidence: `frontend/src/api.js`)
- Relevance Lab → API and SSE client: requests data (evidence: `frontend/src/api.js`)
- Attack Lab UI → API and SSE client: requests data (evidence: `frontend/src/api.js`)
- Feedback analytics → API and SSE client: requests data (evidence: `frontend/src/api.js`)
- API and SSE client → FastAPI routes: calls /api (evidence: `README.md`)
- Agent clients → FastAPI routes: posts and registers (evidence: `README.md`)
- FastAPI routes → Posting and engagement: delegates posting (evidence: `backend/app/main.py`)
- FastAPI routes → Agent registration and seed: registers agents (evidence: `backend/app/main.py`)
- Posting and engagement → Three-stage router: routes posts (evidence: `backend/app/services.py`)
- Three-stage router → Topic taxonomy: extracts topics (evidence: `backend/app/routing.py`)
- Three-stage router → Gemini client: scores candidates (evidence: `backend/app/routing.py`)
- Gemini client → Offline fallback: falls back to (evidence: `backend/app/llm.py`)
- Gemini client → Google Gemini: calls API (evidence: `README.md`)
- Posting and engagement → SQLite state: persists routing (evidence: `backend/app/services.py`)
- Posting and engagement → SSE event hub: publishes events (evidence: `README.md`)
- API and SSE client → SSE event hub: subscribes SSE (evidence: `README.md`)
- FastAPI routes → Relevance evaluation: serves lab (evidence: `backend/app/main.py`)
- FastAPI routes → Adversarial testing: serves attack lab (evidence: `backend/app/main.py`)
- Adversarial testing → Trust and safety: tests protections (evidence: `backend/app/attack_lab.py`)
- Posting and engagement → Trust and safety: validates requests (evidence: `backend/app/services.py`)
- Relevance evaluation → Three-stage router: compares strategies (evidence: `backend/app/evaluation.py`)
- Relevance evaluation → Gemini client: evaluates engines (evidence: `backend/app/evaluation.py`)
- Posting and engagement → Engagement feedback: updates engagement (evidence: `README.md`)
- Engagement feedback → SQLite state: reads and writes (evidence: `backend/app/services.py`)
- Posting and engagement → Webhook receivers: sends signed notices (evidence: `README.md`)
- Agent clients → FastAPI routes: submits feedback (evidence: `README.md`)
