# openjiuwen-ai/agent-core architecture

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

- Interactive diagram: https://gitdiagram.com/openjiuwen-ai/agent-core
- Repository: https://github.com/openjiuwen-ai/agent-core

## Overview

openJiuwen Core is a Python SDK and runtime for building LLM agents. A developer configures an agent and workflow; a user request enters the runtime, where an agent controller plans or advances workflow tasks, invokes model and tool capabilities, and returns a result. Sessions and context support continuity and interruption recovery. The README also highlights multi-agent/workflow orchestration, prompt optimization, and observability. Some links below reflect README-level capabilities rather than inspected call sites; source excerpts are partial, so uncertain internal wiring is omitted.

Main entry points: [`openjiuwen/core/application/llm_agent/llm_controller.py`](https://github.com/openjiuwen-ai/agent-core/blob/develop/openjiuwen/core/application/llm_agent/llm_controller.py) (ReAct Controller), [`openjiuwen/core/runner`](https://github.com/openjiuwen-ai/agent-core/tree/develop/openjiuwen/core/runner) (Agent Runtime), [`openjiuwen/core`](https://github.com/openjiuwen-ai/agent-core/tree/develop/openjiuwen/core) (Workflow Orchestration), [`openjiuwen/core/application`](https://github.com/openjiuwen-ai/agent-core/tree/develop/openjiuwen/core/application) (Agent Interfaces)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sdk["Agent SDK"]
  node_agent_api["Agent Interfaces"]
end

subgraph group_runtime["Execution Runtime"]
  node_react_controller["ReAct Controller<br/>[llm_controller.py]"]
  node_workflow["Workflow Orchestration"]
  node_runner["Agent Runtime"]
  node_model["LLM Invocation"]
  node_tools["Tool Calling"]
  node_streaming["Streaming Execution"]
  node_multi_agent["Multi-Agent Teams"]
end

subgraph group_state["Context and State"]
  node_context["Context Engine<br/>[context_engine.py]"]
  node_session["Session State"]
  node_checkpoint[("Checkpoint Recovery<br/>[storage.py]")]
end

subgraph group_devtools["Development Capabilities"]
  node_prompt_tools["Prompt Development"]
  node_prompt_optimizer["Prompt Optimization<br/>[service.py]"]
  node_observability["Observability"]
end

node_developer(("Developer"))
node_user(("User"))
node_llm_client["Model Provider"]

node_developer -->|"creates agent"| node_agent_api
node_user -->|"submits request"| node_runner
node_agent_api -->|"configures workflows"| node_workflow
node_runner -->|"runs agent"| node_react_controller
node_react_controller -->|"executes tasks"| node_workflow
node_react_controller -->|"creates context"| node_context
node_react_controller -.->|"plans tasks"| node_model
node_workflow -->|"invokes model"| node_model
node_workflow -->|"calls tools"| node_tools
node_runner -->|"streams execution"| node_streaming
node_context -->|"saves context"| node_session
node_session -->|"recovers state"| node_checkpoint
node_agent_api -->|"supports collaboration"| node_multi_agent
node_developer -->|"develops prompts"| node_prompt_tools
node_prompt_tools -.->|"optimizes prompts"| node_prompt_optimizer
node_model -.->|"uses provider"| node_llm_client
node_runner -.->|"traces execution"| node_observability

click node_agent_api "https://github.com/openjiuwen-ai/agent-core/tree/develop/openjiuwen/core/application"
click node_react_controller "https://github.com/openjiuwen-ai/agent-core/blob/develop/openjiuwen/core/application/llm_agent/llm_controller.py"
click node_workflow "https://github.com/openjiuwen-ai/agent-core/tree/develop/openjiuwen/core"
click node_runner "https://github.com/openjiuwen-ai/agent-core/tree/develop/openjiuwen/core/runner"
click node_model "https://github.com/openjiuwen-ai/agent-core/tree/develop/openjiuwen/core/foundation/llm"
click node_tools "https://github.com/openjiuwen-ai/agent-core/tree/develop/openjiuwen/core"
click node_streaming "https://github.com/openjiuwen-ai/agent-core/tree/develop/openjiuwen/core"
click node_context "https://github.com/openjiuwen-ai/agent-core/blob/develop/openjiuwen/core/context_engine/context_engine.py"
click node_session "https://github.com/openjiuwen-ai/agent-core/tree/develop/openjiuwen/core/session"
click node_checkpoint "https://github.com/openjiuwen-ai/agent-core/blob/develop/openjiuwen/extensions/checkpointer/redis/storage.py"
click node_multi_agent "https://github.com/openjiuwen-ai/agent-core/tree/develop/openjiuwen/agent_teams"
click node_prompt_tools "https://github.com/openjiuwen-ai/agent-core/tree/develop/openjiuwen/dev_tools"
click node_prompt_optimizer "https://github.com/openjiuwen-ai/agent-core/blob/develop/openjiuwen/dev_tools/tune/optimizer/prompt_search/service.py"
click node_observability "https://github.com/openjiuwen-ai/agent-core/tree/develop/openjiuwen/extensions/observability"

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_agent_api,node_user toneBlue
class node_react_controller,node_workflow,node_runner,node_model,node_tools,node_streaming,node_multi_agent toneAmber
class node_context,node_session,node_checkpoint toneMint
class node_prompt_tools,node_prompt_optimizer,node_observability toneRose
class node_developer,node_llm_client toneIndigo
```

## Components

### Agent SDK

- [Agent Interfaces](https://github.com/openjiuwen-ai/agent-core/tree/develop/openjiuwen/core/application): `openjiuwen/core/application`

### Execution Runtime

- [ReAct Controller](https://github.com/openjiuwen-ai/agent-core/blob/develop/openjiuwen/core/application/llm_agent/llm_controller.py): `openjiuwen/core/application/llm_agent/llm_controller.py`
- [Workflow Orchestration](https://github.com/openjiuwen-ai/agent-core/tree/develop/openjiuwen/core): `openjiuwen/core`
- [Agent Runtime](https://github.com/openjiuwen-ai/agent-core/tree/develop/openjiuwen/core/runner): `openjiuwen/core/runner`
- [LLM Invocation](https://github.com/openjiuwen-ai/agent-core/tree/develop/openjiuwen/core/foundation/llm): `openjiuwen/core/foundation/llm`
- [Tool Calling](https://github.com/openjiuwen-ai/agent-core/tree/develop/openjiuwen/core): `openjiuwen/core`
- [Streaming Execution](https://github.com/openjiuwen-ai/agent-core/tree/develop/openjiuwen/core): `openjiuwen/core`
- [Multi-Agent Teams](https://github.com/openjiuwen-ai/agent-core/tree/develop/openjiuwen/agent_teams): `openjiuwen/agent_teams`

### Context and State

- [Context Engine](https://github.com/openjiuwen-ai/agent-core/blob/develop/openjiuwen/core/context_engine/context_engine.py): `openjiuwen/core/context_engine/context_engine.py`
- [Session State](https://github.com/openjiuwen-ai/agent-core/tree/develop/openjiuwen/core/session): `openjiuwen/core/session`
- [Checkpoint Recovery](https://github.com/openjiuwen-ai/agent-core/blob/develop/openjiuwen/extensions/checkpointer/redis/storage.py): `openjiuwen/extensions/checkpointer/redis/storage.py`

### Development Capabilities

- [Prompt Development](https://github.com/openjiuwen-ai/agent-core/tree/develop/openjiuwen/dev_tools): `openjiuwen/dev_tools`
- [Prompt Optimization](https://github.com/openjiuwen-ai/agent-core/blob/develop/openjiuwen/dev_tools/tune/optimizer/prompt_search/service.py): `openjiuwen/dev_tools/tune/optimizer/prompt_search/service.py`
- [Observability](https://github.com/openjiuwen-ai/agent-core/tree/develop/openjiuwen/extensions/observability): `openjiuwen/extensions/observability`

### Other components

- **Developer**
- **User**
- **Model Provider**

## Connections

- Developer → Agent Interfaces: creates agent (evidence: `README.md`)
- User → Agent Runtime: submits request (evidence: `README.md`)
- Agent Interfaces → Workflow Orchestration: configures workflows (evidence: `README.md`)
- Agent Runtime → ReAct Controller: runs agent (evidence: `README.md`)
- ReAct Controller → Workflow Orchestration: executes tasks (evidence: `openjiuwen/core/application/llm_agent/llm_controller.py`)
- ReAct Controller → Context Engine: creates context (evidence: `openjiuwen/core/application/llm_agent/llm_controller.py`)
- ReAct Controller → LLM Invocation: plans tasks (evidence: `openjiuwen/core/application/llm_agent/llm_controller.py`)
- Workflow Orchestration → LLM Invocation: invokes model (evidence: `README.md`)
- Workflow Orchestration → Tool Calling: calls tools (evidence: `README.md`)
- Agent Runtime → Streaming Execution: streams execution (evidence: `README.md`)
- Context Engine → Session State: saves context (evidence: `openjiuwen/core/context_engine/context_engine.py`)
- Session State → Checkpoint Recovery: recovers state (evidence: `README.md`)
- Agent Interfaces → Multi-Agent Teams: supports collaboration (evidence: `README.md`)
- Developer → Prompt Development: develops prompts (evidence: `README.md`)
- Prompt Development → Prompt Optimization: optimizes prompts
- LLM Invocation → Model Provider: uses provider
- Agent Runtime → Observability: traces execution
