Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,22 +69,32 @@ const result = await supervise(
### Improve an agent

`improve` optimizes one part of an agent and **only ships a change if it beats the current agent on tasks it never practiced on**.
It accepts prompt, skill document, tool, MCP, hook, subagent, workflow, rollout-policy, whole-profile, and code surfaces through one call.
Prompt and skill-document optimization have built-in generators; structured surfaces take an explicit generator, and code runs from isolated incumbent and candidate checkouts.
It accepts prompt, skill document, curated memory, tool, MCP, hook, subagent, workflow, rollout-policy, whole-profile, and code surfaces through one call.
Prompt, skill-document, memory, and rollout-policy optimization have built-in generators; structured surfaces take an explicit generator, and code runs from isolated incumbent and candidate checkouts.

```ts
import { improve } from '@tangle-network/agent-runtime'

const { profile, shipped, lift } = await improve(baseProfile, findings, {
surface: 'prompt', // or skills/tools/mcp/hooks/subagents/workflow/agent-profile/code
surface: 'prompt', // or skills/memory/tools/mcp/hooks/subagents/workflow/agent-profile/rollout-policy/code
gate: 'holdout', // certified on a held-back exam, never the practice set
scenarios, judge, agent, // how to measure a candidate
})
```

Curated memory is an external lesson document, not a knowledge store. Supply its current text and persist only the promoted winner:

```ts
await improve(baseProfile, findings, {
surface: 'memory',
memory: { document: currentLessons, writeBack: saveLessons },
scenarios, judge, agent,
})
```

### Improve a knowledge base

`runKnowledgeImprovementJob` is the runtime-owned front door for KB, wiki, memory-backed, and RAG improvement jobs. It creates a candidate copy, runs supervised agents against it, checks readiness through `@tangle-network/agent-knowledge`, measures spend and timing, and promotes only when the candidate passes.
`runKnowledgeImprovementJob` is the runtime-owned front door for KB, wiki, memory-backed, and RAG improvement jobs. It creates a candidate copy, runs supervised agents against it, checks readiness through `@tangle-network/agent-knowledge`, measures spend and timing, and promotes only when the candidate passes. Use `improve(..., { surface: 'memory' })` for the agent's curated lesson document; use this job for source, retrieval, and knowledge-store changes.

```ts
import { runKnowledgeImprovementJob } from '@tangle-network/agent-runtime/knowledge'
Expand Down
91 changes: 0 additions & 91 deletions docs/agent-optimization-map.md

This file was deleted.

Loading
Loading