# abdurrahim2705/ai-task-assistant architecture

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

- Interactive diagram: https://gitdiagram.com/abdurrahim2705/ai-task-assistant
- Repository: https://github.com/abdurrahim2705/ai-task-assistant

## Overview

This is an AI task-management dashboard: users view and manage tasks directly, or send a chat request for the assistant to create, list, update, or delete tasks. The frontend loads task data and submits chat and task actions to the FastAPI API; the API routes task operations through CRUD to PostgreSQL and chat requests to a LangGraph agent, whose tools reuse CRUD. The agent also calls Gemini and keeps conversation checkpoints in memory. Feature scope is based on sampled code; no README capabilities were provided.

Main entry points: [`backend/main.py`](https://github.com/abdurrahim2705/ai-task-assistant/blob/main/backend/main.py) (REST API), [`backend/agent.py`](https://github.com/abdurrahim2705/ai-task-assistant/blob/main/backend/agent.py) (Chat agent), [`backend/crud.py`](https://github.com/abdurrahim2705/ai-task-assistant/blob/main/backend/crud.py) (Task CRUD), [`backend/database.py`](https://github.com/abdurrahim2705/ai-task-assistant/blob/main/backend/database.py) (Database sessions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Task dashboard"]
  node_dashboard["Dashboard UI<br/>[App.jsx]"]
end

subgraph group_api["API and orchestration"]
  node_api_routes["REST API<br/>[main.py]"]
  node_schemas["Request schemas<br/>[schemas.py]"]
end

subgraph group_agent["Assistant workflow"]
  node_chat_agent["Chat agent<br/>[agent.py]"]
  node_agent_tools["Task tools<br/>[agent.py]"]
  node_gemini["Gemini model"]
  node_thread_memory[("Thread memory<br/>[agent.py]")]
end

subgraph group_data["Task persistence"]
  node_crud["Task CRUD<br/>[crud.py]"]
  node_task_model["Task model<br/>[models.py]"]
  node_db_session["Database sessions<br/>[database.py]"]
  node_postgres[("PostgreSQL")]
end

node_user(("User"))

node_user -->|"uses"| node_dashboard
node_dashboard -->|"requests tasks"| node_api_routes
node_dashboard -->|"sends chat"| node_api_routes
node_api_routes -->|"routes task calls"| node_crud
node_api_routes -->|"invokes agent"| node_chat_agent
node_api_routes -->|"validates requests"| node_schemas
node_chat_agent -->|"calls model"| node_gemini
node_chat_agent -->|"dispatches tools"| node_agent_tools
node_chat_agent -->|"checkpoints threads"| node_thread_memory
node_agent_tools -->|"calls task operations"| node_crud
node_agent_tools -->|"builds task data"| node_schemas
node_crud -->|"queries and writes"| node_task_model
node_crud -->|"uses task types"| node_schemas
node_api_routes -->|"opens task sessions"| node_db_session
node_agent_tools -->|"opens tool sessions"| node_db_session
node_task_model -->|"uses base"| node_db_session
node_db_session -->|"connects to"| node_postgres

click node_dashboard "https://github.com/abdurrahim2705/ai-task-assistant/blob/main/frontend/src/App.jsx"
click node_api_routes "https://github.com/abdurrahim2705/ai-task-assistant/blob/main/backend/main.py"
click node_chat_agent "https://github.com/abdurrahim2705/ai-task-assistant/blob/main/backend/agent.py"
click node_agent_tools "https://github.com/abdurrahim2705/ai-task-assistant/blob/main/backend/agent.py"
click node_thread_memory "https://github.com/abdurrahim2705/ai-task-assistant/blob/main/backend/agent.py"
click node_crud "https://github.com/abdurrahim2705/ai-task-assistant/blob/main/backend/crud.py"
click node_task_model "https://github.com/abdurrahim2705/ai-task-assistant/blob/main/backend/models.py"
click node_schemas "https://github.com/abdurrahim2705/ai-task-assistant/blob/main/backend/schemas.py"
click node_db_session "https://github.com/abdurrahim2705/ai-task-assistant/blob/main/backend/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_user toneBlue
class node_api_routes,node_schemas toneAmber
class node_chat_agent,node_agent_tools,node_gemini,node_thread_memory toneMint
class node_crud,node_task_model,node_db_session,node_postgres toneRose
```

## Components

### Task dashboard

- [Dashboard UI](https://github.com/abdurrahim2705/ai-task-assistant/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`

### API and orchestration

- [REST API](https://github.com/abdurrahim2705/ai-task-assistant/blob/main/backend/main.py): `backend/main.py`
- [Request schemas](https://github.com/abdurrahim2705/ai-task-assistant/blob/main/backend/schemas.py): `backend/schemas.py`

### Assistant workflow

- [Chat agent](https://github.com/abdurrahim2705/ai-task-assistant/blob/main/backend/agent.py): `backend/agent.py`
- [Task tools](https://github.com/abdurrahim2705/ai-task-assistant/blob/main/backend/agent.py): `backend/agent.py`
- **Gemini model**
- [Thread memory](https://github.com/abdurrahim2705/ai-task-assistant/blob/main/backend/agent.py): `backend/agent.py`

### Task persistence

- [Task CRUD](https://github.com/abdurrahim2705/ai-task-assistant/blob/main/backend/crud.py): `backend/crud.py`
- [Task model](https://github.com/abdurrahim2705/ai-task-assistant/blob/main/backend/models.py): `backend/models.py`
- [Database sessions](https://github.com/abdurrahim2705/ai-task-assistant/blob/main/backend/database.py): `backend/database.py`
- **PostgreSQL**

### Other components

- **User**

## Connections

- User → Dashboard UI: uses (evidence: `frontend/src/App.jsx`)
- Dashboard UI → REST API: requests tasks (evidence: `frontend/src/App.jsx`)
- Dashboard UI → REST API: sends chat (evidence: `frontend/src/App.jsx`)
- REST API → Task CRUD: routes task calls (evidence: `backend/main.py`)
- REST API → Chat agent: invokes agent (evidence: `backend/main.py`)
- REST API → Request schemas: validates requests (evidence: `backend/main.py`)
- Chat agent → Gemini model: calls model (evidence: `backend/agent.py`)
- Chat agent → Task tools: dispatches tools (evidence: `backend/agent.py`)
- Chat agent → Thread memory: checkpoints threads (evidence: `backend/agent.py`)
- Task tools → Task CRUD: calls task operations (evidence: `backend/agent.py`)
- Task tools → Request schemas: builds task data (evidence: `backend/agent.py`)
- Task CRUD → Task model: queries and writes (evidence: `backend/crud.py`)
- Task CRUD → Request schemas: uses task types (evidence: `backend/crud.py`)
- REST API → Database sessions: opens task sessions (evidence: `backend/main.py`)
- Task tools → Database sessions: opens tool sessions (evidence: `backend/agent.py`)
- Task model → Database sessions: uses base (evidence: `backend/models.py`)
- Database sessions → PostgreSQL: connects to (evidence: `backend/database.py`)
