# arpayidcloud-byte/agent-x architecture

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

- Interactive diagram: https://gitdiagram.com/arpayidcloud-byte/agent-x
- Repository: https://github.com/arpayidcloud-byte/agent-x

## Overview

Agent-X is an enterprise AI-agent platform: a user submits a goal through the CLI or dashboard, the API/runtime routes work through agents and LLM providers, and the result is streamed or returned to the user. Its separate domain stages include goal planning, workflow execution, multi-agent collaboration, and cognitive learning; the shared memory engine is an internal supporting layer. The README documents the broad end-to-end flow and provider fallback. Source excerpts verify selected orchestrator calls and provider administration; unsampled app and package internals are represented only at directory level, so their detailed wiring is not inferred.

Main entry points: [`apps/api/src/agentx-server.ts`](https://github.com/arpayidcloud-byte/agent-x/blob/main/apps/api/src/agentx-server.ts) (API server), [`packages/runtime/runtime/src/execution-pipeline.ts`](https://github.com/arpayidcloud-byte/agent-x/blob/main/packages/runtime/runtime/src/execution-pipeline.ts) (Agent runtime), [`apps/cli/src`](https://github.com/arpayidcloud-byte/agent-x/tree/main/apps/cli/src) (CLI and TUI), [`apps/api/src/admin-llm-routes.ts`](https://github.com/arpayidcloud-byte/agent-x/blob/main/apps/api/src/admin-llm-routes.ts) (Provider administration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_surfaces["User surfaces"]
  node_cli["CLI and TUI"]
  node_web["Web dashboard"]
  node_admin["Admin console"]
  node_result["Agent result"]
end

subgraph group_service["API and routing"]
  node_api["API server<br/>[agentx-server.ts]"]
  node_provider_admin["Provider administration"]
  node_provider_store[("Provider configuration store")]
  node_llm_router["LLM routing<br/>[llm-providers.ts]"]
end

subgraph group_execution["Agent execution"]
  node_runtime["Agent runtime"]
  node_agent_platform["Agent orchestration<br/>[orchestrator.ts]"]
  node_goal_engine["Goal planning<br/>[goal-engine.ts]"]
  node_workflow["Workflow execution<br/>[engine.ts]"]
  node_collaboration["Multi-agent collaboration"]
end

subgraph group_cognition["Cognitive capabilities"]
  node_reasoning["Symbolic reasoning"]
  node_learning["Cognitive learning<br/>[learning-engine.ts]"]
  node_memory[("Memory engine<br/>[engine.ts]")]
  node_knowledge["Knowledge engine<br/>[engine.ts]"]
  node_distributed["Distributed cognition"]
  node_quality["Production quality checks<br/>[quality-engine.ts]"]
end

node_user(("User"))
node_external_llm{{"LLM providers"}}

node_user -->|"submits goal"| node_cli
node_user -.->|"uses dashboard"| node_web
node_user -.->|"manages providers"| node_admin
node_cli -.->|"sends requests"| node_api
node_web -.->|"uses API"| node_api
node_admin -.->|"manages providers"| node_api
node_api -.->|"dispatches work"| node_runtime
node_runtime -.->|"runs agents"| node_agent_platform
node_agent_platform -.->|"requests completion"| node_external_llm
node_external_llm -.->|"provider fallback"| node_llm_router
node_llm_router -.->|"routes requests"| node_external_llm
node_runtime -.->|"returns result"| node_result
node_result -.->|"displays result"| node_cli
node_api -.->|"exposes routes"| node_provider_admin
node_provider_admin -->|"reads and writes"| node_provider_store
node_provider_admin -->|"registers providers"| node_llm_router
node_cli -->|"streams chat"| node_api
node_goal_engine -.->|"plans workflows"| node_workflow
node_collaboration -.->|"supports adaptation"| node_learning
node_runtime -.->|"uses memory"| node_memory
node_runtime -.->|"checks readiness"| node_quality

click node_cli "https://github.com/arpayidcloud-byte/agent-x/tree/main/apps/cli/src"
click node_web "https://github.com/arpayidcloud-byte/agent-x/tree/main/apps/web/src"
click node_admin "https://github.com/arpayidcloud-byte/agent-x/tree/main/apps/admin/src"
click node_api "https://github.com/arpayidcloud-byte/agent-x/blob/main/apps/api/src/agentx-server.ts"
click node_provider_admin "https://github.com/arpayidcloud-byte/agent-x/blob/main/apps/api/src/admin-llm-routes.ts"
click node_provider_store "https://github.com/arpayidcloud-byte/agent-x/blob/main/apps/api/src/llm-provider-store.ts"
click node_llm_router "https://github.com/arpayidcloud-byte/agent-x/blob/main/apps/api/src/llm-providers.ts"
click node_runtime "https://github.com/arpayidcloud-byte/agent-x/blob/main/packages/runtime/runtime/src/execution-pipeline.ts"
click node_agent_platform "https://github.com/arpayidcloud-byte/agent-x/blob/main/packages/agent/agent-platform/src/orchestrator.ts"
click node_goal_engine "https://github.com/arpayidcloud-byte/agent-x/blob/main/packages/planning/goal-intelligence/src/goal-engine.ts"
click node_workflow "https://github.com/arpayidcloud-byte/agent-x/blob/main/packages/workflow/workflow-engine/src/engine.ts"
click node_collaboration "https://github.com/arpayidcloud-byte/agent-x/blob/main/packages/agent/multi-agent-collaboration/src/multi-agent-collaboration-engine.ts"
click node_reasoning "https://github.com/arpayidcloud-byte/agent-x/blob/main/packages/reasoning/reasoning-algorithms/src/reasoning-engine.ts"
click node_learning "https://github.com/arpayidcloud-byte/agent-x/blob/main/packages/cognitive/cognitive-learning/src/learning-engine.ts"
click node_memory "https://github.com/arpayidcloud-byte/agent-x/blob/main/packages/shared/memory-engine/src/engine.ts"
click node_knowledge "https://github.com/arpayidcloud-byte/agent-x/blob/main/packages/shared/knowledge-engine/src/engine.ts"
click node_distributed "https://github.com/arpayidcloud-byte/agent-x/tree/main/packages/distributed/distributed-cognition/src"
click node_quality "https://github.com/arpayidcloud-byte/agent-x/blob/main/packages/quality/production-quality/src/quality-engine.ts"

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_cli,node_web,node_admin,node_result,node_user toneBlue
class node_api,node_provider_admin,node_provider_store,node_llm_router toneAmber
class node_runtime,node_agent_platform,node_goal_engine,node_workflow,node_collaboration toneMint
class node_reasoning,node_learning,node_memory,node_knowledge,node_distributed,node_quality toneRose
class node_external_llm toneIndigo
```

## Components

### User surfaces

- [CLI and TUI](https://github.com/arpayidcloud-byte/agent-x/tree/main/apps/cli/src): `apps/cli/src`
- [Web dashboard](https://github.com/arpayidcloud-byte/agent-x/tree/main/apps/web/src): `apps/web/src`
- [Admin console](https://github.com/arpayidcloud-byte/agent-x/tree/main/apps/admin/src): `apps/admin/src`
- **Agent result**

### API and routing

- [API server](https://github.com/arpayidcloud-byte/agent-x/blob/main/apps/api/src/agentx-server.ts): `apps/api/src/agentx-server.ts`
- [Provider administration](https://github.com/arpayidcloud-byte/agent-x/blob/main/apps/api/src/admin-llm-routes.ts): `apps/api/src/admin-llm-routes.ts`
- [Provider configuration store](https://github.com/arpayidcloud-byte/agent-x/blob/main/apps/api/src/llm-provider-store.ts): `apps/api/src/llm-provider-store.ts`
- [LLM routing](https://github.com/arpayidcloud-byte/agent-x/blob/main/apps/api/src/llm-providers.ts): `apps/api/src/llm-providers.ts`

### Agent execution

- [Agent runtime](https://github.com/arpayidcloud-byte/agent-x/blob/main/packages/runtime/runtime/src/execution-pipeline.ts): `packages/runtime/runtime/src/execution-pipeline.ts`
- [Agent orchestration](https://github.com/arpayidcloud-byte/agent-x/blob/main/packages/agent/agent-platform/src/orchestrator.ts): `packages/agent/agent-platform/src/orchestrator.ts`
- [Goal planning](https://github.com/arpayidcloud-byte/agent-x/blob/main/packages/planning/goal-intelligence/src/goal-engine.ts): `packages/planning/goal-intelligence/src/goal-engine.ts`
- [Workflow execution](https://github.com/arpayidcloud-byte/agent-x/blob/main/packages/workflow/workflow-engine/src/engine.ts): `packages/workflow/workflow-engine/src/engine.ts`
- [Multi-agent collaboration](https://github.com/arpayidcloud-byte/agent-x/blob/main/packages/agent/multi-agent-collaboration/src/multi-agent-collaboration-engine.ts): `packages/agent/multi-agent-collaboration/src/multi-agent-collaboration-engine.ts`

### Cognitive capabilities

- [Symbolic reasoning](https://github.com/arpayidcloud-byte/agent-x/blob/main/packages/reasoning/reasoning-algorithms/src/reasoning-engine.ts): `packages/reasoning/reasoning-algorithms/src/reasoning-engine.ts`
- [Cognitive learning](https://github.com/arpayidcloud-byte/agent-x/blob/main/packages/cognitive/cognitive-learning/src/learning-engine.ts): `packages/cognitive/cognitive-learning/src/learning-engine.ts`
- [Memory engine](https://github.com/arpayidcloud-byte/agent-x/blob/main/packages/shared/memory-engine/src/engine.ts): `packages/shared/memory-engine/src/engine.ts`
- [Knowledge engine](https://github.com/arpayidcloud-byte/agent-x/blob/main/packages/shared/knowledge-engine/src/engine.ts): `packages/shared/knowledge-engine/src/engine.ts`
- [Distributed cognition](https://github.com/arpayidcloud-byte/agent-x/tree/main/packages/distributed/distributed-cognition/src): `packages/distributed/distributed-cognition/src`
- [Production quality checks](https://github.com/arpayidcloud-byte/agent-x/blob/main/packages/quality/production-quality/src/quality-engine.ts): `packages/quality/production-quality/src/quality-engine.ts`

### Other components

- **User**
- **LLM providers**

## Connections

- User → CLI and TUI: submits goal (evidence: `README.md`)
- User → Web dashboard: uses dashboard (evidence: `README.md`)
- User → Admin console: manages providers
- CLI and TUI → API server: sends requests (evidence: `README.md`)
- Web dashboard → API server: uses API (evidence: `README.md`)
- Admin console → API server: manages providers
- API server → Agent runtime: dispatches work (evidence: `README.md`)
- Agent runtime → Agent orchestration: runs agents (evidence: `README.md`)
- Agent orchestration → LLM providers: requests completion (evidence: `README.md`)
- LLM providers → LLM routing: provider fallback (evidence: `README.md`)
- LLM routing → LLM providers: routes requests (evidence: `README.md`)
- Agent runtime → Agent result: returns result (evidence: `README.md`)
- Agent result → CLI and TUI: displays result (evidence: `README.md`)
- API server → Provider administration: exposes routes (evidence: `apps/api/src/admin-llm-routes.ts`)
- Provider administration → Provider configuration store: reads and writes (evidence: `apps/api/src/admin-llm-routes.ts`)
- Provider administration → LLM routing: registers providers (evidence: `apps/api/src/admin-llm-routes.ts`)
- CLI and TUI → API server: streams chat (evidence: `apps/cli/src/lib/chat-engine.ts`)
- Goal planning → Workflow execution: plans workflows
- Multi-agent collaboration → Cognitive learning: supports adaptation
- Agent runtime → Memory engine: uses memory
- Agent runtime → Production quality checks: checks readiness
