# dinesh-dev1628/personal-agent architecture

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

- Interactive diagram: https://gitdiagram.com/dinesh-dev1628/personal-agent
- Repository: https://github.com/dinesh-dev1628/personal-agent

## Overview

Personal Agent is a FastAPI application with three user-facing workflows: habit planning, coding assistance, and general chat. Each route delegates to a matching agent runner, which uses task-specific instructions and a typed response model before returning the result. Runtime configuration supplies the Groq model and server settings. The README provides little architectural detail, so this map relies on the shown source; the model-provider interaction is inferred from the configured Groq model and agent execution.

Main entry points: [`src/ai/brain.py`](https://github.com/dinesh-dev1628/personal-agent/blob/main/src/ai/brain.py) (Agent runners), [`src/app.py`](https://github.com/dinesh-dev1628/personal-agent/blob/main/src/app.py) (HTTP routes), [`api/index.py`](https://github.com/dinesh-dev1628/personal-agent/blob/main/api/index.py) (API adapter), [`src/data/instructions.py`](https://github.com/dinesh-dev1628/personal-agent/blob/main/src/data/instructions.py) (Task instructions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API"]
  node_api_entry["API adapter<br/>[index.py]"]
  node_http_app["HTTP routes<br/>[app.py]"]
end

subgraph group_workspaces["Agent workspaces"]
  node_brain["Agent runners<br/>[brain.py]"]
  node_habit_agent["Habit agent<br/>[brain.py]"]
  node_coding_agent["Coding agent<br/>[brain.py]"]
  node_general_agent["General agent<br/>[brain.py]"]
end

subgraph group_shared["Shared agent setup"]
  node_instructions["Task instructions<br/>[instructions.py]"]
  node_schemas["Response schemas<br/>[basemodel.py]"]
  node_model_config["Model selection<br/>[settings.py]"]
  node_runtime_config["Runtime settings<br/>[env_data.py]"]
end

node_user(("User"))
node_groq{{"Groq model"}}

node_user -->|"submits prompt"| node_http_app
node_api_entry -->|"imports app"| node_http_app
node_http_app -->|"dispatches task"| node_brain
node_brain -->|"runs habit"| node_habit_agent
node_brain -->|"runs coding"| node_coding_agent
node_brain -->|"runs chat"| node_general_agent
node_brain -->|"configures agents"| node_instructions
node_brain -->|"sets output types"| node_schemas
node_brain -->|"selects model"| node_model_config
node_http_app -->|"reads server settings"| node_runtime_config
node_habit_agent -.->|"requests generation"| node_groq
node_coding_agent -.->|"requests generation"| node_groq
node_general_agent -.->|"requests generation"| node_groq
node_http_app -->|"returns result"| node_user

click node_api_entry "https://github.com/dinesh-dev1628/personal-agent/blob/main/api/index.py"
click node_http_app "https://github.com/dinesh-dev1628/personal-agent/blob/main/src/app.py"
click node_brain "https://github.com/dinesh-dev1628/personal-agent/blob/main/src/ai/brain.py"
click node_habit_agent "https://github.com/dinesh-dev1628/personal-agent/blob/main/src/ai/brain.py"
click node_coding_agent "https://github.com/dinesh-dev1628/personal-agent/blob/main/src/ai/brain.py"
click node_general_agent "https://github.com/dinesh-dev1628/personal-agent/blob/main/src/ai/brain.py"
click node_instructions "https://github.com/dinesh-dev1628/personal-agent/blob/main/src/data/instructions.py"
click node_schemas "https://github.com/dinesh-dev1628/personal-agent/blob/main/src/models/basemodel.py"
click node_model_config "https://github.com/dinesh-dev1628/personal-agent/blob/main/src/utils/settings.py"
click node_runtime_config "https://github.com/dinesh-dev1628/personal-agent/blob/main/src/utils/env_data.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_api_entry,node_http_app,node_user toneBlue
class node_brain,node_habit_agent,node_coding_agent,node_general_agent toneAmber
class node_instructions,node_schemas,node_model_config,node_runtime_config toneMint
class node_groq toneIndigo
```

## Components

### API

- [API adapter](https://github.com/dinesh-dev1628/personal-agent/blob/main/api/index.py): `api/index.py`
- [HTTP routes](https://github.com/dinesh-dev1628/personal-agent/blob/main/src/app.py): `src/app.py`

### Agent workspaces

- [Agent runners](https://github.com/dinesh-dev1628/personal-agent/blob/main/src/ai/brain.py): `src/ai/brain.py`
- [Habit agent](https://github.com/dinesh-dev1628/personal-agent/blob/main/src/ai/brain.py): `src/ai/brain.py`
- [Coding agent](https://github.com/dinesh-dev1628/personal-agent/blob/main/src/ai/brain.py): `src/ai/brain.py`
- [General agent](https://github.com/dinesh-dev1628/personal-agent/blob/main/src/ai/brain.py): `src/ai/brain.py`

### Shared agent setup

- [Task instructions](https://github.com/dinesh-dev1628/personal-agent/blob/main/src/data/instructions.py): `src/data/instructions.py`
- [Response schemas](https://github.com/dinesh-dev1628/personal-agent/blob/main/src/models/basemodel.py): `src/models/basemodel.py`
- [Model selection](https://github.com/dinesh-dev1628/personal-agent/blob/main/src/utils/settings.py): `src/utils/settings.py`
- [Runtime settings](https://github.com/dinesh-dev1628/personal-agent/blob/main/src/utils/env_data.py): `src/utils/env_data.py`

### Other components

- **User**
- **Groq model**

## Connections

- User → HTTP routes: submits prompt (evidence: `src/app.py`)
- API adapter → HTTP routes: imports app (evidence: `api/index.py`)
- HTTP routes → Agent runners: dispatches task (evidence: `src/app.py`)
- Agent runners → Habit agent: runs habit (evidence: `src/ai/brain.py`)
- Agent runners → Coding agent: runs coding (evidence: `src/ai/brain.py`)
- Agent runners → General agent: runs chat (evidence: `src/ai/brain.py`)
- Agent runners → Task instructions: configures agents (evidence: `src/ai/brain.py`)
- Agent runners → Response schemas: sets output types (evidence: `src/ai/brain.py`)
- Agent runners → Model selection: selects model (evidence: `src/ai/brain.py`)
- HTTP routes → Runtime settings: reads server settings (evidence: `src/app.py`)
- Habit agent → Groq model: requests generation
- Coding agent → Groq model: requests generation
- General agent → Groq model: requests generation
- HTTP routes → User: returns result (evidence: `src/app.py`)
