# tuankiettran287/testagent architecture

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

- Interactive diagram: https://gitdiagram.com/tuankiettran287/testagent
- Repository: https://github.com/tuankiettran287/testagent

## Overview

TestAgent is an AI-assisted QA workspace: users describe a test goal, choose automatic routing or a specialist, build or review cases, then run selected cases and inspect results. Its major branches include source ingestion, AI-provider connections, analysis and case generation, browser/API execution, and reporting. The README documents the overall workflow; source references establish several internal calls. The API implementation and some subsystems were not excerpted, so their internal links are shown only where documented or left unconnected.

Main entry points: [`testagent/orchestrator.py`](https://github.com/tuankiettran287/testagent/blob/master/testagent/orchestrator.py) (Agent routing), [`testagent/planner.py`](https://github.com/tuankiettran287/testagent/blob/master/testagent/planner.py) (Task planner), [`web/src/App.tsx`](https://github.com/tuankiettran287/testagent/blob/master/web/src/App.tsx) (QA workspace), [`web/src/api.ts`](https://github.com/tuankiettran287/testagent/blob/master/web/src/api.ts) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Workspace interface"]
  node_workspace["QA workspace<br/>[App.tsx]"]
  node_ui_connections["AI connections<br/>[AiConnections.tsx]"]
  node_ui_workflow["Task workflow<br/>[TaskWorkflow.tsx]"]
  node_ui_library["Test library<br/>[TestLibrary.tsx]"]
  node_web_api["API client<br/>[api.ts]"]
end

subgraph group_coordination["Task coordination"]
  node_backend_api["HTTP API<br/>[api.py]"]
  node_orchestrator["Agent routing<br/>[orchestrator.py]"]
  node_planner["Task planner<br/>[planner.py]"]
  node_subagents["Analysis sub-agents<br/>[subagents.py]"]
end

subgraph group_knowledge["QA knowledge and design"]
  node_skills["Specialist skills<br/>[skills.py]"]
  node_ingest["Source ingestion<br/>[ingest.py]"]
  node_knowledge_store["Project knowledge<br/>[knowledge.py]"]
  node_context["Prompt context<br/>[context.py]"]
  node_case_schemas["Case and route schemas<br/>[schemas.py]"]
end

subgraph group_execution["Test execution"]
  node_runner["Run coordinator<br/>[runner.py]"]
  node_automation["Automation repair<br/>[automation.py]"]
  node_browser_bridge["Browser bridge<br/>[browser_bridge.py]"]
  node_browser_runner["Playwright runner<br/>[protocol.ts]"]
end

subgraph group_platform["State and integrations"]
  node_provider_manager["AI provider manager<br/>[ai_providers.py]"]
  node_llm["LLM transport<br/>[llm.py]"]
  node_cli_transport["Provider CLI transport<br/>[cli_transport.py]"]
  node_database[("SQLite workspace data<br/>[db.py]")]
end

node_user(("QA user"))
node_target_site["Application under test"]

node_user -->|"describes goal"| node_workspace
node_workspace -->|"renders"| node_ui_connections
node_workspace -->|"renders"| node_ui_workflow
node_workspace -->|"renders"| node_ui_library
node_workspace -->|"calls"| node_web_api
node_ui_connections -->|"calls"| node_web_api
node_ui_workflow -->|"calls"| node_web_api
node_ui_library -->|"calls"| node_web_api
node_web_api -->|"HTTP requests"| node_backend_api
node_backend_api -.->|"routes tasks"| node_orchestrator
node_orchestrator -->|"requests routing"| node_llm
node_orchestrator -->|"selects specialist"| node_skills
node_orchestrator -->|"validates route"| node_case_schemas
node_orchestrator -->|"collects routing context"| node_context
node_orchestrator -.->|"dispatches analysis"| node_subagents
node_planner -->|"requests routing"| node_orchestrator
node_planner -->|"uses specialist skills"| node_skills
node_planner -->|"delegates analysis"| node_subagents
node_planner -->|"validates outputs"| node_case_schemas
node_planner -->|"loads project knowledge"| node_knowledge_store
node_planner -->|"compacts context"| node_context
node_ingest -->|"stores imported sources"| node_knowledge_store
node_orchestrator -->|"reads routing context"| node_database
node_runner -->|"stores run results"| node_database
node_runner -->|"uses automation"| node_automation
node_runner -->|"invokes browser"| node_browser_bridge
node_browser_bridge -.->|"invokes runner"| node_browser_runner
node_browser_runner -->|"drives browser"| node_target_site
node_planner -->|"starts execution"| node_runner
node_llm -->|"resolves provider"| node_provider_manager
node_provider_manager -->|"uses CLI transport"| node_cli_transport
node_backend_api -.->|"persists workspace"| node_database

click node_workspace "https://github.com/tuankiettran287/testagent/blob/master/web/src/App.tsx"
click node_ui_connections "https://github.com/tuankiettran287/testagent/blob/master/web/src/AiConnections.tsx"
click node_ui_workflow "https://github.com/tuankiettran287/testagent/blob/master/web/src/TaskWorkflow.tsx"
click node_ui_library "https://github.com/tuankiettran287/testagent/blob/master/web/src/TestLibrary.tsx"
click node_web_api "https://github.com/tuankiettran287/testagent/blob/master/web/src/api.ts"
click node_backend_api "https://github.com/tuankiettran287/testagent/blob/master/testagent/api.py"
click node_orchestrator "https://github.com/tuankiettran287/testagent/blob/master/testagent/orchestrator.py"
click node_planner "https://github.com/tuankiettran287/testagent/blob/master/testagent/planner.py"
click node_subagents "https://github.com/tuankiettran287/testagent/blob/master/testagent/subagents.py"
click node_skills "https://github.com/tuankiettran287/testagent/blob/master/testagent/skills.py"
click node_ingest "https://github.com/tuankiettran287/testagent/blob/master/testagent/ingest.py"
click node_knowledge_store "https://github.com/tuankiettran287/testagent/blob/master/testagent/knowledge.py"
click node_context "https://github.com/tuankiettran287/testagent/blob/master/testagent/context.py"
click node_case_schemas "https://github.com/tuankiettran287/testagent/blob/master/testagent/schemas.py"
click node_runner "https://github.com/tuankiettran287/testagent/blob/master/testagent/runner.py"
click node_automation "https://github.com/tuankiettran287/testagent/blob/master/testagent/automation.py"
click node_browser_bridge "https://github.com/tuankiettran287/testagent/blob/master/testagent/browser_bridge.py"
click node_browser_runner "https://github.com/tuankiettran287/testagent/blob/master/browser_runner/src/protocol.ts"
click node_provider_manager "https://github.com/tuankiettran287/testagent/blob/master/testagent/ai_providers.py"
click node_llm "https://github.com/tuankiettran287/testagent/blob/master/testagent/llm.py"
click node_cli_transport "https://github.com/tuankiettran287/testagent/blob/master/testagent/cli_transport.py"
click node_database "https://github.com/tuankiettran287/testagent/blob/master/testagent/db.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_workspace,node_ui_connections,node_ui_workflow,node_ui_library,node_web_api,node_user toneBlue
class node_backend_api,node_orchestrator,node_planner,node_subagents toneAmber
class node_skills,node_ingest,node_knowledge_store,node_context,node_case_schemas toneMint
class node_runner,node_automation,node_browser_bridge,node_browser_runner toneRose
class node_provider_manager,node_llm,node_cli_transport,node_database,node_target_site toneIndigo
```

## Components

### Workspace interface

- [QA workspace](https://github.com/tuankiettran287/testagent/blob/master/web/src/App.tsx): `web/src/App.tsx`
- [AI connections](https://github.com/tuankiettran287/testagent/blob/master/web/src/AiConnections.tsx): `web/src/AiConnections.tsx`
- [Task workflow](https://github.com/tuankiettran287/testagent/blob/master/web/src/TaskWorkflow.tsx): `web/src/TaskWorkflow.tsx`
- [Test library](https://github.com/tuankiettran287/testagent/blob/master/web/src/TestLibrary.tsx): `web/src/TestLibrary.tsx`
- [API client](https://github.com/tuankiettran287/testagent/blob/master/web/src/api.ts): `web/src/api.ts`

### Task coordination

- [HTTP API](https://github.com/tuankiettran287/testagent/blob/master/testagent/api.py): `testagent/api.py`
- [Agent routing](https://github.com/tuankiettran287/testagent/blob/master/testagent/orchestrator.py): `testagent/orchestrator.py`
- [Task planner](https://github.com/tuankiettran287/testagent/blob/master/testagent/planner.py): `testagent/planner.py`
- [Analysis sub-agents](https://github.com/tuankiettran287/testagent/blob/master/testagent/subagents.py): `testagent/subagents.py`

### QA knowledge and design

- [Specialist skills](https://github.com/tuankiettran287/testagent/blob/master/testagent/skills.py): `testagent/skills.py`
- [Source ingestion](https://github.com/tuankiettran287/testagent/blob/master/testagent/ingest.py): `testagent/ingest.py`
- [Project knowledge](https://github.com/tuankiettran287/testagent/blob/master/testagent/knowledge.py): `testagent/knowledge.py`
- [Prompt context](https://github.com/tuankiettran287/testagent/blob/master/testagent/context.py): `testagent/context.py`
- [Case and route schemas](https://github.com/tuankiettran287/testagent/blob/master/testagent/schemas.py): `testagent/schemas.py`

### Test execution

- [Run coordinator](https://github.com/tuankiettran287/testagent/blob/master/testagent/runner.py): `testagent/runner.py`
- [Automation repair](https://github.com/tuankiettran287/testagent/blob/master/testagent/automation.py): `testagent/automation.py`
- [Browser bridge](https://github.com/tuankiettran287/testagent/blob/master/testagent/browser_bridge.py): `testagent/browser_bridge.py`
- [Playwright runner](https://github.com/tuankiettran287/testagent/blob/master/browser_runner/src/protocol.ts): `browser_runner/src/protocol.ts`

### State and integrations

- [AI provider manager](https://github.com/tuankiettran287/testagent/blob/master/testagent/ai_providers.py): `testagent/ai_providers.py`
- [LLM transport](https://github.com/tuankiettran287/testagent/blob/master/testagent/llm.py): `testagent/llm.py`
- [Provider CLI transport](https://github.com/tuankiettran287/testagent/blob/master/testagent/cli_transport.py): `testagent/cli_transport.py`
- [SQLite workspace data](https://github.com/tuankiettran287/testagent/blob/master/testagent/db.py): `testagent/db.py`

### Other components

- **QA user**
- **Application under test**

## Connections

- QA user → QA workspace: describes goal (evidence: `README.md`)
- QA workspace → AI connections: renders (evidence: `web/src/App.tsx`)
- QA workspace → Task workflow: renders (evidence: `web/src/App.tsx`)
- QA workspace → Test library: renders (evidence: `web/src/App.tsx`)
- QA workspace → API client: calls (evidence: `web/src/App.tsx`)
- AI connections → API client: calls (evidence: `web/src/AiConnections.tsx`)
- Task workflow → API client: calls (evidence: `web/src/TaskWorkflow.tsx`)
- Test library → API client: calls (evidence: `web/src/TestLibrary.tsx`)
- API client → HTTP API: HTTP requests (evidence: `README.md`)
- HTTP API → Agent routing: routes tasks
- Agent routing → LLM transport: requests routing (evidence: `testagent/orchestrator.py`)
- Agent routing → Specialist skills: selects specialist (evidence: `testagent/orchestrator.py`)
- Agent routing → Case and route schemas: validates route (evidence: `testagent/orchestrator.py`)
- Agent routing → Prompt context: collects routing context (evidence: `testagent/orchestrator.py`)
- Agent routing → Analysis sub-agents: dispatches analysis
- Task planner → Agent routing: requests routing (evidence: `testagent/planner.py`)
- Task planner → Specialist skills: uses specialist skills (evidence: `testagent/planner.py`)
- Task planner → Analysis sub-agents: delegates analysis (evidence: `testagent/planner.py`)
- Task planner → Case and route schemas: validates outputs (evidence: `testagent/planner.py`)
- Task planner → Project knowledge: loads project knowledge (evidence: `testagent/planner.py`)
- Task planner → Prompt context: compacts context (evidence: `testagent/planner.py`)
- Source ingestion → Project knowledge: stores imported sources (evidence: `testagent/ingest.py`)
- Agent routing → SQLite workspace data: reads routing context
- Run coordinator → SQLite workspace data: stores run results (evidence: `testagent/runner.py`)
- Run coordinator → Automation repair: uses automation (evidence: `testagent/runner.py`)
- Run coordinator → Browser bridge: invokes browser (evidence: `testagent/runner.py`)
- Browser bridge → Playwright runner: invokes runner
- Playwright runner → Application under test: drives browser (evidence: `README.md`)
- Task planner → Run coordinator: starts execution (evidence: `testagent/planner.py`)
- LLM transport → AI provider manager: resolves provider (evidence: `testagent/llm.py`)
- AI provider manager → Provider CLI transport: uses CLI transport (evidence: `testagent/ai_providers.py`)
- HTTP API → SQLite workspace data: persists workspace
