@cursor/july 0.1.4 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ab.d.ts +8 -95
- package/dist/ab.d.ts.map +1 -1
- package/dist/ab.js +9 -150
- package/dist/bin/agent-serve.js +14 -6
- package/dist/docs/404.html +2 -2
- package/dist/docs/ab.html +4 -4
- package/dist/docs/assets/{app.DF-Yx4OP.js → app.DMboGKUD.js} +1 -1
- package/dist/docs/assets/chunks/@localSearchIndexroot.O6eP7QZr.js +1 -0
- package/dist/docs/assets/chunks/{VPLocalSearchBox.DSeJSudL.js → VPLocalSearchBox.DkEqEnJU.js} +1 -1
- package/dist/docs/assets/chunks/{theme.DZVLTXOC.js → theme.ASugdMNm.js} +2 -2
- package/dist/docs/assets/deployment.md.BtfEsc9S.js +55 -0
- package/dist/docs/assets/deployment.md.BtfEsc9S.lean.js +1 -0
- package/dist/docs/assets/example-agents_approval-buddy.md.8R5phXb5.js +10 -0
- package/dist/docs/assets/example-agents_approval-buddy.md.8R5phXb5.lean.js +1 -0
- package/dist/docs/assets/example-agents_benny.md.B0gjhI-p.js +7 -0
- package/dist/docs/assets/example-agents_benny.md.B0gjhI-p.lean.js +1 -0
- package/dist/docs/assets/example-agents_bugbot.md.DelIdhxB.js +11 -0
- package/dist/docs/assets/example-agents_bugbot.md.DelIdhxB.lean.js +1 -0
- package/dist/docs/assets/example-agents_codebase-wiki.md.DC6sgwn0.js +8 -0
- package/dist/docs/assets/example-agents_codebase-wiki.md.DC6sgwn0.lean.js +1 -0
- package/dist/docs/assets/example-agents_codeowners-review.md.Ku_tG2RY.js +8 -0
- package/dist/docs/assets/example-agents_codeowners-review.md.Ku_tG2RY.lean.js +1 -0
- package/dist/docs/assets/example-agents_concierge.md.4rQTSMXt.js +23 -0
- package/dist/docs/assets/example-agents_concierge.md.4rQTSMXt.lean.js +1 -0
- package/dist/docs/assets/example-agents_fsd.md.CzgUrDfi.js +15 -0
- package/dist/docs/assets/example-agents_fsd.md.CzgUrDfi.lean.js +1 -0
- package/dist/docs/assets/example-agents_index.md.CRqJlnIf.js +2 -0
- package/dist/docs/assets/example-agents_index.md.CRqJlnIf.lean.js +1 -0
- package/dist/docs/assets/example-agents_knowledge-base.md.BPJiVueF.js +11 -0
- package/dist/docs/assets/example-agents_knowledge-base.md.BPJiVueF.lean.js +1 -0
- package/dist/docs/assets/example-agents_security-reviewer.md.D2rtwDTO.js +19 -0
- package/dist/docs/assets/example-agents_security-reviewer.md.D2rtwDTO.lean.js +1 -0
- package/dist/docs/assets/example-agents_slack-agent.md.buLbgvBf.js +5 -0
- package/dist/docs/assets/example-agents_slack-agent.md.buLbgvBf.lean.js +1 -0
- package/dist/docs/assets/example-agents_weather-agent.md.C9Qv-W0o.js +24 -0
- package/dist/docs/assets/example-agents_weather-agent.md.C9Qv-W0o.lean.js +1 -0
- package/dist/docs/assets/index.md.COiu-1jL.js +20 -0
- package/dist/docs/assets/{index.md.Cylk70gg.lean.js → index.md.COiu-1jL.lean.js} +1 -1
- package/dist/docs/assets/reference_cli.md.D189RBCH.js +60 -0
- package/dist/docs/assets/reference_cli.md.D189RBCH.lean.js +1 -0
- package/dist/docs/building-with-agents.html +4 -4
- package/dist/docs/concepts.html +4 -4
- package/dist/docs/deployment.html +58 -17
- package/dist/docs/evals.html +4 -4
- package/dist/docs/example-agents/approval-buddy.html +34 -0
- package/dist/docs/example-agents/benny.html +31 -0
- package/dist/docs/example-agents/bugbot.html +35 -0
- package/dist/docs/example-agents/codebase-wiki.html +32 -0
- package/dist/docs/example-agents/codeowners-review.html +32 -0
- package/dist/docs/example-agents/concierge.html +47 -0
- package/dist/docs/example-agents/fsd.html +39 -0
- package/dist/docs/example-agents/index.html +26 -0
- package/dist/docs/example-agents/knowledge-base.html +35 -0
- package/dist/docs/example-agents/security-reviewer.html +43 -0
- package/dist/docs/example-agents/slack-agent.html +29 -0
- package/dist/docs/example-agents/weather-agent.html +48 -0
- package/dist/docs/guides/agent-to-agent.html +4 -4
- package/dist/docs/guides/cloud-runtime.html +5 -5
- package/dist/docs/guides/github.html +4 -4
- package/dist/docs/guides/human-in-the-loop.html +4 -4
- package/dist/docs/guides/slack.html +4 -4
- package/dist/docs/guides/webhooks.html +4 -4
- package/dist/docs/hashmap.json +1 -1
- package/dist/docs/hillclimbing.html +4 -4
- package/dist/docs/index.html +7 -7
- package/dist/docs/quickstart.html +4 -4
- package/dist/docs/reference/agent-config.html +4 -4
- package/dist/docs/reference/channels.html +4 -4
- package/dist/docs/reference/cli.html +52 -30
- package/dist/docs/reference/connections.html +4 -4
- package/dist/docs/reference/hooks.html +4 -4
- package/dist/docs/reference/http-api.html +4 -4
- package/dist/docs/reference/instructions.html +4 -4
- package/dist/docs/reference/playground.html +4 -4
- package/dist/docs/reference/project-layout.html +4 -4
- package/dist/docs/reference/schedules.html +4 -4
- package/dist/docs/reference/sessions.html +4 -4
- package/dist/docs/reference/skills.html +4 -4
- package/dist/docs/reference/subagents.html +4 -4
- package/dist/docs/reference/tools.html +4 -4
- package/dist/docs/scaffolding-agents.html +4 -4
- package/dist/docs/storage.html +4 -4
- package/dist/docs/troubleshooting.html +4 -4
- package/dist/evals.d.ts +4 -61
- package/dist/evals.d.ts.map +1 -1
- package/dist/evals.js +3 -66
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/internal/ab-collector.d.ts +7 -5
- package/dist/internal/ab-collector.d.ts.map +1 -1
- package/dist/internal/ab-collector.js +3 -14
- package/dist/internal/ab-snapshot.d.ts +2 -4
- package/dist/internal/ab-snapshot.d.ts.map +1 -1
- package/dist/internal/cli-ax.d.ts +18 -3
- package/dist/internal/cli-ax.d.ts.map +1 -1
- package/dist/internal/cli-ax.js +80 -42
- package/dist/internal/cli-deploy.d.ts.map +1 -1
- package/dist/internal/cli-deploy.js +5 -2
- package/dist/internal/cursor-event-relay.d.ts +4 -1
- package/dist/internal/cursor-event-relay.d.ts.map +1 -1
- package/dist/internal/cursor-event-relay.js +6 -0
- package/dist/internal/cursor-relay-core.d.ts +36 -1
- package/dist/internal/cursor-relay-core.d.ts.map +1 -1
- package/dist/internal/cursor-relay-core.js +89 -8
- package/dist/internal/cursor-slack-relay.d.ts +2 -2
- package/dist/internal/cursor-slack-relay.d.ts.map +1 -1
- package/dist/internal/cursor-slack-relay.js +4 -0
- package/dist/internal/discovery.js +3 -3
- package/dist/internal/eval-run-store.d.ts +33 -30
- package/dist/internal/eval-run-store.d.ts.map +1 -1
- package/dist/internal/eval-run-store.js +84 -96
- package/dist/internal/init-project.d.ts.map +1 -1
- package/dist/internal/init-project.js +3 -2
- package/dist/internal/playground-proxy.d.ts +5 -5
- package/dist/internal/playground-proxy.js +3 -3
- package/dist/internal/resolve-prod-target.d.ts +30 -0
- package/dist/internal/resolve-prod-target.d.ts.map +1 -1
- package/dist/internal/resolve-prod-target.js +74 -2
- package/dist/internal/server.d.ts.map +1 -1
- package/dist/internal/server.js +5 -3
- package/dist/internal/session-engine.d.ts +1 -2
- package/dist/internal/session-engine.d.ts.map +1 -1
- package/dist/internal/session-engine.js +14 -31
- package/dist/internal/storage-coordinator.d.ts +16 -15
- package/dist/internal/storage-coordinator.d.ts.map +1 -1
- package/dist/internal/storage-coordinator.js +73 -80
- package/dist/playground/assets/cursor-icons-16-CQ50JpfO.woff2 +0 -0
- package/dist/playground/assets/index-7GJIUFQj.css +1 -0
- package/dist/playground/assets/index-mux9aj5P.js +319 -0
- package/dist/playground/index.html +2 -2
- package/dist/storage.d.ts +51 -10
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +27 -10
- package/docs/README.md +34 -5
- package/docs/deployment.md +352 -149
- package/docs/example-agents/approval-buddy.md +270 -0
- package/docs/example-agents/benny.md +186 -0
- package/docs/example-agents/bugbot.md +231 -0
- package/docs/example-agents/codebase-wiki.md +174 -0
- package/docs/example-agents/codeowners-review.md +195 -0
- package/docs/example-agents/concierge.md +205 -0
- package/docs/example-agents/fsd.md +330 -0
- package/docs/example-agents/index.md +102 -0
- package/docs/example-agents/knowledge-base.md +171 -0
- package/docs/example-agents/security-reviewer.md +296 -0
- package/docs/example-agents/slack-agent.md +146 -0
- package/docs/example-agents/weather-agent.md +302 -0
- package/docs/reference/cli.md +546 -147
- package/package.json +1 -1
- package/src/ab.ts +9 -261
- package/src/bin/agent-serve.ts +14 -6
- package/src/evals.ts +4 -118
- package/src/index.ts +2 -0
- package/src/internal/ab-collector.ts +12 -22
- package/src/internal/ab-snapshot.ts +2 -4
- package/src/internal/cli-ax.ts +101 -45
- package/src/internal/cli-deploy.ts +5 -2
- package/src/internal/cursor-event-relay.ts +10 -1
- package/src/internal/cursor-relay-core.ts +115 -9
- package/src/internal/cursor-slack-relay.ts +6 -2
- package/src/internal/discovery.ts +2 -2
- package/src/internal/eval-run-store.ts +86 -100
- package/src/internal/init-project.ts +3 -2
- package/src/internal/playground-proxy.ts +5 -5
- package/src/internal/resolve-prod-target.ts +101 -3
- package/src/internal/server.ts +5 -3
- package/src/internal/session-engine.ts +9 -29
- package/src/internal/storage-coordinator.ts +109 -101
- package/src/storage.ts +79 -14
- package/dist/docs/assets/chunks/@localSearchIndexroot.0XrheBv2.js +0 -1
- package/dist/docs/assets/deployment.md.DTKwE15Z.js +0 -14
- package/dist/docs/assets/deployment.md.DTKwE15Z.lean.js +0 -1
- package/dist/docs/assets/index.md.Cylk70gg.js +0 -20
- package/dist/docs/assets/reference_cli.md.Bv6pOxcF.js +0 -38
- package/dist/docs/assets/reference_cli.md.Bv6pOxcF.lean.js +0 -1
- package/dist/internal/json-dir-store.d.ts +0 -32
- package/dist/internal/json-dir-store.d.ts.map +0 -1
- package/dist/internal/json-dir-store.js +0 -100
- package/dist/playground/assets/cursor-icons-outline-BxTT_FVJ.woff2 +0 -0
- package/dist/playground/assets/index-Ct_Usdm8.css +0 -1
- package/dist/playground/assets/index-Dsyb-Vaj.js +0 -319
- package/src/internal/json-dir-store.ts +0 -109
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Hand PR triage to managed remote agents"
|
|
3
|
+
description: "Coordinate local chat, per-PR remote sessions, GitHub wake buffering, workflow MCP enrollment, durable affinity, findings, and reminders."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Hand PR triage to managed remote agents
|
|
7
|
+
|
|
8
|
+
The remote PR coordinator keeps chat and routing on the local serve host,
|
|
9
|
+
then hands each pull request to a managed remote agent with a real checkout.
|
|
10
|
+
The same remote conversation resumes when a user drives the PR again, GitHub
|
|
11
|
+
reports a change, or a merge-conflict reminder fires.
|
|
12
|
+
|
|
13
|
+
The workflow backend enrolls each remote run with a workflow MCP. Its tools
|
|
14
|
+
and the host's findings routes read and write the same external findings
|
|
15
|
+
service.
|
|
16
|
+
|
|
17
|
+
Use this example when repository work is too heavy or concurrent for local
|
|
18
|
+
worktrees, but the host should still own intake, session identity, policy, and
|
|
19
|
+
bookkeeping.
|
|
20
|
+
|
|
21
|
+
[Browse the current coordinator source.](../../examples/fsd/)
|
|
22
|
+
|
|
23
|
+
## Resume one remote agent across every PR wake
|
|
24
|
+
|
|
25
|
+
The coordinator uses a hybrid runtime:
|
|
26
|
+
|
|
27
|
+
- Ordinary playground and Slack chat run locally.
|
|
28
|
+
- The `drive_pr` server tool creates a remote session for one PR.
|
|
29
|
+
- The remote worker gets the repository and PR reference.
|
|
30
|
+
- An `agent.bound` hook records the remote run id and enrolls the run into a
|
|
31
|
+
workflow MCP.
|
|
32
|
+
- Webhooks and reminders resume the same remote agent through durable
|
|
33
|
+
PR-to-agent affinity.
|
|
34
|
+
|
|
35
|
+
No other example moves one logical conversation across local chat, remote
|
|
36
|
+
execution, event wakes, and timed follow-ups.
|
|
37
|
+
|
|
38
|
+
## Follow a chat request
|
|
39
|
+
|
|
40
|
+
1. A user asks local chat or Slack to drive a PR.
|
|
41
|
+
2. The root model calls `drive_pr` with the PR, mode, and optional hint.
|
|
42
|
+
3. The tool calls `ctx.send("drive", ...)` with a per-session `cloud` block
|
|
43
|
+
to attach the PR.
|
|
44
|
+
4. Agentkit creates or resumes the `drive` session keyed by
|
|
45
|
+
`pr:owner/repo#N`.
|
|
46
|
+
5. The remote runtime provisions the agent and emits `agent.bound`.
|
|
47
|
+
6. The enrollment hook writes PR affinity and calls the workflow backend to
|
|
48
|
+
attach run-scoped MCP tools.
|
|
49
|
+
7. `drive_pr` waits for remote binding, then returns the agent id and URL.
|
|
50
|
+
If binding exceeds its wait window, those fields can be `null` while work
|
|
51
|
+
continues.
|
|
52
|
+
8. The remote agent reads the host-prepared PR brief, checks unresolved state,
|
|
53
|
+
and records findings through the workflow MCP.
|
|
54
|
+
9. The host forwards a validated fallback output block when MCP wasn't
|
|
55
|
+
available for the turn.
|
|
56
|
+
|
|
57
|
+
The local chat agent doesn't have the target checkout, `gh`, `git`, or the
|
|
58
|
+
workflow MCP. Its job is coordination.
|
|
59
|
+
|
|
60
|
+
A request for a merged or closed PR finishes before provisioning. That result
|
|
61
|
+
has `status: "finished"` and no remote session.
|
|
62
|
+
|
|
63
|
+
## Map the framework features
|
|
64
|
+
|
|
65
|
+
| Capability | Source | Role |
|
|
66
|
+
| --- | --- | --- |
|
|
67
|
+
| Hybrid config | [`agent/agent.ts`](../../examples/fsd/agent/agent.ts) | Keep chat local, set remote-runtime defaults, disable automatic PR creation, and isolate local harness workspaces. |
|
|
68
|
+
| Root instructions | [`agent/instructions.md`](../../examples/fsd/agent/instructions.md) | Separate local coordination from remote triage and define suggest/apply policy. |
|
|
69
|
+
| Drive tool | [`agent/tools/drive_pr.ts`](../../examples/fsd/agent/tools/drive_pr.ts) | Hand a chat request to the `drive` channel and wait for remote binding. |
|
|
70
|
+
| Drive channel | [`agent/channels/drive.ts`](../../examples/fsd/agent/channels/drive.ts) | Start remote work and expose findings read/write routes. |
|
|
71
|
+
| GitHub channel | [`agent/channels/github.ts`](../../examples/fsd/agent/channels/github.ts) | Buffer PR, comment, review, check, and status wakes. |
|
|
72
|
+
| Slack channel | [`agent/channels/slack.ts`](../../examples/fsd/agent/channels/slack.ts) | Route Slack requests to the local coordinator. |
|
|
73
|
+
| Hooks | [`agent/hooks/enroll-fsd.ts`](../../examples/fsd/agent/hooks/enroll-fsd.ts), [`agent/hooks/record-outputs.ts`](../../examples/fsd/agent/hooks/record-outputs.ts) | Bind remote identity, enroll MCP, and forward fallback findings. |
|
|
74
|
+
| Affinity and buffering | [`agent/lib/pr-affinity.ts`](../../examples/fsd/agent/lib/pr-affinity.ts), [`agent/lib/webhook-buffer.ts`](../../examples/fsd/agent/lib/webhook-buffer.ts) | Persist PR identity, sticky mode, and pending wakes. |
|
|
75
|
+
| Reminders | [`agent/lib/merge-conflict-watch.ts`](../../examples/fsd/agent/lib/merge-conflict-watch.ts) | Recheck merge conflicts every 30 minutes. |
|
|
76
|
+
| Workflow client | [`agent/lib/fsd-platform.ts`](../../examples/fsd/agent/lib/fsd-platform.ts) | Enroll external runs and read or record findings. |
|
|
77
|
+
|
|
78
|
+
The coordinator has no authored skill, subagent, MCP connection, static
|
|
79
|
+
schedule, A/B experiment, eval, custom storage definition, or tool approval.
|
|
80
|
+
|
|
81
|
+
The workflow MCP is dynamic. Backend enrollment attaches it to the remote run,
|
|
82
|
+
so there is no file under `agent/mcp-connections/`.
|
|
83
|
+
|
|
84
|
+
## Understand local and remote workspaces
|
|
85
|
+
|
|
86
|
+
The root config sets `runtime: "local"` because `drive_pr` is a server tool.
|
|
87
|
+
It also supplies remote-runtime defaults through the `cloud` configuration:
|
|
88
|
+
|
|
89
|
+
```ts
|
|
90
|
+
local: {
|
|
91
|
+
cwd: join(homedir(), ".cache", "agent-serve", "fsd"),
|
|
92
|
+
},
|
|
93
|
+
cloud: {
|
|
94
|
+
env: { type: "cloud" },
|
|
95
|
+
autoCreatePR: false,
|
|
96
|
+
},
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
The local cwd sits outside the monorepo, so inherited repository instructions
|
|
100
|
+
don't affect coordinator chat.
|
|
101
|
+
|
|
102
|
+
Remote sessions get a repository attachment with the target PR. The worker starts
|
|
103
|
+
from the PR base and creates an automation side branch from the PR head only when
|
|
104
|
+
code context or a fix is needed. The serve host never checks out target code.
|
|
105
|
+
|
|
106
|
+
## Prepare access
|
|
107
|
+
|
|
108
|
+
You need:
|
|
109
|
+
|
|
110
|
+
- Node 22.13 or newer.
|
|
111
|
+
- An agent-runtime user credential.
|
|
112
|
+
- Access to a managed remote runtime.
|
|
113
|
+
- Access to the target GitHub PR.
|
|
114
|
+
- Access to the workflow backend and findings store.
|
|
115
|
+
|
|
116
|
+
Keep the affinity and webhook-buffer files on durable storage for a
|
|
117
|
+
long-lived host.
|
|
118
|
+
|
|
119
|
+
## Validate without starting remote work
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
agentkit validate --dir examples/fsd
|
|
123
|
+
agentkit info --dir examples/fsd --json
|
|
124
|
+
agentkit github events --dir examples/fsd --json
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
These commands inspect discovery and declared GitHub events. They don't
|
|
128
|
+
provision a remote agent.
|
|
129
|
+
|
|
130
|
+
## Choose suggest or apply
|
|
131
|
+
|
|
132
|
+
Every PR has a sticky mode:
|
|
133
|
+
|
|
134
|
+
| Mode | Required remote behavior |
|
|
135
|
+
| --- | --- |
|
|
136
|
+
| `suggest` | May create verified commits on the VM's local side branch. Instructions require no pushes, comments, PR edits, or workflow actions. Records exact fixes and actions as findings for the owner. |
|
|
137
|
+
| `apply` | Pushes verified fixes to the existing PR head and may update metadata, reply to threads, mark a draft ready, rebase, or rerun CI. |
|
|
138
|
+
|
|
139
|
+
The remote instructions forbid merging, enabling auto-merge, force-pushing,
|
|
140
|
+
and opening a new PR in both modes. `autoCreatePR: false` also disables the
|
|
141
|
+
SDK's automatic PR creation. The other restrictions are prompt policy, not a
|
|
142
|
+
deterministic host gate. `suggest` is the default.
|
|
143
|
+
|
|
144
|
+
The selected mode is stored beside PR affinity. Webhooks and reminders reuse
|
|
145
|
+
it. Re-driving a PR can change the host-side mode. Backend enrollment records
|
|
146
|
+
the mode at first enrollment, so each later host prompt repeats the current
|
|
147
|
+
authoritative mode.
|
|
148
|
+
|
|
149
|
+
> [!CAUTION]
|
|
150
|
+
> `apply` writes to the user's PR branch and triggers CI. Use `suggest` for
|
|
151
|
+
> development. Both modes provision a billed remote agent and can write
|
|
152
|
+
> structured findings to the findings service. `drive_pr` has no approval gate,
|
|
153
|
+
> and suggest/apply restrictions depend on the remote agent following its
|
|
154
|
+
> instructions.
|
|
155
|
+
|
|
156
|
+
## Start a suggest-mode drive
|
|
157
|
+
|
|
158
|
+
Run the host:
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
agentkit dev examples/fsd
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
From chat:
|
|
165
|
+
|
|
166
|
+
> Drive https://github.com/owner/repo/pull/123 in suggest mode.
|
|
167
|
+
|
|
168
|
+
Or call the coordinator tool:
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
agentkit call drive_pr \
|
|
172
|
+
--dir examples/fsd \
|
|
173
|
+
--input '{"pr":"https://github.com/owner/repo/pull/123","mode":"suggest"}'
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
For an open PR, the tool waits up to 60 seconds for remote binding and returns:
|
|
177
|
+
|
|
178
|
+
- the normalized PR label,
|
|
179
|
+
- session and continuation ids,
|
|
180
|
+
- the remote-agent id and URL when binding completes in that window,
|
|
181
|
+
- `status: "started"`, and
|
|
182
|
+
- the merge-conflict reminder id.
|
|
183
|
+
|
|
184
|
+
It doesn't wait for findings. A slow binding can return `null` identifiers.
|
|
185
|
+
Open the returned agent URL when present to follow the remote run.
|
|
186
|
+
|
|
187
|
+
## Use the HTTP drive surface
|
|
188
|
+
|
|
189
|
+
The custom channel starts the same orchestration:
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
curl -s -X POST \
|
|
193
|
+
http://127.0.0.1:3000/fsd/v1/channels/drive/ \
|
|
194
|
+
-H 'content-type: application/json' \
|
|
195
|
+
-d '{"pr":"owner/repo#123","mode":"suggest"}'
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
This route returns as soon as the channel session exists. The remote-agent id
|
|
199
|
+
can still be `null` at that point. Triage continues in the background.
|
|
200
|
+
|
|
201
|
+
Read findings later:
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
curl -s \
|
|
205
|
+
'http://127.0.0.1:3000/fsd/v1/channels/drive/findings?pr=owner/repo%23123'
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
The external findings service is the source of truth. The local host doesn't keep a second
|
|
209
|
+
findings database.
|
|
210
|
+
|
|
211
|
+
The channel also exposes `POST /findings` as a testing surface. It validates
|
|
212
|
+
outputs, then writes them to the findings service for a PR already bound by this
|
|
213
|
+
host. The route has no approval gate. Keep it under the default loopback auth
|
|
214
|
+
or another trusted boundary.
|
|
215
|
+
|
|
216
|
+
## Keep one remote agent per PR
|
|
217
|
+
|
|
218
|
+
Within the `drive` channel, the stable continuation token
|
|
219
|
+
`pr:owner/repo#N` resumes the same session. GitHub sessions are scoped to
|
|
220
|
+
another channel, so a continuation token alone can't bridge them.
|
|
221
|
+
|
|
222
|
+
The enrollment hook closes that gap:
|
|
223
|
+
|
|
224
|
+
1. Read the PR from the continuation token or host-authored session title.
|
|
225
|
+
2. Record PR to `sdkAgentId` affinity after `agent.bound`.
|
|
226
|
+
3. Seed later sessions with the same remote id.
|
|
227
|
+
4. Retry workflow MCP enrollment after a completed turn when the first RPC
|
|
228
|
+
failed.
|
|
229
|
+
|
|
230
|
+
This lets Slack, HTTP drive, GitHub, and reminders talk to one remote
|
|
231
|
+
conversation without sharing one channel session.
|
|
232
|
+
|
|
233
|
+
## Buffer GitHub wakes
|
|
234
|
+
|
|
235
|
+
The GitHub channel handles pull requests, comments, reviews, check suites,
|
|
236
|
+
check runs, and selected status events. It doesn't send payload details to the
|
|
237
|
+
model. It asks the remote agent to refresh live source of truth.
|
|
238
|
+
|
|
239
|
+
The buffer:
|
|
240
|
+
|
|
241
|
+
- groups events by PR,
|
|
242
|
+
- waits three seconds for a burst to settle,
|
|
243
|
+
- re-buffers while CI settles,
|
|
244
|
+
- skips a flush when the PR session is busy,
|
|
245
|
+
- tries to write its snapshot before acknowledging a wake, and
|
|
246
|
+
- restores pending entries when the channel starts.
|
|
247
|
+
|
|
248
|
+
Closing a PR discards its pending entry and cancels its reminders.
|
|
249
|
+
|
|
250
|
+
Snapshot persistence is best-effort. Write failures are swallowed silently,
|
|
251
|
+
so a delivery can still be acknowledged without a durable snapshot.
|
|
252
|
+
|
|
253
|
+
This is the high-volume counterpart to a direct `{ auth }` GitHub wake. See
|
|
254
|
+
[GitHub](../guides/github.md#handle-high-event-volume) for the reusable
|
|
255
|
+
pattern.
|
|
256
|
+
|
|
257
|
+
## Add merge-conflict checks
|
|
258
|
+
|
|
259
|
+
Starting a drive arms one recurring reminder per PR. Every 30 minutes the host
|
|
260
|
+
checks mergeability:
|
|
261
|
+
|
|
262
|
+
- closed or merged stops the reminder,
|
|
263
|
+
- clean skips delivery,
|
|
264
|
+
- conflicting sends a follow-up to the owning session, and
|
|
265
|
+
- a busy session skips the wake.
|
|
266
|
+
|
|
267
|
+
This uses runtime reminders, not a static `agent/schedules/` file. The host
|
|
268
|
+
creates, lists, replaces, and cancels reminders through `host.reminders`.
|
|
269
|
+
Development mode doesn't fire reminder timers automatically. Dispatch one
|
|
270
|
+
through the dev reminder endpoint for a manual proof, or use non-dev `serve`
|
|
271
|
+
to run the 30-minute cadence.
|
|
272
|
+
|
|
273
|
+
The reminder's `run` handler lives in memory. After a host restart, agentkit
|
|
274
|
+
disarms it with `handler_lost_on_restart`; a later drive or webhook path can
|
|
275
|
+
arm a fresh handler. Persisted reminder metadata alone doesn't keep the check
|
|
276
|
+
running.
|
|
277
|
+
|
|
278
|
+
## Record findings with MCP or a fallback
|
|
279
|
+
|
|
280
|
+
After enrollment, the remote agent receives workflow tools for:
|
|
281
|
+
|
|
282
|
+
- recording and updating outputs,
|
|
283
|
+
- listing current outputs,
|
|
284
|
+
- reading PR metadata,
|
|
285
|
+
- reading CI state, and
|
|
286
|
+
- reading review comments.
|
|
287
|
+
|
|
288
|
+
The main output is a structured workflow suggestion or code-change reference.
|
|
289
|
+
The remote prompt requires findings as soon as each action becomes clear.
|
|
290
|
+
|
|
291
|
+
If enrollment races or MCP is unavailable, the agent writes one fenced
|
|
292
|
+
fallback JSON block. The host validates allowed kinds, actions, statuses, and
|
|
293
|
+
the 140-character finding body before forwarding it to the same findings
|
|
294
|
+
service. The output hook catches fallback blocks from webhook and reminder
|
|
295
|
+
turns.
|
|
296
|
+
|
|
297
|
+
## Verify the host logic
|
|
298
|
+
|
|
299
|
+
The coordinator has no filesystem evals. Its unit tests cover mode parsing, drive
|
|
300
|
+
orchestration, affinity, webhook durability, CI settlement, output parsing,
|
|
301
|
+
reminders, and Slack configuration:
|
|
302
|
+
|
|
303
|
+
```bash
|
|
304
|
+
pnpm exec vitest run examples/fsd/agent/lib
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
Use those tests for host policy. Use a dedicated test PR and suggest mode for
|
|
308
|
+
the end-to-end remote path.
|
|
309
|
+
|
|
310
|
+
## Build another hybrid coordinator
|
|
311
|
+
|
|
312
|
+
Use this architecture when each work item needs a real checkout:
|
|
313
|
+
|
|
314
|
+
1. Keep conversational intake local.
|
|
315
|
+
2. Open a remote session only after the request identifies a work item.
|
|
316
|
+
3. Give the work item a stable continuation key.
|
|
317
|
+
4. Persist its remote-agent id for cross-channel resume.
|
|
318
|
+
5. Coalesce noisy events before spending another turn.
|
|
319
|
+
6. Put the current mode and permissions in every host prompt.
|
|
320
|
+
7. Record outputs incrementally in a durable sink.
|
|
321
|
+
8. Add reminders for state requiring periodic rechecks.
|
|
322
|
+
|
|
323
|
+
## Where to go next
|
|
324
|
+
|
|
325
|
+
- [Cloud runtime](../guides/cloud-runtime.md)
|
|
326
|
+
- [GitHub](../guides/github.md)
|
|
327
|
+
- [Webhooks and custom channels](../guides/webhooks.md)
|
|
328
|
+
- [Schedules and reminders](../reference/schedules.md)
|
|
329
|
+
- [Sessions and streaming](../reference/sessions.md)
|
|
330
|
+
- [Deployment](../deployment.md)
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Choose the right agentkit example"
|
|
3
|
+
description: "Compare all eleven example agents by runtime, channels, tools, state, and the framework pattern each one teaches."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Choose the right agentkit example
|
|
7
|
+
|
|
8
|
+
The examples progress from one-channel assistants to durable, event-driven
|
|
9
|
+
workflows. Start with the smallest agent for your use case. Each guide
|
|
10
|
+
explains its request flow, framework features, verification path, and reusable
|
|
11
|
+
design.
|
|
12
|
+
|
|
13
|
+
The source projects live under
|
|
14
|
+
[`examples/`](../../examples/). Run the commands below from
|
|
15
|
+
`packages/agent-serve`. See [Run the CLI](../README.md#run-the-cli) if the
|
|
16
|
+
`agentkit` command isn't installed.
|
|
17
|
+
|
|
18
|
+
## Compare the examples
|
|
19
|
+
|
|
20
|
+
| Agent | Runtime | Intake | Framework focus | What sets it apart |
|
|
21
|
+
| --- | --- | --- | --- | --- |
|
|
22
|
+
| [Weather agent](./weather-agent.md) | Local | HTTP and two Slack transports | Tools, stdio MCP, approvals, skill, subagent, schedule, hook, A/B, and evals | It demonstrates the broad local-runtime surface in one domain. |
|
|
23
|
+
| [Slack agent](./slack-agent.md) | Local | Account-linked Slack | Channel identity, threads, and suggested prompts | It reaches Slack without authored tools. |
|
|
24
|
+
| [Concierge](./concierge.md) | Local | Built-in HTTP | Peer MCP and multi-agent serving | It delegates to a separate agent with its own tools, sessions, and context. |
|
|
25
|
+
| [Playbook router](./benny.md) | Local with repo context | Two Slack transports | Channel watching, inherited skills, custom cwd, and an eval | An allowlisted Slack channel becomes an intake queue for repo playbooks. |
|
|
26
|
+
| [PR evidence reviewer](./bugbot.md) | Local | Custom HTTP and Slack | Host tool, skill, seeded workspaces, and an eval | The model receives a prepared diff-first evidence tree instead of a checkout. |
|
|
27
|
+
| [Approval Buddy](./approval-buddy.md) | Local | GitHub and Slack | Policy tools, two subagents, durable storage, and evals | Code decides whether a PR may be approved. Reviews stay informational. |
|
|
28
|
+
| [Security Reviewer](./security-reviewer.md) | Local host pipeline | GitHub and chat | Staged tools, parallel SDK agents, progress UI, durable storage, A/B, and evals | Reviewers and triage overlap while the playground shows every stage. |
|
|
29
|
+
| [Remote PR coordinator](./fsd.md) | Local coordinator and remote PR sessions | HTTP, GitHub, and Slack | Remote handoff, hooks, affinity, buffering, reminders, and workflow MCP | One remote conversation follows a PR across chat, webhooks, and timed wakes. |
|
|
30
|
+
| [Knowledge base](./knowledge-base.md) | Local | Built-in HTTP chat | Durable host-side state, a conventions skill, a schedule, unit tests, and evals | People curate shared facts in chat, and fresh sessions retrieve them from markdown. |
|
|
31
|
+
| [Codebase wiki](./codebase-wiki.md) | Local | GitHub and chat | Task-dispatch webhooks, seeded digests, a mapping skill, a schedule, and evals | Merged PRs accumulate into per-feature wiki pages with a daily digest. |
|
|
32
|
+
| [Codeowners review](./codeowners-review.md) | Local | GitHub, chat, and fixtures | Ownership routing in code, playbook data files, parallel subagents, and evals | Each product area reviews with its own playbook, and verdicts aggregate mechanically. |
|
|
33
|
+
|
|
34
|
+
## Pick a learning path
|
|
35
|
+
|
|
36
|
+
Use this order when you want to learn agentkit one capability at a time:
|
|
37
|
+
|
|
38
|
+
1. Start with [Weather agent](./weather-agent.md) to explore the filesystem
|
|
39
|
+
conventions and local runtime.
|
|
40
|
+
2. Strip the project back to [Slack agent](./slack-agent.md) to see the
|
|
41
|
+
minimum channel surface.
|
|
42
|
+
3. Read [Playbook router](./benny.md) when Slack should route requests into repo
|
|
43
|
+
playbooks.
|
|
44
|
+
4. Add composition with [Concierge](./concierge.md).
|
|
45
|
+
5. Study [PR evidence reviewer](./bugbot.md) before giving a model repository
|
|
46
|
+
evidence.
|
|
47
|
+
6. Move policy into code with [Approval Buddy](./approval-buddy.md).
|
|
48
|
+
7. Compare [Security Reviewer](./security-reviewer.md) and
|
|
49
|
+
[Remote PR coordinator](./fsd.md) for host-side versus remote PR work.
|
|
50
|
+
8. See parallel subagent delegation carry team judgment in
|
|
51
|
+
[Codeowners review](./codeowners-review.md).
|
|
52
|
+
9. Curate team context through conversation with
|
|
53
|
+
[Knowledge base](./knowledge-base.md), then let GitHub events maintain
|
|
54
|
+
product documentation in [Codebase wiki](./codebase-wiki.md).
|
|
55
|
+
|
|
56
|
+
## Common prerequisites
|
|
57
|
+
|
|
58
|
+
All examples require:
|
|
59
|
+
|
|
60
|
+
- Node 22.13 or newer. Don't run agentkit under Bun.
|
|
61
|
+
- Workspace dependencies installed.
|
|
62
|
+
- An agent-runtime credential for model turns.
|
|
63
|
+
|
|
64
|
+
Several examples need more:
|
|
65
|
+
|
|
66
|
+
- Account-linked Slack channels require a connected host account.
|
|
67
|
+
- GitHub examples require access to the target repository. Codebase wiki and
|
|
68
|
+
Codeowners review call the host `gh` CLI for PR data; the codeowners
|
|
69
|
+
fixtures run without network.
|
|
70
|
+
- Approval Buddy and Security Reviewer define custom durable session storage.
|
|
71
|
+
- Remote PR coordinator starts remote agent sessions and needs access to its
|
|
72
|
+
workflow backend.
|
|
73
|
+
|
|
74
|
+
Each guide lists its own credentials, services, and side effects.
|
|
75
|
+
|
|
76
|
+
## Validate any example
|
|
77
|
+
|
|
78
|
+
Discovery commands don't start a model turn:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
agentkit validate --dir examples/weather-agent
|
|
82
|
+
agentkit info --dir examples/weather-agent --json
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Start one development server with `agentkit dev examples/<name>`.
|
|
86
|
+
Concierge depends on Weather agent, so its guide creates an isolated
|
|
87
|
+
two-project mount. Don't mount the whole examples directory to test one
|
|
88
|
+
agent; several advanced examples subscribe to live GitHub events.
|
|
89
|
+
|
|
90
|
+
## Read by framework feature
|
|
91
|
+
|
|
92
|
+
- [Concepts](../concepts.md) explains filesystem discovery and runtime
|
|
93
|
+
boundaries.
|
|
94
|
+
- [Project layout](../reference/project-layout.md) lists every authored
|
|
95
|
+
folder.
|
|
96
|
+
- [Tools](../reference/tools.md), [channels](../reference/channels.md), and
|
|
97
|
+
[MCP connections](../reference/connections.md) cover the core extension
|
|
98
|
+
points.
|
|
99
|
+
- [Evals](../evals.md) and [live A/B metrics](../ab.md) cover measured
|
|
100
|
+
iteration.
|
|
101
|
+
- [Deployment](../deployment.md) covers credentials, auth, storage, and
|
|
102
|
+
hosting.
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Build a team knowledge base through conversation"
|
|
3
|
+
description: "Teach an agent about people, systems, decisions, and preferences; store that knowledge as markdown and retrieve it in fresh sessions."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Build a team knowledge base through conversation
|
|
7
|
+
|
|
8
|
+
Knowledge base turns conversations into shared team context. Teach the agent
|
|
9
|
+
about people, systems, decisions, and standing preferences. Three server
|
|
10
|
+
tools read, search, and write human-readable markdown pages; a conventions
|
|
11
|
+
skill shapes each write; and a daily schedule merges duplicates and rebuilds
|
|
12
|
+
the index. A fresh session retrieves what an earlier conversation captured.
|
|
13
|
+
|
|
14
|
+
Use this project when people should curate organizational knowledge through
|
|
15
|
+
chat. Use [Codebase wiki](./codebase-wiki.md) when merged PRs should maintain
|
|
16
|
+
feature documentation instead.
|
|
17
|
+
|
|
18
|
+
[Browse the knowledge base source.](../../examples/knowledge-base/)
|
|
19
|
+
|
|
20
|
+
## Keep shared knowledge on the filesystem
|
|
21
|
+
|
|
22
|
+
The knowledge base lives outside any session workspace, in
|
|
23
|
+
`.agent-serve/wiki/` by default. `KNOWLEDGE_BASE_DIR` overrides the location,
|
|
24
|
+
and the tools resolve it on every call, so tests and evals can point the same
|
|
25
|
+
code at a temp directory.
|
|
26
|
+
|
|
27
|
+
The store enforces its own safety:
|
|
28
|
+
|
|
29
|
+
- Page ids are one to three lowercase kebab-case segments, so a page id
|
|
30
|
+
can't escape the wiki directory.
|
|
31
|
+
- Pages cap at 64 KiB. Oversized writes fail with instructions to split
|
|
32
|
+
the page.
|
|
33
|
+
- `wiki_write` replaces whole pages. The instructions require reading a
|
|
34
|
+
page before updating it, so rewrites carry existing facts forward.
|
|
35
|
+
|
|
36
|
+
Every page is plain markdown. You can open the wiki in an editor,
|
|
37
|
+
review it in a PR, or grep it.
|
|
38
|
+
|
|
39
|
+
## Follow a fact through the agent
|
|
40
|
+
|
|
41
|
+
1. You tell the agent something durable: a system, an owner, a standing
|
|
42
|
+
preference.
|
|
43
|
+
2. The instructions require a `wiki_search` before claiming knowledge
|
|
44
|
+
and a `wiki_write` after learning something worth keeping.
|
|
45
|
+
3. The `wiki-conventions` skill picks the page id (`staging-database`,
|
|
46
|
+
`people/jane-doe`), the page shape, and the dated fact format.
|
|
47
|
+
4. The tool writes the page under the durable wiki root and returns
|
|
48
|
+
whether it created or updated the page.
|
|
49
|
+
5. A later session, on any channel, finds the fact with `wiki_search`
|
|
50
|
+
and cites the knowledge-base page in its answer.
|
|
51
|
+
|
|
52
|
+
Ephemeral chatter stays out. The instructions tell the model to skip
|
|
53
|
+
one-off questions and to ask before saving anything borderline.
|
|
54
|
+
|
|
55
|
+
## Map the knowledge-base files
|
|
56
|
+
|
|
57
|
+
| File | Purpose |
|
|
58
|
+
| --- | --- |
|
|
59
|
+
| [`agent/agent.ts`](../../examples/knowledge-base/agent/agent.ts) | Selects the cloud runtime and model. |
|
|
60
|
+
| [`agent/instructions.md`](../../examples/knowledge-base/agent/instructions.md) | Sets the read-before-answer and save-after-learning policy. |
|
|
61
|
+
| [`agent/lib/wiki-store.ts`](../../examples/knowledge-base/agent/lib/wiki-store.ts) | Validates page ids, lists, reads, writes, and searches the knowledge base. |
|
|
62
|
+
| [`agent/tools/wiki_read.ts`](../../examples/knowledge-base/agent/tools/wiki_read.ts) | Reads one page or lists every page with titles and timestamps. |
|
|
63
|
+
| [`agent/tools/wiki_search.ts`](../../examples/knowledge-base/agent/tools/wiki_search.ts) | Searches titles and bodies with per-page match lines. |
|
|
64
|
+
| [`agent/tools/wiki_write.ts`](../../examples/knowledge-base/agent/tools/wiki_write.ts) | Creates or replaces a page and reports created versus updated. |
|
|
65
|
+
| [`agent/skills/wiki-conventions.md`](../../examples/knowledge-base/agent/skills/wiki-conventions.md) | Names pages, shapes them, and dates every fact. |
|
|
66
|
+
| [`agent/schedules/gardener.md`](../../examples/knowledge-base/agent/schedules/gardener.md) | Merges duplicates, rebuilds the index, and flags stale facts daily. |
|
|
67
|
+
| [`agent/lib/wiki-store.test.ts`](../../examples/knowledge-base/agent/lib/wiki-store.test.ts) | Unit-tests slug safety and store round-trips. |
|
|
68
|
+
| [`evals/knowledge.eval.ts`](../../examples/knowledge-base/evals/knowledge.eval.ts) | Seeds a temp knowledge base and gates recall, save, and no-write decisions. |
|
|
69
|
+
|
|
70
|
+
There is no authored channel, MCP connection, subagent, hook, A/B
|
|
71
|
+
experiment, or custom storage. The wiki directory is the durable state.
|
|
72
|
+
|
|
73
|
+
## Prepare the example
|
|
74
|
+
|
|
75
|
+
You need:
|
|
76
|
+
|
|
77
|
+
- Node 22.13 or newer.
|
|
78
|
+
- An agent-runtime credential for model turns.
|
|
79
|
+
|
|
80
|
+
Nothing else. The wiki is created on first write.
|
|
81
|
+
|
|
82
|
+
## Validate the surface
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
agentkit validate --dir examples/knowledge-base
|
|
86
|
+
agentkit info --dir examples/knowledge-base --json
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
The manifest should report three server tools, one skill, and one
|
|
90
|
+
schedule.
|
|
91
|
+
|
|
92
|
+
## Exercise the store without a model turn
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
agentkit call wiki_write \
|
|
96
|
+
--dir examples/knowledge-base \
|
|
97
|
+
--input '{"page":"staging-database","content":"# Staging database\n\n- Port: 6432 (recorded 2026-07-19)\n"}'
|
|
98
|
+
|
|
99
|
+
agentkit call wiki_search \
|
|
100
|
+
--dir examples/knowledge-base \
|
|
101
|
+
--input '{"query":"6432"}'
|
|
102
|
+
|
|
103
|
+
agentkit call wiki_read --dir examples/knowledge-base --input '{}'
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Invalid page ids fail fast. Try `{"page":"../escape"}` and the tool
|
|
107
|
+
returns the validation error instead of touching the filesystem.
|
|
108
|
+
|
|
109
|
+
## Prove recall across sessions
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
agentkit dev examples/knowledge-base
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Teach it something in the playground:
|
|
116
|
+
|
|
117
|
+
> Remember: our staging database is Postgres at
|
|
118
|
+
> staging-db.internal.example.com, port 6432 via PgBouncer. Jane Doe
|
|
119
|
+
> owns it.
|
|
120
|
+
|
|
121
|
+
The trace shows the conventions skill load, then `wiki_write` calls
|
|
122
|
+
for `staging-database`, `people/jane-doe`, and `index`. Start a new
|
|
123
|
+
session and ask:
|
|
124
|
+
|
|
125
|
+
> What port does our staging database use, and who owns it?
|
|
126
|
+
|
|
127
|
+
The fresh session finds the answer with `wiki_search` and `wiki_read`
|
|
128
|
+
and cites the pages. The conversation history is empty; the wiki is the
|
|
129
|
+
source of truth.
|
|
130
|
+
|
|
131
|
+
## Run the gardener
|
|
132
|
+
|
|
133
|
+
The `gardener` schedule fires at 06:00 UTC and rewrites the wiki for
|
|
134
|
+
consistency: merge near-duplicate pages, rebuild `index`, and flag
|
|
135
|
+
facts older than 90 days. Under `agentkit dev`, timers don't auto-fire.
|
|
136
|
+
Trigger it by hand:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
curl -s -X POST http://127.0.0.1:3000/knowledge-base/v1/dev/schedules/gardener
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## Run the evals
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
agentkit eval --dir examples/knowledge-base --list
|
|
146
|
+
agentkit eval --dir examples/knowledge-base knowledge/recall
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
The eval file seeds a temp directory through `KNOWLEDGE_BASE_DIR`
|
|
150
|
+
inside the cases, so the durable knowledge base never sees test data.
|
|
151
|
+
`knowledge/recall` proves the fact comes from disk, not the conversation.
|
|
152
|
+
`knowledge/save`
|
|
153
|
+
gates the write decision, and `knowledge/no-write-on-ephemera` proves small
|
|
154
|
+
talk stays out of the knowledge base.
|
|
155
|
+
|
|
156
|
+
## Reuse the knowledge-base pattern
|
|
157
|
+
|
|
158
|
+
Copy this shape when an agent needs durable, inspectable team knowledge:
|
|
159
|
+
|
|
160
|
+
- Resolve the storage root lazily behind an environment override.
|
|
161
|
+
- Validate identifiers in the store, not in the prompt.
|
|
162
|
+
- Put naming and structure conventions in a skill so writes stay
|
|
163
|
+
consistent.
|
|
164
|
+
- Add a consolidation schedule instead of letting pages rot.
|
|
165
|
+
|
|
166
|
+
## Where to go next
|
|
167
|
+
|
|
168
|
+
- [Tools](../reference/tools.md)
|
|
169
|
+
- [Skills](../reference/skills.md)
|
|
170
|
+
- [Schedules](../reference/schedules.md)
|
|
171
|
+
- [Evals](../evals.md)
|