# 아키텍처

> PentAGI가 실행하는 서비스, 서비스 간 통신 방식 및 선택 사항에 대한 설명입니다.

PentAGI는 Docker 서비스 모음입니다. 핵심 스택만으로도 [flows](https://pentagi.com/ko/docs/glossary/#flow)를 실행할 수 있으며, [knowledge graph](https://pentagi.com/ko/docs/glossary/#knowledge-graph)와 관측 가능성 스택은 선택 사항인 추가 기능입니다.

## [시스템 컨텍스트](https://pentagi.com/ko/docs/concepts/architecture/#system-context)

```mermaid
flowchart LR
  accTitle: System context of PentAGI with its users, targets, LLM providers, search engines, monitoring and the update server
  user["Security engineer"] -->|HTTPS| pentagi["PentAGI"]
  user -->|monitors| langfuse["Langfuse"]
  user -->|monitors| grafana["Grafana"]
  pentagi -->|tests| target["Target systems"]
  pentagi -->|queries| llm["LLM providers"]
  pentagi -->|searches| search["Search engines"]
  pentagi -->|reports| langfuse
  pentagi -->|reports| grafana
  pentagi -->|checks for updates| update["update.pentagi.com"]
```

시작 후 2분 이내와 그 후 3시간마다 PentAGI는 `update.pentagi.com`에서 최신 빌드를 확인하며 요청과 함께 설치 요약 정보를 전송합니다. [업데이트 확인](https://pentagi.com/ko/docs/configuration/security/#update-check)에는 포함되는 내용과 비활성화하는 방법이 나와 있습니다.

## [서비스](https://pentagi.com/ko/docs/concepts/architecture/#services)

| 그룹              | 서비스                                                                                                                                           | Compose 파일                         |
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------- |
| 핵심              | `pentagi` (REST 및 GraphQL을 제공하는 Go 백엔드, React UI), `pgvector` (pgvector가 포함된 PostgreSQL), `pgexporter` (PostgreSQL 메트릭), `scraper` (격리된 브라우저) | `docker-compose.yml`               |
| Knowledge graph | `graphiti`, `neo4j`                                                                                                                           | `docker-compose-graphiti.yml`      |
| LLM 관측 가능성      | `langfuse-web`, `langfuse-worker`, `clickhouse`, `redis`, `minio`, `postgres`                                                                 | `docker-compose-langfuse.yml`      |
| 시스템 관측 가능성      | `grafana`, `otel`, `victoriametrics`, `jaeger`, `clickstore`, `loki`, `node-exporter`, `cadvisor`                                             | `docker-compose-observability.yml` |

[Tools](https://pentagi.com/ko/docs/glossary/#tool)는 `pentagi` 컨테이너 내부에서 직접 실행되지 않습니다. 모든 flow는 Kali Linux와 같이 flow의 목표에 따라 선택된 이미지로 빌드된 자체 [sandbox](https://pentagi.com/ko/docs/glossary/#sandbox) 컨테이너를 갖습니다.

## [컨테이너](https://pentagi.com/ko/docs/concepts/architecture/#containers)

```mermaid
graph TB
  accTitle: Containers of the core stack and the optional knowledge graph
  subgraph Core
    UI[Web UI] -->|HTTP/WS| API[Backend API]
    API --> DB[(PostgreSQL + pgvector)]
    API --> Agents[Agents]
    Agents --> Sandbox[Sandboxed tools]
    Agents --> Scraper[Isolated browser]
  end
  subgraph Knowledge graph
    Graphiti --> Neo4j[(Neo4j)]
  end
  Agents --> Graphiti
  API -->|telemetry| OTEL[OpenTelemetry]
  API -->|LLM traces| Langfuse
```

* **백엔드 API** — REST 및 GraphQL을 제공하며 자동화를 위한 Bearer 토큰 접근을 지원하는 Go 기반 서비스입니다.
* **Vector store** — pgvector가 포함된 PostgreSQL로, 모든 명령, 출력 및 임베딩을 보관합니다.
* **Agents** — 작업을 계획하고 실행하는 멀티 에이전트 시스템입니다. 자세한 내용은 [Agents](https://pentagi.com/ko/docs/concepts/agents/)를 참조하세요.
* **Sandbox** — 호스트로부터 격리된 tool 컨테이너입니다. 프로덕션 환경에서는 별도의 [worker node](https://pentagi.com/ko/docs/deployment/worker-node/)에 배치할 수 있습니다.