Agents and Orchestration¶
Kedi treats model execution as scoped agent configuration rather than a global string. A scope can select a framework or harness, model, reasoning effort, instructions, settings, tools, MCP servers, skills, approvals, and child agents.
Choose the language construct by who controls the next step:
| Construct | Who selects the next step? | What it provides |
|---|---|---|
| Procedure | The Kedi program | Explicit statements, arguments, return types, and captured configuration. |
| Profile | No execution by itself | Reusable configuration applied to later calls or used by a child agent. |
| Tool-using model call | The model, within the exposed tool surface | A request that may call tools before returning its result. |
| Subagent | The parent requests work; the child owns its conversation | An isolated task with its own profile and a bounded lifecycle. |
| Dynamic workflow | The parent writes orchestration code | Sandboxed composition of the permitted child agents. |
Start with a procedure when the sequence is known. Add a tool-using call where the model needs to choose an action. Use a child agent when a task needs a separate conversation and capability boundary, not merely a different prompt.
Framework Adapters and Agent Harnesses¶
Framework adapters embed Kedi's prompt and tool contracts in an agent framework:
pydanticdspylangchain
Agent harnesses drive a complete external coding/agent runtime:
claudecodexacp
Select the first group with > adapter: and the second with > agent:. These
are mutually exclusive backend kinds, not interchangeable aliases.
Active Agent State¶
Directives update immutable agent state for following calls in the lexical scope:
> adapter: pydantic
> model: openai:gpt-5.6-luna
> effort: low
> system: Use tools only when they improve factual accuracy.
Top-level state is captured by following procedures. A procedure-body override applies only to later calls in that invocation. When the scope exits, Kedi restores the previous state.
Profiles¶
Profiles name reusable state:
> profile: reviewer:
> adapter: pydantic
> model: openai:gpt-5.6-luna
> system: Review evidence before making a claim.
> use: reviewer
Profiles can be exported, imported, merged with later directives, and exposed as direct child subagents.
Capability Surfaces¶
- Procedures become typed tools through
> use:. > mcp:attaches external MCP tools.> skills:exposes scoped registry, project, and user skill discovery.> codemode: enabledprogressively discloses tools and executes hydrated calls in bounded code.> approval:controls risky tool calls.> hooks:observes, edits, or denies agent lifecycle boundaries.> subagent:adds bounded delegation tools to a profile.- semantic stream events expose completed commentary and final messages to terminals, UIs, and orchestration code without changing adapter results.
Each surface is capability-checked against the selected backend. Unsupported structured output is an execution error. Tools and MCP currently produce forward-compatible editor warnings where an adapter may gain support later.
Design Rule¶
Define the narrowest agent surface that can perform the task. Give profiles specific instructions, only required tools, bounded child agents, and the least permissive approval and sandbox settings. A broader model is not a substitute for a clear contract.
In This Section¶
Profiles and Configuration
Tools and Permissions
Lifecycle
Subagents and Workflows
- Subagents and Workflows
- Typed Child Results
- Foreground and Background Runs
- Limits, Isolation and Safety
- Continuations and Persistence
- Dynamic Workflows
- Python Embedding
- Reviewed Evidence Workflow
CodeMode