mirror of
https://github.com/larchanka/manbot.git
synced 2026-05-13 13:39:40 +00:00
docs: update architecture and capability graph to reflect agent-centric model
This commit is contained in:
@@ -91,7 +91,7 @@ AI-Agent/
|
||||
### Agent layer
|
||||
|
||||
- **Planner**: Listens for `plan.create`; uses Lemonade + Model Router to produce a DAG; validates with `validateGraph`; responds with plan.
|
||||
- **Executor**: Listens for `plan.execute`; computes ready nodes (parallel batch, concurrency limit); dispatches `node.execute` to `node.service` (model-router, rag-service, critic-agent, tool-host); waits for response by `correlationId`; updates Task Memory; after DAG, optional reflection loop (Critic → REVISE → re-run generation, max 3); aggregates result and completes task.
|
||||
- **Executor**: Listens for `plan.execute`; traverses the DAG and manages **Autonomous Agent Loops**; provides an agent system prompt and core tools; handles **Dynamic Skill Loading**; after DAG, optional reflection loop.
|
||||
- **Critic**: Listens for `reflection.evaluate`; uses Lemonade with Critic prompt; returns structured `{ decision: PASS|REVISE, feedback, score }`.
|
||||
|
||||
### Service layer
|
||||
@@ -121,7 +121,7 @@ AI-Agent/
|
||||
3. Core → Planner: `plan.create` (goal); Planner → Core: plan (DAG).
|
||||
4. Core → Task Memory: `task.create` (taskId, goal, nodes, edges).
|
||||
5. Core → Executor: `plan.execute` (taskId, plan, goal).
|
||||
6. Executor runs DAG: `node.execute` to model-router, rag-service, critic-agent, tool-host; Task Memory updates; optional Critic revision loop.
|
||||
6. Executor runs DAG: executes specialized **Agents** with instructions; Agents use tools and dynamically call `load_skill`; Task Memory updates; optional Critic revision loop.
|
||||
7. Executor → Core: response with aggregated result.
|
||||
8. Core → Telegram Adapter: `telegram.send` (chatId, text).
|
||||
9. User sees reply in Telegram.
|
||||
|
||||
@@ -13,7 +13,7 @@ A multi-process AI platform with type-safe IPC and capability-graph execution. U
|
||||
## Features
|
||||
|
||||
- **Multi-agent pipeline**: Planner → Task Memory → Executor → Critic (optional revision loop)
|
||||
- **Capability graph (DAG)**: Nodes for `generate_text`, `semantic_search`, `reflect`, `tool`; parallel execution where dependencies allow
|
||||
- **Capability graph (DAG)**: Nodes for specialized **Agents** and tool-agnostic LLM generation; parallel execution where dependencies allow
|
||||
- **Type-safe IPC**: JSONL over stdin/stdout with Zod-validated envelopes
|
||||
- **Conversation Memory**: Short-term memory (last 5 tasks) is injected into the Planner for immediate session context; `/new` resets the session and archives the conversation.
|
||||
- **Session-Scoped RAG**: Memory searches are session-scoped by default to prevent context leakage after `/new`, with an optional `global` scope.
|
||||
|
||||
@@ -47,13 +47,14 @@ Prevents chaotic reasoning loops.
|
||||
|
||||
## 4. Capability Graph Pattern
|
||||
|
||||
Planner produces a Directed Acyclic Graph (DAG):
|
||||
Planner produces a Directed Acyclic Graph (DAG) consisting of independent **Agents**:
|
||||
|
||||
Example:
|
||||
|
||||
semantic_search → sql_query → generate_text → reflect
|
||||
research_agent → coding_agent → testing_agent → analysis_agent
|
||||
|
||||
Executor processes nodes sequentially or parallel when possible.
|
||||
Nodes are now specialized autonomous agents that can dynamically load instructions (Skills) as needed.
|
||||
Executor processes these agent nodes sequentially or parallel when possible.
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -1,43 +1,41 @@
|
||||
# CAPABILITY GRAPH JSON FORMAT
|
||||
|
||||
## Execution Plan Structure
|
||||
|
||||
```
|
||||
```json
|
||||
{
|
||||
"taskId": "uuid",
|
||||
"complexity": "medium",
|
||||
"reflectionMode": "NORMAL",
|
||||
"nodes": [
|
||||
{
|
||||
"id": "node1",
|
||||
"type": "semantic_search",
|
||||
"service": "rag-service",
|
||||
"id": "research-01",
|
||||
"type": "agent",
|
||||
"service": "executor",
|
||||
"input": {
|
||||
"query": "scalable API architecture"
|
||||
"name": "Research Agent",
|
||||
"instructions": "Search for the latest F1 results using http_search."
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "node2",
|
||||
"id": "summary-01",
|
||||
"type": "agent",
|
||||
"service": "executor",
|
||||
"input": {
|
||||
"name": "Summary Agent",
|
||||
"instructions": "Summarize the research from {{research-01}} and load the 'email' skill to prepare a draft."
|
||||
},
|
||||
"dependsOn": ["research-01"]
|
||||
},
|
||||
{
|
||||
"id": "node-final",
|
||||
"type": "generate_text",
|
||||
"service": "model-router",
|
||||
"input": {
|
||||
"modelClass": "medium",
|
||||
"promptTemplate": "architecture_template",
|
||||
"dependsOn": ["node1"]
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "node3",
|
||||
"type": "reflect",
|
||||
"service": "critic-agent",
|
||||
"input": {
|
||||
"dependsOn": ["node2"]
|
||||
"prompt": "Construct final Telegram response: {{summary-01}}",
|
||||
"system_prompt": "analyzer"
|
||||
}
|
||||
}
|
||||
],
|
||||
"edges": [
|
||||
{ "from": "node1", "to": "node2" },
|
||||
{ "from": "node2", "to": "node3" }
|
||||
{ "from": "research-01", "to": "summary-01" },
|
||||
{ "from": "summary-01", "to": "node-final" }
|
||||
]
|
||||
}
|
||||
```
|
||||
@@ -65,8 +63,9 @@ interface CapabilityNode {
|
||||
|
||||
## Node types (model-router / Generator)
|
||||
|
||||
- **generate_text** — LLM generation; input: `modelClass`, optional `prompt`, context from dependencies.
|
||||
- **summarize** — Memory extraction from chat history; input: `chatHistory` (text). Uses dedicated summarizer system prompt. Used by Orchestrator for conversation archiving.
|
||||
- **agent** — Autonomous LLM loop; input: `name`, `instructions`. High-level strategic node that can use tools and dynamically call `load_skill`.
|
||||
- **generate_text** — Simple LLM generation; input: `prompt`, context from dependencies. Used for final consolidation.
|
||||
- **summarize** — Memory extraction from chat history; input: `chatHistory`.
|
||||
|
||||
## Graph Rules
|
||||
|
||||
|
||||
@@ -26,8 +26,8 @@ Responsibilities:
|
||||
Responsibilities:
|
||||
- Intent analysis
|
||||
- Capability determination
|
||||
- Execution graph creation
|
||||
- Model complexity selection
|
||||
- Creates an **Agent-based Execution Graph** (DAG)
|
||||
- Assigns specialized roles to agents (input: `name`, `instructions`)
|
||||
|
||||
Input:
|
||||
- User message
|
||||
@@ -41,10 +41,10 @@ Output:
|
||||
|
||||
### 3. Executor Agent
|
||||
Responsibilities:
|
||||
- Execute DAG nodes
|
||||
- Call services
|
||||
- Aggregate intermediate results
|
||||
- Update task memory
|
||||
- Traverses the DAG and manages **Autonomous Agent Loops**
|
||||
- Provides core tools (shell, browser, search) to agents
|
||||
- Handles **Dynamic Skill Loading** via `load_skill` tool
|
||||
- Aggregates results and updates task memory
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user