# agentera/agently architecture

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

- Interactive diagram: https://gitdiagram.com/agentera/agently
- Repository: https://github.com/agentera/agently

## Overview

Agently is an AI application runtime framework. A typical run starts with an application creating an Agent, which executes a request through prompt construction and a pluggable model provider, then parses and returns structured results. Agents can also invoke observable Actions, bind Skills, and run task or signal-driven workflows. The README documents these capabilities, but sampled source does not establish every runtime call path; edges below use documented relationships, and unsampled subsystems are represented by existing directories.

Main entry points: [`agently/builtins/plugins/AgentExecution`](https://github.com/agentera/agently/tree/main/agently/builtins/plugins/AgentExecution) (Agent execution), [`agently/builtins/plugins/ModelRequester`](https://github.com/agentera/agently/tree/main/agently/builtins/plugins/ModelRequester) (Model providers), [`agently/core/Agent.py`](https://github.com/agentera/agently/blob/main/agently/core/Agent.py) (Agent), [`agently/base.py`](https://github.com/agentera/agently/blob/main/agently/base.py) (Agently framework)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_agent_runtime["Agent runtime"]
  node_framework["Agently framework<br/>[base.py]"]
  node_agent["Agent<br/>[Agent.py]"]
  node_execution["Agent execution"]
  node_execution_result["Execution result<br/>[Result.py]"]
  node_task_context["Task context<br/>[TaskContext.py]"]
end

subgraph group_model_io["Model and output"]
  node_prompt["Prompt generation"]
  node_model_request["Model request<br/>[ModelRequest.py]"]
  node_model_provider["Model providers"]
  node_output_parser["Structured output"]
end

subgraph group_actions_skills["Actions and Skills"]
  node_action_runtime["Action runtime"]
  node_action_executors["Action executors"]
  node_execution_resources["Execution resources"]
  node_skill_library["Skill library<br/>[SkillLibrary.py]"]
end

subgraph group_workflow["Workflow orchestration"]
  node_task_board["Task Board"]
  node_task_dag["Task DAG"]
  node_dynamic_task["Dynamic Task<br/>[DynamicTask.py]"]
  node_trigger_flow["TriggerFlow"]
end

subgraph group_state_services["State and services"]
  node_task_workspace["Task workspace<br/>[TaskWorkspace.py]"]
  node_record_store[("Record store<br/>[RecordStore.py]")]
  node_event_center["Runtime events<br/>[EventCenter.py]"]
  node_fastapi["FastAPI integration<br/>[fastapi.py]"]
end

node_application(("Application"))
node_model_service(("Model service"))

node_application -->|"creates runtime"| node_framework
node_framework -->|"provides Agent"| node_agent
node_agent -->|"starts run"| node_execution
node_execution -->|"builds prompt"| node_prompt
node_execution -->|"issues request"| node_model_request
node_model_request -->|"routes request"| node_model_provider
node_model_provider -->|"sends request"| node_model_service
node_model_service -->|"returns response"| node_model_provider
node_model_provider -->|"parses response"| node_output_parser
node_execution -->|"returns result"| node_execution_result
node_execution -->|"invokes Actions"| node_action_runtime
node_action_runtime -->|"dispatches Actions"| node_action_executors
node_action_executors -->|"uses resources"| node_execution_resources
node_execution -->|"binds Skills"| node_skill_library
node_execution -->|"records evidence"| node_task_context
node_application -->|"creates task"| node_dynamic_task
node_dynamic_task -->|"executes graph"| node_task_dag
node_execution -->|"uses strategy"| node_task_board
node_application -->|"defines workflow"| node_trigger_flow
node_execution -->|"delivers artifacts"| node_task_workspace
node_agent -.->|"uses memory"| node_record_store
node_execution -->|"emits observations"| node_event_center
node_application -->|"exposes service"| node_fastapi

click node_framework "https://github.com/agentera/agently/blob/main/agently/base.py"
click node_agent "https://github.com/agentera/agently/blob/main/agently/core/Agent.py"
click node_execution "https://github.com/agentera/agently/tree/main/agently/builtins/plugins/AgentExecution"
click node_prompt "https://github.com/agentera/agently/blob/main/agently/builtins/plugins/PromptGenerator/AgentlyPromptGenerator.py"
click node_model_request "https://github.com/agentera/agently/blob/main/agently/core/model/ModelRequest.py"
click node_model_provider "https://github.com/agentera/agently/tree/main/agently/builtins/plugins/ModelRequester"
click node_output_parser "https://github.com/agentera/agently/blob/main/agently/core/model/StructuredOutputParser.py"
click node_execution_result "https://github.com/agentera/agently/blob/main/agently/core/application/AgentExecution/Result.py"
click node_action_runtime "https://github.com/agentera/agently/blob/main/agently/core/operation/Action/ActionDispatcher.py"
click node_action_executors "https://github.com/agentera/agently/tree/main/agently/builtins/plugins/ActionExecutor"
click node_execution_resources "https://github.com/agentera/agently/tree/main/agently/builtins/plugins/ExecutionResourceProvider"
click node_skill_library "https://github.com/agentera/agently/blob/main/agently/core/application/SkillLibrary/SkillLibrary.py"
click node_task_context "https://github.com/agentera/agently/blob/main/agently/core/context/TaskContext.py"
click node_task_board "https://github.com/agentera/agently/tree/main/agently/core/orchestration/TaskBoard"
click node_task_dag "https://github.com/agentera/agently/tree/main/agently/core/orchestration/TaskDAG"
click node_dynamic_task "https://github.com/agentera/agently/blob/main/agently/core/application/DynamicTask/DynamicTask.py"
click node_trigger_flow "https://github.com/agentera/agently/tree/main/agently/core/orchestration/TriggerFlow"
click node_task_workspace "https://github.com/agentera/agently/blob/main/agently/core/TaskWorkspace/TaskWorkspace.py"
click node_record_store "https://github.com/agentera/agently/blob/main/agently/core/storage/RecordStore.py"
click node_event_center "https://github.com/agentera/agently/blob/main/agently/core/runtime/EventCenter.py"
click node_fastapi "https://github.com/agentera/agently/blob/main/agently/integrations/fastapi.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_framework,node_agent,node_execution,node_execution_result,node_task_context toneBlue
class node_prompt,node_model_request,node_model_provider,node_output_parser toneAmber
class node_action_runtime,node_action_executors,node_execution_resources,node_skill_library toneMint
class node_task_board,node_task_dag,node_dynamic_task,node_trigger_flow toneRose
class node_task_workspace,node_record_store,node_event_center,node_fastapi,node_application,node_model_service toneIndigo
```

## Components

### Agent runtime

- [Agently framework](https://github.com/agentera/agently/blob/main/agently/base.py): `agently/base.py`
- [Agent](https://github.com/agentera/agently/blob/main/agently/core/Agent.py): `agently/core/Agent.py`
- [Agent execution](https://github.com/agentera/agently/tree/main/agently/builtins/plugins/AgentExecution): `agently/builtins/plugins/AgentExecution`
- [Execution result](https://github.com/agentera/agently/blob/main/agently/core/application/AgentExecution/Result.py): `agently/core/application/AgentExecution/Result.py`
- [Task context](https://github.com/agentera/agently/blob/main/agently/core/context/TaskContext.py): `agently/core/context/TaskContext.py`

### Model and output

- [Prompt generation](https://github.com/agentera/agently/blob/main/agently/builtins/plugins/PromptGenerator/AgentlyPromptGenerator.py): `agently/builtins/plugins/PromptGenerator/AgentlyPromptGenerator.py`
- [Model request](https://github.com/agentera/agently/blob/main/agently/core/model/ModelRequest.py): `agently/core/model/ModelRequest.py`
- [Model providers](https://github.com/agentera/agently/tree/main/agently/builtins/plugins/ModelRequester): `agently/builtins/plugins/ModelRequester`
- [Structured output](https://github.com/agentera/agently/blob/main/agently/core/model/StructuredOutputParser.py): `agently/core/model/StructuredOutputParser.py`

### Actions and Skills

- [Action runtime](https://github.com/agentera/agently/blob/main/agently/core/operation/Action/ActionDispatcher.py): `agently/core/operation/Action/ActionDispatcher.py`
- [Action executors](https://github.com/agentera/agently/tree/main/agently/builtins/plugins/ActionExecutor): `agently/builtins/plugins/ActionExecutor`
- [Execution resources](https://github.com/agentera/agently/tree/main/agently/builtins/plugins/ExecutionResourceProvider): `agently/builtins/plugins/ExecutionResourceProvider`
- [Skill library](https://github.com/agentera/agently/blob/main/agently/core/application/SkillLibrary/SkillLibrary.py): `agently/core/application/SkillLibrary/SkillLibrary.py`

### Workflow orchestration

- [Task Board](https://github.com/agentera/agently/tree/main/agently/core/orchestration/TaskBoard): `agently/core/orchestration/TaskBoard`
- [Task DAG](https://github.com/agentera/agently/tree/main/agently/core/orchestration/TaskDAG): `agently/core/orchestration/TaskDAG`
- [Dynamic Task](https://github.com/agentera/agently/blob/main/agently/core/application/DynamicTask/DynamicTask.py): `agently/core/application/DynamicTask/DynamicTask.py`
- [TriggerFlow](https://github.com/agentera/agently/tree/main/agently/core/orchestration/TriggerFlow): `agently/core/orchestration/TriggerFlow`

### State and services

- [Task workspace](https://github.com/agentera/agently/blob/main/agently/core/TaskWorkspace/TaskWorkspace.py): `agently/core/TaskWorkspace/TaskWorkspace.py`
- [Record store](https://github.com/agentera/agently/blob/main/agently/core/storage/RecordStore.py): `agently/core/storage/RecordStore.py`
- [Runtime events](https://github.com/agentera/agently/blob/main/agently/core/runtime/EventCenter.py): `agently/core/runtime/EventCenter.py`
- [FastAPI integration](https://github.com/agentera/agently/blob/main/agently/integrations/fastapi.py): `agently/integrations/fastapi.py`

### Other components

- **Application**
- **Model service**

## Connections

- Application → Agently framework: creates runtime
- Agently framework → Agent: provides Agent
- Agent → Agent execution: starts run (evidence: `agently/builtins/plugins/AgentExecution/long_task/TaskShared.py`)
- Agent execution → Prompt generation: builds prompt
- Agent execution → Model request: issues request
- Model request → Model providers: routes request
- Model providers → Model service: sends request
- Model service → Model providers: returns response
- Model providers → Structured output: parses response
- Agent execution → Execution result: returns result
- Agent execution → Action runtime: invokes Actions
- Action runtime → Action executors: dispatches Actions
- Action executors → Execution resources: uses resources
- Agent execution → Skill library: binds Skills
- Agent execution → Task context: records evidence
- Application → Dynamic Task: creates task
- Dynamic Task → Task DAG: executes graph
- Agent execution → Task Board: uses strategy (evidence: `agently/builtins/plugins/AgentExecution/long_task/TaskShared.py`)
- Application → TriggerFlow: defines workflow
- Agent execution → Task workspace: delivers artifacts
- Agent → Record store: uses memory
- Agent execution → Runtime events: emits observations
- Application → FastAPI integration: exposes service
