# priyadarsh912/automation-ai-agent architecture

> Architecture diagram of the GitHub repository priyadarsh912/automation-ai-agent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/priyadarsh912/automation-ai-agent
- Repository: https://github.com/priyadarsh912/automation-ai-agent

## Overview

PersonaAI is an autonomous, persona-driven content agent with a web dashboard. Users configure an agent, trigger or await a cycle, and review published posts, editorial decisions, memory, and analytics. The sampled TypeScript server dispatches dashboard requests to the TypeScript agent runtime; the separate Python agent tree also describes an autonomous discover–judge–write workflow. Several modules and route implementations were not sampled, so those capabilities are represented without speculative internal wiring.

Main entry points: [`website/src/hooks/useAgent.ts`](https://github.com/priyadarsh912/automation-ai-agent/blob/main/website/src/hooks/useAgent.ts) (Agent Controls), [`workspace-019fe02f-8906-7b00-a122-09a1ded60640/app/main.py`](https://github.com/priyadarsh912/automation-ai-agent/blob/main/workspace-019fe02f-8906-7b00-a122-09a1ded60640/app/main.py) (Python Orchestrator), [`website/src/server.ts`](https://github.com/priyadarsh912/automation-ai-agent/blob/main/website/src/server.ts) (Agent API), [`website/src/routes/index.tsx`](https://github.com/priyadarsh912/automation-ai-agent/blob/main/website/src/routes/index.tsx) (Landing Page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard"]
  node_landing["Landing Page<br/>[index.tsx]"]
  node_agent_hook["Agent Controls<br/>[useAgent.ts]"]
  node_feed["Post Feed<br/>[feed.tsx]"]
  node_post_detail["Post Detail<br/>[post.$id.tsx]"]
  node_analytics["Analytics<br/>[analytics.tsx]"]
  node_memory_view["Memory View<br/>[memory.tsx]"]
  node_settings["Agent Settings<br/>[settings.tsx]"]
end

subgraph group_web_runtime["Web Runtime"]
  node_api["Agent API<br/>[server.ts]"]
  node_ts_agent["Agent Cycle<br/>[agent.ts]"]
  node_state_file[("Persisted State<br/>[agent.ts]")]
end

subgraph group_python_agent["Python Agent"]
  node_py_main["Python Orchestrator<br/>[main.py]"]
  node_discovery["Topic Discovery<br/>[discovery.py]"]
  node_judge["Editorial Judge<br/>[judge.py]"]
  node_persona["Persona Writer<br/>[persona.py]"]
  node_memory["Agent Memory<br/>[memory.py]"]
  node_llm_adapter["LLM Adapter<br/>[llm_adapter.py]"]
end

subgraph group_integrations["External Services"]
  node_arxiv["arXiv"]
  node_gemini["Gemini API"]
end

node_user(("Agent Operator"))

node_user -->|"visits"| node_landing
node_user -->|"reviews"| node_feed
node_user -->|"reviews"| node_analytics
node_user -->|"reviews"| node_memory_view
node_user -->|"configures"| node_settings
node_landing -->|"launches"| node_agent_hook
node_feed -->|"loads state"| node_agent_hook
node_post_detail -->|"loads state"| node_agent_hook
node_analytics -->|"loads state"| node_agent_hook
node_memory_view -->|"loads state"| node_agent_hook
node_settings -->|"updates settings"| node_agent_hook
node_agent_hook -->|"sends requests"| node_api
node_api -->|"runs cycle"| node_ts_agent
node_api -->|"reads/writes"| node_state_file
node_ts_agent -->|"reads/writes"| node_state_file
node_py_main -->|"requests topics"| node_discovery
node_py_main -->|"evaluates topics"| node_judge
node_py_main -->|"builds post"| node_persona
node_py_main -->|"generates text"| node_llm_adapter
node_py_main -->|"uses memory"| node_memory
node_discovery -.->|"fetches papers"| node_arxiv
node_llm_adapter -.->|"generates content"| node_gemini

click node_landing "https://github.com/priyadarsh912/automation-ai-agent/blob/main/website/src/routes/index.tsx"
click node_agent_hook "https://github.com/priyadarsh912/automation-ai-agent/blob/main/website/src/hooks/useAgent.ts"
click node_feed "https://github.com/priyadarsh912/automation-ai-agent/blob/main/website/src/routes/feed.tsx"
click node_post_detail "https://github.com/priyadarsh912/automation-ai-agent/blob/main/website/src/routes/post.%24id.tsx"
click node_analytics "https://github.com/priyadarsh912/automation-ai-agent/blob/main/website/src/routes/analytics.tsx"
click node_memory_view "https://github.com/priyadarsh912/automation-ai-agent/blob/main/website/src/routes/memory.tsx"
click node_settings "https://github.com/priyadarsh912/automation-ai-agent/blob/main/website/src/routes/settings.tsx"
click node_api "https://github.com/priyadarsh912/automation-ai-agent/blob/main/website/src/server.ts"
click node_ts_agent "https://github.com/priyadarsh912/automation-ai-agent/blob/main/website/src/lib/agent.ts"
click node_state_file "https://github.com/priyadarsh912/automation-ai-agent/blob/main/website/src/lib/agent.ts"
click node_py_main "https://github.com/priyadarsh912/automation-ai-agent/blob/main/workspace-019fe02f-8906-7b00-a122-09a1ded60640/app/main.py"
click node_discovery "https://github.com/priyadarsh912/automation-ai-agent/blob/main/workspace-019fe02f-8906-7b00-a122-09a1ded60640/app/agent/discovery.py"
click node_judge "https://github.com/priyadarsh912/automation-ai-agent/blob/main/workspace-019fe02f-8906-7b00-a122-09a1ded60640/app/agent/judge.py"
click node_persona "https://github.com/priyadarsh912/automation-ai-agent/blob/main/workspace-019fe02f-8906-7b00-a122-09a1ded60640/app/agent/persona.py"
click node_memory "https://github.com/priyadarsh912/automation-ai-agent/blob/main/workspace-019fe02f-8906-7b00-a122-09a1ded60640/app/agent/memory.py"
click node_llm_adapter "https://github.com/priyadarsh912/automation-ai-agent/blob/main/workspace-019fe02f-8906-7b00-a122-09a1ded60640/app/agent/llm_adapter.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_landing,node_agent_hook,node_feed,node_post_detail,node_analytics,node_memory_view,node_settings toneBlue
class node_api,node_ts_agent,node_state_file toneAmber
class node_py_main,node_discovery,node_judge,node_persona,node_memory,node_llm_adapter toneMint
class node_arxiv,node_gemini toneRose
class node_user toneIndigo
```

## Components

### Dashboard

- [Landing Page](https://github.com/priyadarsh912/automation-ai-agent/blob/main/website/src/routes/index.tsx): `website/src/routes/index.tsx`
- [Agent Controls](https://github.com/priyadarsh912/automation-ai-agent/blob/main/website/src/hooks/useAgent.ts): `website/src/hooks/useAgent.ts`
- [Post Feed](https://github.com/priyadarsh912/automation-ai-agent/blob/main/website/src/routes/feed.tsx): `website/src/routes/feed.tsx`
- [Post Detail](https://github.com/priyadarsh912/automation-ai-agent/blob/main/website/src/routes/post.%24id.tsx): `website/src/routes/post.$id.tsx`
- [Analytics](https://github.com/priyadarsh912/automation-ai-agent/blob/main/website/src/routes/analytics.tsx): `website/src/routes/analytics.tsx`
- [Memory View](https://github.com/priyadarsh912/automation-ai-agent/blob/main/website/src/routes/memory.tsx): `website/src/routes/memory.tsx`
- [Agent Settings](https://github.com/priyadarsh912/automation-ai-agent/blob/main/website/src/routes/settings.tsx): `website/src/routes/settings.tsx`

### Web Runtime

- [Agent API](https://github.com/priyadarsh912/automation-ai-agent/blob/main/website/src/server.ts): `website/src/server.ts`
- [Agent Cycle](https://github.com/priyadarsh912/automation-ai-agent/blob/main/website/src/lib/agent.ts): `website/src/lib/agent.ts`
- [Persisted State](https://github.com/priyadarsh912/automation-ai-agent/blob/main/website/src/lib/agent.ts): `website/src/lib/agent.ts`

### Python Agent

- [Python Orchestrator](https://github.com/priyadarsh912/automation-ai-agent/blob/main/workspace-019fe02f-8906-7b00-a122-09a1ded60640/app/main.py): `workspace-019fe02f-8906-7b00-a122-09a1ded60640/app/main.py`
- [Topic Discovery](https://github.com/priyadarsh912/automation-ai-agent/blob/main/workspace-019fe02f-8906-7b00-a122-09a1ded60640/app/agent/discovery.py): `workspace-019fe02f-8906-7b00-a122-09a1ded60640/app/agent/discovery.py`
- [Editorial Judge](https://github.com/priyadarsh912/automation-ai-agent/blob/main/workspace-019fe02f-8906-7b00-a122-09a1ded60640/app/agent/judge.py): `workspace-019fe02f-8906-7b00-a122-09a1ded60640/app/agent/judge.py`
- [Persona Writer](https://github.com/priyadarsh912/automation-ai-agent/blob/main/workspace-019fe02f-8906-7b00-a122-09a1ded60640/app/agent/persona.py): `workspace-019fe02f-8906-7b00-a122-09a1ded60640/app/agent/persona.py`
- [Agent Memory](https://github.com/priyadarsh912/automation-ai-agent/blob/main/workspace-019fe02f-8906-7b00-a122-09a1ded60640/app/agent/memory.py): `workspace-019fe02f-8906-7b00-a122-09a1ded60640/app/agent/memory.py`
- [LLM Adapter](https://github.com/priyadarsh912/automation-ai-agent/blob/main/workspace-019fe02f-8906-7b00-a122-09a1ded60640/app/agent/llm_adapter.py): `workspace-019fe02f-8906-7b00-a122-09a1ded60640/app/agent/llm_adapter.py`

### External Services

- **arXiv**
- **Gemini API**

### Other components

- **Agent Operator**

## Connections

- Agent Operator → Landing Page: visits
- Agent Operator → Post Feed: reviews
- Agent Operator → Analytics: reviews
- Agent Operator → Memory View: reviews
- Agent Operator → Agent Settings: configures
- Landing Page → Agent Controls: launches
- Post Feed → Agent Controls: loads state
- Post Detail → Agent Controls: loads state
- Analytics → Agent Controls: loads state
- Memory View → Agent Controls: loads state
- Agent Settings → Agent Controls: updates settings
- Agent Controls → Agent API: sends requests
- Agent API → Agent Cycle: runs cycle
- Agent API → Persisted State: reads/writes
- Agent Cycle → Persisted State: reads/writes
- Python Orchestrator → Topic Discovery: requests topics
- Python Orchestrator → Editorial Judge: evaluates topics
- Python Orchestrator → Persona Writer: builds post
- Python Orchestrator → LLM Adapter: generates text
- Python Orchestrator → Agent Memory: uses memory
- Topic Discovery → arXiv: fetches papers
- LLM Adapter → Gemini API: generates content
