# shashishekhardixit/pentagi architecture

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

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

## Overview

PentAGI is a self-hosted autonomous penetration-testing system. A user configures and starts a flow through the web interface or API; specialized agents use language models, research and security tools, and an isolated Docker sandbox, then retain findings and produce reports. PostgreSQL/pgvector provides durable state and memory, with optional Graphiti knowledge-graph and observability integrations. The README documents these capabilities, but sampled backend files do not expose their call sites, so most backend links are documented high-level relationships rather than verified function calls.

Main entry points: [`backend/pkg/controller/flow.go`](https://github.com/shashishekhardixit/pentagi/blob/main/backend/pkg/controller/flow.go) (Flow Control), [`frontend/src/app.tsx`](https://github.com/shashishekhardixit/pentagi/blob/main/frontend/src/app.tsx) (Web Interface), [`backend/pkg/server/router.go`](https://github.com/shashishekhardixit/pentagi/blob/main/backend/pkg/server/router.go) (REST and GraphQL), [`backend/pkg/providers/handlers.go`](https://github.com/shashishekhardixit/pentagi/blob/main/backend/pkg/providers/handlers.go) (Agent Providers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["User Access"]
  node_web["Web Interface<br/>[app.tsx]"]
  node_filemgr["File Manager<br/>[file-manager.tsx]"]
  node_api["REST and GraphQL<br/>[router.go]"]
end

subgraph group_agents["Agent Execution"]
  node_flow["Flow Control<br/>[flow.go]"]
  node_specialists["Agent Providers<br/>[handlers.go]"]
  node_tooling["Security Tools<br/>[tools.go]"]
  node_sandbox["Docker Sandbox<br/>[sandbox.go]"]
  node_reports["Findings and Reports<br/>[templates.go]"]
end

subgraph group_state["Memory and Monitoring"]
  node_database[("PostgreSQL Memory<br/>[database.go]")]
  node_knowledge["Knowledge Graph<br/>[client.go]"]
  node_observability["Observability<br/>[collector.go]"]
end

subgraph group_setup["Setup and Operations"]
  node_installer["Installer Wizard<br/>[app.go]"]
  node_installproc["Install Processor<br/>[processor.go]"]
end

node_user(("Security Operator"))

node_user -->|"configures tests"| node_web
node_user -->|"automates via"| node_api
node_web -.->|"manages files"| node_filemgr
node_api -.->|"starts flows"| node_flow
node_flow -->|"delegates tasks"| node_specialists
node_specialists -->|"uses tools"| node_tooling
node_tooling -->|"executes isolated"| node_sandbox
node_flow -->|"stores results"| node_database
node_database -.->|"retains context"| node_knowledge
node_flow -->|"generates findings"| node_reports
node_flow -.->|"emits telemetry"| node_observability
node_user -->|"sets up system"| node_installer
node_installer -.->|"applies configuration"| node_installproc

click node_web "https://github.com/shashishekhardixit/pentagi/blob/main/frontend/src/app.tsx"
click node_filemgr "https://github.com/shashishekhardixit/pentagi/blob/main/frontend/src/components/shared/file-manager/file-manager.tsx"
click node_api "https://github.com/shashishekhardixit/pentagi/blob/main/backend/pkg/server/router.go"
click node_flow "https://github.com/shashishekhardixit/pentagi/blob/main/backend/pkg/controller/flow.go"
click node_specialists "https://github.com/shashishekhardixit/pentagi/blob/main/backend/pkg/providers/handlers.go"
click node_tooling "https://github.com/shashishekhardixit/pentagi/blob/main/backend/pkg/tools/tools.go"
click node_sandbox "https://github.com/shashishekhardixit/pentagi/blob/main/backend/pkg/docker/sandbox.go"
click node_reports "https://github.com/shashishekhardixit/pentagi/blob/main/backend/pkg/templates/templates.go"
click node_database "https://github.com/shashishekhardixit/pentagi/blob/main/backend/pkg/database/database.go"
click node_knowledge "https://github.com/shashishekhardixit/pentagi/blob/main/backend/pkg/graphiti/client.go"
click node_observability "https://github.com/shashishekhardixit/pentagi/blob/main/backend/pkg/observability/collector.go"
click node_installer "https://github.com/shashishekhardixit/pentagi/blob/main/backend/cmd/installer/wizard/app.go"
click node_installproc "https://github.com/shashishekhardixit/pentagi/blob/main/backend/cmd/installer/processor/processor.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_filemgr,node_api toneBlue
class node_flow,node_specialists,node_tooling,node_sandbox,node_reports toneAmber
class node_database,node_knowledge,node_observability toneMint
class node_installer,node_installproc toneRose
class node_user toneIndigo
```

## Components

### User Access

- [Web Interface](https://github.com/shashishekhardixit/pentagi/blob/main/frontend/src/app.tsx): `frontend/src/app.tsx`
- [File Manager](https://github.com/shashishekhardixit/pentagi/blob/main/frontend/src/components/shared/file-manager/file-manager.tsx): `frontend/src/components/shared/file-manager/file-manager.tsx`
- [REST and GraphQL](https://github.com/shashishekhardixit/pentagi/blob/main/backend/pkg/server/router.go): `backend/pkg/server/router.go`

### Agent Execution

- [Flow Control](https://github.com/shashishekhardixit/pentagi/blob/main/backend/pkg/controller/flow.go): `backend/pkg/controller/flow.go`
- [Agent Providers](https://github.com/shashishekhardixit/pentagi/blob/main/backend/pkg/providers/handlers.go): `backend/pkg/providers/handlers.go`
- [Security Tools](https://github.com/shashishekhardixit/pentagi/blob/main/backend/pkg/tools/tools.go): `backend/pkg/tools/tools.go`
- [Docker Sandbox](https://github.com/shashishekhardixit/pentagi/blob/main/backend/pkg/docker/sandbox.go): `backend/pkg/docker/sandbox.go`
- [Findings and Reports](https://github.com/shashishekhardixit/pentagi/blob/main/backend/pkg/templates/templates.go): `backend/pkg/templates/templates.go`

### Memory and Monitoring

- [PostgreSQL Memory](https://github.com/shashishekhardixit/pentagi/blob/main/backend/pkg/database/database.go): `backend/pkg/database/database.go`
- [Knowledge Graph](https://github.com/shashishekhardixit/pentagi/blob/main/backend/pkg/graphiti/client.go): `backend/pkg/graphiti/client.go`
- [Observability](https://github.com/shashishekhardixit/pentagi/blob/main/backend/pkg/observability/collector.go): `backend/pkg/observability/collector.go`

### Setup and Operations

- [Installer Wizard](https://github.com/shashishekhardixit/pentagi/blob/main/backend/cmd/installer/wizard/app.go): `backend/cmd/installer/wizard/app.go`
- [Install Processor](https://github.com/shashishekhardixit/pentagi/blob/main/backend/cmd/installer/processor/processor.go): `backend/cmd/installer/processor/processor.go`

### Other components

- **Security Operator**

## Connections

- Security Operator → Web Interface: configures tests
- Security Operator → REST and GraphQL: automates via
- Web Interface → File Manager: manages files
- REST and GraphQL → Flow Control: starts flows
- Flow Control → Agent Providers: delegates tasks
- Agent Providers → Security Tools: uses tools
- Security Tools → Docker Sandbox: executes isolated
- Flow Control → PostgreSQL Memory: stores results
- PostgreSQL Memory → Knowledge Graph: retains context
- Flow Control → Findings and Reports: generates findings
- Flow Control → Observability: emits telemetry
- Security Operator → Installer Wizard: sets up system
- Installer Wizard → Install Processor: applies configuration
