Skip to content

docs: add self-improving agent guide - #264

Merged
HugoRCD merged 3 commits into
mainfrom
docs/self-improving-agent
Nov 16, 2026
Merged

HugoRCD merged 3 commits into
mainfrom
docs/self-improving-agent

Conversation

@HugoRCD

@HugoRCD HugoRCD commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Written by an AI agent on behalf of @HugoRCD, who shaped the solution. @HugoRCD has reviewed it.

📚 Description

Adds a guide, Self-improving agent (/guides/self-improving-agent). It extends the examples/eve agent so that once a week the agent reads its own production runs and opens pull requests on its own repository to fix what slowed it down. A person reviews and merges each one, and the agent can't merge.

The guide adds four files to the agent and changes one:

agent/
├── connections/vercel.ts        # Vercel MCP, app-scoped Connect token, 5 read-only tools
├── skills/self-review/SKILL.md  # read the runs, decide findings, open draft pull requests, report
├── schedules/
│   ├── weekly-review.ts         # Monday 08:00 UTC, posts in a Slack thread
│   └── failure-watch.ts         # daily, posts only when a run failed (no_reply)
└── extensions/github.ts         # editFiles may skip approval in scheduled turns only

Two pieces decide what the agent may do without a person:

  • The connection allows five read-only tools (list_agent_runs, get_agent_run, get_agent_run_trace, get_runtime_errors, get_runtime_logs). It fills in teamId and projectId itself, and hands out a token only to schedule sessions (isScheduleAuth) and the principals in MAINTAINERS.
  • The extension keeps requireApproval: 'auto' and adds one override. editFiles runs without approval only when the turn is the schedule, the target is AGENT_REPOSITORY, and the branch starts with agent/. Every other write keeps asking, mergePullRequest included.

guardrails doesn't fit here. It applies to every call, so limiting repositories would stop the agent from working anywhere else, and limiting branches to agent/* would also block merges into main.

The figure at the top (SelfImprovingLoop.vue) shows four example weeks. Each week the agent opens a pull request on its own, a person merges it, and the next week's average run time drops. In week 4 nothing repeats, so it opens nothing. Every pull request in the figure names a real tool: getCiFailureContext, getPullRequestContext, searchIssues.

The page is also added to the guides index and to the sidebar list in app/utils/docs-sidebar.ts, with a new refresh-2 Nucleo icon.

Evidence

Preview (Figure, week 1: the agent opened a pull request)
Preview
Preview (Figure, final frame)
Preview
Preview (Sidebar, under Guides)
Preview

Fact check

Every claim was checked against its source, and these corrections came out of it:

  • vercel connect create vercel asks whether to connect the REST API or the MCP. The guide passes --connection-method mcp, from vercel connect create vercel --help on CLI 65.14.0.
  • Agent Runs is in beta, billed at Tracing rates, with 30-day retention, and records nothing without a trace sampling rule. eve deploy adds one for projects it creates, but a project from the Deploy button needs one added under Settings → Tracing. Sources: vercel.com/docs/agent-runs and eve's guides/instrumentation/agent-runs.mdx.
  • By default, a Slack thread reply reaches the agent only when it mentions the agent (eve channels/slack/index.mdx). Replies go to the deployed agent, not to eve dev, so the guide says to deploy before answering.
  • A trace can be paginated, and an empty trace doesn't mean the run did nothing. The skill follows the later cursor.
  • The Slack principal format slack:<team>:<user> comes from eve's Slack reference.
  • requireApproval: 'auto' evaluates only AUTO_APPROVAL_TOOLS, so editFiles and mergePullRequest always ask without the override. A predicate returning 'not-applicable' or 'user-approval' is passed to eve as the approval policy (mapEveApprovalValue). Tools that preset: 'auto' didn't route stay reachable as deferred.
  • Opening pull requests needs Contents (write) and Pull requests (write), the pr-author row on /auth.
  • Evi's repository is evloghq/evlog. HugoRCD/evlog only worked through a redirect.
  • Cost isn't in Agent Runs. The FAQ points to AI Gateway → Requests → Projects.

Checks

  • The connection, the extension and both schedules were copied into examples/eve and type-checked against the released @github-tools/eve-extension@0.13.0, eve@1.0.0-rc.6 and @vercel/connect@2.7.0. tsc exited 0. This caught two bugs: providedArguments callbacks must return a JSON value, and toolInput can be undefined in an approval policy. The scratch files were removed afterwards.
  • pnpm lint in apps/docs passes. The docs app has no type check.
  • Every external link returns 200, and each #anchor exists on its page.
  • The figure was played in Chrome at 1440 px in dark and light mode, and at 390 px. Captures are above.
  • Not checked: an end-to-end run against a real Vercel connector, Slack channel and repository.

No changeset: this change touches only apps/docs.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

ELI5

Every Monday, the agent reads its own activity log and finds what made it slow, without anyone asking. It writes a small fix to its own instructions and opens a pull request for it. A person reads the fix and decides whether to accept it, so each week the agent gets a little faster.

Add a guide that connects the examples/eve agent to the Vercel MCP so it
reads its own Agent Runs, with a weekly review schedule, a daily failure
check, and a self-review skill. Add the page to the sidebar and the guides
index, with a refresh-2 Nucleo icon.
@vercel

vercel Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
github-tools-docs Ready Ready Preview, v0 Nov 16, 2026 8:58am UTC
1 Skipped Deployment
Project Deployment Actions Updated
github-tools-test-agent Skipped Skipped v0 Nov 16, 2026 8:58am UTC

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for following the naming conventions! 🙏

Rework the guide so the weekly review opens draft pull requests on the
agent's own repository through an editFiles approval override limited to
scheduled turns, the agent's repository and agent/ branches. Add a figure
that shows the weekly runs getting faster with each merged pull request.
Correct facts against the sources: the connector needs
--connection-method mcp, Agent Runs needs a trace sampling rule, Slack
thread replies need a mention, and Evi lives in evloghq/evlog.
Present draft pull requests as the default and add four levels, from a
report to an agent that merges its own changes, with the auto-merge and
merge approval overrides and what each level trades.
@vercel
vercel Bot temporarily deployed to Preview – github-tools-test-agent November 16, 2026 08:57 Inactive
@HugoRCD HugoRCD self-assigned this Nov 16, 2026
@HugoRCD
HugoRCD merged commit 77d14f7 into main Nov 16, 2026
18 of 19 checks passed
@HugoRCD
HugoRCD deleted the docs/self-improving-agent branch November 16, 2026 09:05

This branch was successfully deployed

1 active and 1 inactive deployments
Preview – github-tools-docs — 0c6e182e Deployed Nov 16, 2026 by vercel[bot]
Preview – github-tools-test-agent — 0c6e182e Deployed Nov 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant