# vxcontrol/pentagi architecture

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

- Interactive diagram: https://gitdiagram.com/vxcontrol/pentagi
- Repository: https://github.com/vxcontrol/pentagi

## Overview

PentAGI is a self-hosted autonomous penetration-testing platform with a web console and interactive installer. Its principal workflow starts with a user-defined target and goal, coordinates specialist AI agents, gathers intelligence and executes security tools in an isolated Docker sandbox, retains findings for later flows, and produces reports. The graph also preserves documented API, provider, knowledge-graph, observability, and file-manager capabilities. Backend implementation excerpts were not supplied, so backend relationships below rely on README statements; UI file-manager relationships use the indexed source references and excerpts.

Main entry points: [`backend/pkg/providers/agent_for_chain.go`](https://github.com/vxcontrol/pentagi/blob/main/backend/pkg/providers/agent_for_chain.go) (Specialist agents), [`backend/pkg/tools/flow_manager.go`](https://github.com/vxcontrol/pentagi/blob/main/backend/pkg/tools/flow_manager.go) (Flow orchestration), [`frontend/src/app.tsx`](https://github.com/vxcontrol/pentagi/blob/main/frontend/src/app.tsx) (Web console), [`frontend/src/components/shared/file-manager/file-manager.tsx`](https://github.com/vxcontrol/pentagi/blob/main/frontend/src/components/shared/file-manager/file-manager.tsx) (File manager)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web interface"]
  node_web["Web console<br/>[app.tsx]"]
  node_filemanager["File manager<br/>[file-manager.tsx]"]
  node_filetypes["File manager helpers"]
  node_localstore["View preferences"]
end

subgraph group_api["API and persistence"]
  node_api["REST and GraphQL API<br/>[router.go]"]
  node_auth["Authentication<br/>[auth_middleware.go]"]
  node_services["Domain services"]
  node_postgres[("PostgreSQL memory<br/>[database.go]")]
end

subgraph group_execution["Agent execution"]
  node_flow["Flow orchestration<br/>[flow_manager.go]"]
  node_agents["Specialist agents<br/>[agent_for_chain.go]"]
  node_models["LLM providers<br/>[providers.go]"]
  node_sandbox["Docker sandbox<br/>[sandbox.go]"]
  node_pentesttools["Pentest tools<br/>[registry.go]"]
end

subgraph group_intelligence["Research and memory"]
  node_webintel["Web intelligence<br/>[web_search.go]"]
  node_searchers["Search integrations<br/>[searchers.go]"]
  node_memory["Long-term memory<br/>[memory.go]"]
  node_graphiti["Knowledge graph<br/>[client.go]"]
  node_report["Findings and reports<br/>[flow_finish.go]"]
end

subgraph group_operations["Deployment and monitoring"]
  node_installer["Interactive installer<br/>[main.go]"]
  node_observability["Monitoring and tracing<br/>[obs.go]"]
end

node_user(("Security engineer"))
node_external{{"External LLM and search services"}}
node_docker{{"Docker runtime"}}

node_user -->|"sets target"| node_web
node_web -.->|"uses APIs"| node_api
node_api -.->|"authenticates"| node_auth
node_api -.->|"routes requests"| node_services
node_services -.->|"persists results"| node_postgres
node_services -.->|"starts flows"| node_flow
node_flow -.->|"coordinates"| node_agents
node_agents -->|"requests completions"| node_models
node_agents -->|"executes tools"| node_pentesttools
node_pentesttools -->|"runs isolated"| node_sandbox
node_sandbox -->|"uses runtime"| node_docker
node_agents -->|"gathers intelligence"| node_webintel
node_webintel -.->|"queries providers"| node_searchers
node_agents -->|"retains findings"| node_memory
node_memory -->|"stores vectors"| node_postgres
node_agents -->|"tracks relationships"| node_graphiti
node_flow -->|"produces findings"| node_report
node_user -->|"configures deployment"| node_installer
node_flow -->|"emits telemetry"| node_observability
node_external -->|"provides models"| node_models
node_external -->|"provides search"| node_searchers
node_web -.->|"renders routes"| node_filemanager
node_filemanager -->|"renders rows"| node_filetypes
node_filemanager -.->|"stores preferences"| node_localstore

click node_web "https://github.com/vxcontrol/pentagi/blob/main/frontend/src/app.tsx"
click node_filemanager "https://github.com/vxcontrol/pentagi/blob/main/frontend/src/components/shared/file-manager/file-manager.tsx"
click node_filetypes "https://github.com/vxcontrol/pentagi/blob/main/frontend/src/components/shared/file-manager/file-manager-row.tsx"
click node_localstore "https://github.com/vxcontrol/pentagi/blob/main/frontend/src/lib/view-options-storage.ts"
click node_api "https://github.com/vxcontrol/pentagi/blob/main/backend/pkg/server/router.go"
click node_auth "https://github.com/vxcontrol/pentagi/blob/main/backend/pkg/server/auth/auth_middleware.go"
click node_services "https://github.com/vxcontrol/pentagi/tree/main/backend/pkg/server/services"
click node_postgres "https://github.com/vxcontrol/pentagi/blob/main/backend/pkg/database/database.go"
click node_flow "https://github.com/vxcontrol/pentagi/blob/main/backend/pkg/tools/flow_manager.go"
click node_agents "https://github.com/vxcontrol/pentagi/blob/main/backend/pkg/providers/agent_for_chain.go"
click node_models "https://github.com/vxcontrol/pentagi/blob/main/backend/pkg/providers/providers.go"
click node_sandbox "https://github.com/vxcontrol/pentagi/blob/main/backend/pkg/docker/sandbox.go"
click node_pentesttools "https://github.com/vxcontrol/pentagi/blob/main/backend/pkg/tools/registry.go"
click node_webintel "https://github.com/vxcontrol/pentagi/blob/main/backend/pkg/tools/web_search.go"
click node_searchers "https://github.com/vxcontrol/pentagi/blob/main/backend/pkg/tools/searchers/searchers.go"
click node_memory "https://github.com/vxcontrol/pentagi/blob/main/backend/pkg/tools/memory.go"
click node_graphiti "https://github.com/vxcontrol/pentagi/blob/main/backend/pkg/graphiti/client.go"
click node_report "https://github.com/vxcontrol/pentagi/blob/main/backend/pkg/controller/flow_finish.go"
click node_installer "https://github.com/vxcontrol/pentagi/blob/main/backend/cmd/installer/main.go"
click node_observability "https://github.com/vxcontrol/pentagi/blob/main/backend/pkg/observability/obs.go"

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_web,node_filemanager,node_filetypes,node_localstore toneBlue
class node_api,node_auth,node_services,node_postgres toneAmber
class node_flow,node_agents,node_models,node_sandbox,node_pentesttools toneMint
class node_webintel,node_searchers,node_memory,node_graphiti,node_report toneRose
class node_installer,node_observability,node_user,node_external,node_docker toneIndigo
```

## Components

### Web interface

- [Web console](https://github.com/vxcontrol/pentagi/blob/main/frontend/src/app.tsx): `frontend/src/app.tsx`
- [File manager](https://github.com/vxcontrol/pentagi/blob/main/frontend/src/components/shared/file-manager/file-manager.tsx): `frontend/src/components/shared/file-manager/file-manager.tsx`
- [File manager helpers](https://github.com/vxcontrol/pentagi/blob/main/frontend/src/components/shared/file-manager/file-manager-row.tsx): `frontend/src/components/shared/file-manager/file-manager-row.tsx`
- [View preferences](https://github.com/vxcontrol/pentagi/blob/main/frontend/src/lib/view-options-storage.ts): `frontend/src/lib/view-options-storage.ts`

### API and persistence

- [REST and GraphQL API](https://github.com/vxcontrol/pentagi/blob/main/backend/pkg/server/router.go): `backend/pkg/server/router.go`
- [Authentication](https://github.com/vxcontrol/pentagi/blob/main/backend/pkg/server/auth/auth_middleware.go): `backend/pkg/server/auth/auth_middleware.go`
- [Domain services](https://github.com/vxcontrol/pentagi/tree/main/backend/pkg/server/services): `backend/pkg/server/services`
- [PostgreSQL memory](https://github.com/vxcontrol/pentagi/blob/main/backend/pkg/database/database.go): `backend/pkg/database/database.go`

### Agent execution

- [Flow orchestration](https://github.com/vxcontrol/pentagi/blob/main/backend/pkg/tools/flow_manager.go): `backend/pkg/tools/flow_manager.go`
- [Specialist agents](https://github.com/vxcontrol/pentagi/blob/main/backend/pkg/providers/agent_for_chain.go): `backend/pkg/providers/agent_for_chain.go`
- [LLM providers](https://github.com/vxcontrol/pentagi/blob/main/backend/pkg/providers/providers.go): `backend/pkg/providers/providers.go`
- [Docker sandbox](https://github.com/vxcontrol/pentagi/blob/main/backend/pkg/docker/sandbox.go): `backend/pkg/docker/sandbox.go`
- [Pentest tools](https://github.com/vxcontrol/pentagi/blob/main/backend/pkg/tools/registry.go): `backend/pkg/tools/registry.go`

### Research and memory

- [Web intelligence](https://github.com/vxcontrol/pentagi/blob/main/backend/pkg/tools/web_search.go): `backend/pkg/tools/web_search.go`
- [Search integrations](https://github.com/vxcontrol/pentagi/blob/main/backend/pkg/tools/searchers/searchers.go): `backend/pkg/tools/searchers/searchers.go`
- [Long-term memory](https://github.com/vxcontrol/pentagi/blob/main/backend/pkg/tools/memory.go): `backend/pkg/tools/memory.go`
- [Knowledge graph](https://github.com/vxcontrol/pentagi/blob/main/backend/pkg/graphiti/client.go): `backend/pkg/graphiti/client.go`
- [Findings and reports](https://github.com/vxcontrol/pentagi/blob/main/backend/pkg/controller/flow_finish.go): `backend/pkg/controller/flow_finish.go`

### Deployment and monitoring

- [Interactive installer](https://github.com/vxcontrol/pentagi/blob/main/backend/cmd/installer/main.go): `backend/cmd/installer/main.go`
- [Monitoring and tracing](https://github.com/vxcontrol/pentagi/blob/main/backend/pkg/observability/obs.go): `backend/pkg/observability/obs.go`

### Other components

- **Security engineer**
- **External LLM and search services**
- **Docker runtime**

## Connections

- Security engineer → Web console: sets target
- Web console → REST and GraphQL API: uses APIs
- REST and GraphQL API → Authentication: authenticates
- REST and GraphQL API → Domain services: routes requests
- Domain services → PostgreSQL memory: persists results
- Domain services → Flow orchestration: starts flows
- Flow orchestration → Specialist agents: coordinates
- Specialist agents → LLM providers: requests completions
- Specialist agents → Pentest tools: executes tools
- Pentest tools → Docker sandbox: runs isolated
- Docker sandbox → Docker runtime: uses runtime
- Specialist agents → Web intelligence: gathers intelligence
- Web intelligence → Search integrations: queries providers
- Specialist agents → Long-term memory: retains findings
- Long-term memory → PostgreSQL memory: stores vectors
- Specialist agents → Knowledge graph: tracks relationships
- Flow orchestration → Findings and reports: produces findings
- Security engineer → Interactive installer: configures deployment
- Flow orchestration → Monitoring and tracing: emits telemetry
- External LLM and search services → LLM providers: provides models
- External LLM and search services → Search integrations: provides search
- Web console → File manager: renders routes
- File manager → File manager helpers: renders rows (evidence: `frontend/src/components/shared/file-manager/file-manager.tsx`)
- File manager → View preferences: stores preferences
