diff --git a/AI-Agent.md b/AI-Agent.md index 84968a3..01cd2f4 100644 --- a/AI-Agent.md +++ b/AI-Agent.md @@ -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. diff --git a/README.md b/README.md index 99cf5cf..5608a44 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/_docs/ARCHITECTURE.md b/_docs/ARCHITECTURE.md index b6910ad..861acd6 100644 --- a/_docs/ARCHITECTURE.md +++ b/_docs/ARCHITECTURE.md @@ -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. --- diff --git a/_docs/CAPABILITY GRAPH.md b/_docs/CAPABILITY GRAPH.md index 847bbc8..1a5046f 100644 --- a/_docs/CAPABILITY GRAPH.md +++ b/_docs/CAPABILITY GRAPH.md @@ -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 diff --git a/_docs/COMPONENTS.md b/_docs/COMPONENTS.md index 816c238..444ea24 100644 --- a/_docs/COMPONENTS.md +++ b/_docs/COMPONENTS.md @@ -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 ---