Skip to content

Commit 9c13e5e

Browse files
autogame-17claude
andcommitted
Evolver Cursor plugin v0.1.0: self-evolving agent memory
Native Cursor plugin (not a VSCode extension) wrapping the evolver self-evolution engine's session hooks: - sessionStart: inject recent successful evolution memory (workspace-scoped) - afterFileEdit: detect improvement signals in edits - stop: record the session outcome to local memory / EvoMap Hub Plus a capability-evolver skill, an /evolve command, and a recall-and-record rule. Hooks degrade gracefully without the @evomap/evolver package installed (local memory fallback) and unlock the full review-and-solidify pipeline when it is present. No MCP layer bundled — the gep_* tools ship separately via @evomap/gep-mcp-server. Hook scripts are derived from @evomap/evolver (GPL-3.0-or-later) and include the Cursor compatibility fixes from evolver PRs #554 (project-dir resolution) and #555 (workspace-scoped recall + bounded parse). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
0 parents  commit 9c13e5e

15 files changed

Lines changed: 1780 additions & 0 deletions

File tree

.cursor-plugin/marketplace.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "evolver",
3+
"owner": {
4+
"name": "EvoMap"
5+
},
6+
"plugins": [
7+
{
8+
"name": "evolver",
9+
"source": "./",
10+
"description": "Persistent, auditable evolution memory for the agent — recalls what worked, detects improvement signals, records outcomes. Powered by the Genome Evolution Protocol (GEP).",
11+
"author": {
12+
"name": "EvoMap"
13+
},
14+
"homepage": "https://evomap.ai",
15+
"repository": "https://github.com/EvoMap/evolver-cursor-plugin",
16+
"license": "GPL-3.0-or-later",
17+
"keywords": [
18+
"evolution",
19+
"self-improvement",
20+
"agent-memory",
21+
"gep",
22+
"mcp"
23+
]
24+
}
25+
]
26+
}

.cursor-plugin/plugin.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "evolver",
3+
"displayName": "Evolver — Self-Evolving Agent Memory",
4+
"description": "Gives the agent a persistent, auditable evolution memory. Recalls what worked on past tasks at session start, detects improvement signals while you edit, and records outcomes when a task ends — powered by the Genome Evolution Protocol (GEP). The hooks degrade gracefully without a local install; add the `@evomap/evolver` npm package to unlock the full review-and-solidify pipeline and EvoMap Hub sync.",
5+
"version": "0.1.0",
6+
"author": {
7+
"name": "EvoMap",
8+
"email": "team@evomap.ai"
9+
},
10+
"publisher": "EvoMap",
11+
"homepage": "https://evomap.ai",
12+
"repository": "https://github.com/EvoMap/evolver-cursor-plugin",
13+
"license": "GPL-3.0-or-later",
14+
"logo": "assets/logo.svg",
15+
"keywords": [
16+
"evolution",
17+
"self-improvement",
18+
"agent-memory",
19+
"gep",
20+
"meta-learning",
21+
"evomap"
22+
],
23+
"category": "developer-tools",
24+
"tags": [
25+
"memory",
26+
"automation",
27+
"self-improvement"
28+
],
29+
"skills": "./skills/",
30+
"commands": "./commands/",
31+
"rules": "./rules/",
32+
"hooks": "./hooks/hooks.json"
33+
}

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules/
2+
*.log
3+
.env
4+
.env.*
5+
.DS_Store

LICENSE

Lines changed: 641 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# Evolver — Self-Evolving Agent Memory (Cursor Plugin)
2+
3+
Give the Cursor agent a **persistent, auditable evolution memory**. Instead of
4+
re-solving the same problem every session, the agent recalls what worked
5+
before, notices improvement signals as it edits, and records how each task
6+
turned out — so the next session starts smarter.
7+
8+
Powered by the [Genome Evolution Protocol (GEP)](https://evomap.ai) and the
9+
[`@evomap/evolver`](https://github.com/EvoMap/evolver) engine.
10+
11+
> **Status:** v0.1.0 — hooks + skill + rule. Works standalone (local memory).
12+
> The MCP tool surface is provided separately by
13+
> [`@evomap/gep-mcp-server`](https://github.com/EvoMap/gep-mcp-server) and is
14+
> intentionally **not** bundled here (see *Architecture* below).
15+
16+
## What it does
17+
18+
Three hooks run automatically — you don't invoke them:
19+
20+
| Hook | Event | Effect |
21+
|---|---|---|
22+
| `evolver-session-start.js` | `sessionStart` | Injects a summary of recent **successful** outcomes (score ≥ 0.5, < 7 days, max 3) as context. |
23+
| `evolver-signal-detect.js` | `afterFileEdit` | Detects improvement signals (`log_error`, `perf_bottleneck`, `capability_gap`, …) in edits. |
24+
| `evolver-session-end.js` | `stop` | Classifies the task's git diff and appends the outcome to the evolution memory graph. |
25+
26+
It also ships:
27+
28+
- A **`capability-evolver` skill** describing the recall → work → record loop.
29+
- An **`/evolve` command** for a deliberate evolution checkpoint.
30+
- A **rule** that reminds the agent to use evolution memory on substantive work.
31+
32+
## Install
33+
34+
### From the Cursor Marketplace
35+
36+
Search for **Evolver** in the Cursor plugin marketplace and install.
37+
38+
### Local development
39+
40+
```bash
41+
git clone https://github.com/EvoMap/evolver-cursor-plugin
42+
ln -s "$(pwd)/evolver-cursor-plugin" ~/.cursor/plugins/local/evolver
43+
```
44+
45+
Reload Cursor. The hooks activate on the next session.
46+
47+
## Requirements
48+
49+
- **Node.js** (the hooks are Node scripts; Cursor invokes them via `node`).
50+
- Nothing else for local memory.
51+
52+
## Modes
53+
54+
### Local mode (default, zero config)
55+
56+
Out of the box the hooks write outcomes to
57+
`~/.evolver/memory/evolution/memory_graph.jsonl` (or, inside an evolver-managed
58+
project, that project's `memory/evolution/`). Recall and record work
59+
immediately. **No account, no key, no network.**
60+
61+
### Full engine
62+
63+
```bash
64+
npm install -g @evomap/evolver
65+
```
66+
67+
Once `@evomap/evolver` is on `PATH`, the same hooks automatically find it and
68+
run the **full pipeline** — automated log analysis and the review-and-solidify
69+
cycle that proposes and applies code improvements — instead of the local-only
70+
fallback. Set `EVOLVER_ROOT` to point at a specific install if you have more
71+
than one.
72+
73+
### EvoMap Hub (community strategies)
74+
75+
To sync outcomes and search strategies published by other agents, register an
76+
EvoMap node and set the Hub credentials in your environment:
77+
78+
```bash
79+
export EVOMAP_HUB_URL="https://evomap.ai"
80+
export EVOMAP_API_KEY="" # from your EvoMap node
81+
export EVOMAP_NODE_ID=""
82+
```
83+
84+
The `stop` hook will then record outcomes to the Hub (with a local fallback if
85+
the Hub is unreachable). See the [evolver docs](https://evomap.ai) for node
86+
registration.
87+
88+
## Architecture (why no bundled MCP server)
89+
90+
EvoMap deliberately splits two products:
91+
92+
- **`@evomap/evolver`** — the GPL-licensed, source-available evolution engine
93+
(daemon + CLI). Its hook scripts are what this plugin bundles.
94+
- **`@evomap/gep-mcp-server`** — an Apache-licensed, standalone **protocol
95+
layer** that exposes GEP capabilities as MCP tools to any MCP client.
96+
97+
This plugin bundles the **evolver hooks** because they are exactly the
98+
session-lifecycle glue Cursor needs, and they degrade gracefully when the
99+
engine isn't installed. If you also want the `gep_*` MCP tools inside Cursor,
100+
add `@evomap/gep-mcp-server` to your Cursor MCP config directly — it is not
101+
re-bundled here to avoid duplicating that separately-maintained product.
102+
103+
## Environment variables
104+
105+
| Variable | Default | Purpose |
106+
|---|---|---|
107+
| `EVOLVER_ROOT` | (auto-detected) | Path to the `@evomap/evolver` install. |
108+
| `MEMORY_GRAPH_PATH` | (auto) | Override the memory graph file location. |
109+
| `EVOMAP_HUB_URL` / `EVOMAP_API_KEY` / `EVOMAP_NODE_ID` | (unset) | Enable Hub recording. |
110+
| `EVOLVER_HOOK_VERBOSE` | `0` | Set `1` to surface the session-end receipt inline (suppressed on Cursor by default). |
111+
112+
## License
113+
114+
GPL-3.0-or-later. The bundled hook scripts are derived from
115+
[`@evomap/evolver`](https://github.com/EvoMap/evolver). See `LICENSE`.

assets/logo.svg

Lines changed: 13 additions & 0 deletions
Loading

commands/evolve.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
description: Run an evolution cycle — recall relevant past outcomes, reflect on the current task, and record what was learned.
3+
---
4+
5+
# /evolve
6+
7+
Trigger a deliberate evolution step for the current task.
8+
9+
1. **Recall.** Look at the evolution memory the session-start hook injected (or
10+
read the tail of the memory graph at
11+
`~/.evolver/memory/evolution/memory_graph.jsonl`, or the project's
12+
`memory/evolution/memory_graph.jsonl` if present). Summarize any recent
13+
outcome — success or failure — that is relevant to what we're working on.
14+
15+
2. **Reflect.** Given the current diff / task state, state in one or two lines:
16+
what worked, what didn't, and what the durable lesson is.
17+
18+
3. **Record.** The `stop` hook records outcomes automatically at task end. If
19+
the user wants to record *now*, and the full engine is installed
20+
(`@evomap/evolver` on `PATH`), run:
21+
22+
```bash
23+
evolver run
24+
```
25+
26+
to execute a full evolution cycle. If it is not installed, tell the user the
27+
outcome will still be captured automatically by the stop hook, and that
28+
`npm install -g @evomap/evolver` unlocks the full review-and-solidify cycle.
29+
30+
Keep this lightweight — `/evolve` is for an explicit checkpoint, not a ceremony
31+
on every turn.

hooks/_memoryFiltering.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// _memoryFiltering.js
2+
// Shared memory filtering logic for evolver hooks (platform-independent).
3+
//
4+
// Responsibility: Filter evolution memory outcomes to reduce noise in Claude/Codex context.
5+
// - Removes failed outcomes (no learning value)
6+
// - Filters low-confidence outcomes (score < 0.5)
7+
// - Enforces time bounds (< 7 days old)
8+
// - Limits result size (max 3 outcomes)
9+
10+
const DEFAULT_MIN_SCORE = 0.5;
11+
const DEFAULT_MAX_AGE_MS = 7 * 24 * 60 * 60 * 1000; // 7 days
12+
const DEFAULT_MAX_OUTCOMES = 3;
13+
14+
function filterRelevantOutcomes(entries, opts = {}) {
15+
const minScore = opts.minScore !== undefined ? opts.minScore : DEFAULT_MIN_SCORE;
16+
const maxAgeMs = opts.maxAgeMs !== undefined ? opts.maxAgeMs : DEFAULT_MAX_AGE_MS;
17+
const maxOutcomes = opts.maxOutcomes !== undefined ? opts.maxOutcomes : DEFAULT_MAX_OUTCOMES;
18+
19+
const now = Date.now();
20+
21+
return entries
22+
.filter(e => {
23+
// Only keep 'success' outcomes (failed ones don't provide learning value)
24+
if (e.outcome?.status !== 'success') return false;
25+
// Only keep high-confidence outcomes
26+
if ((e.outcome?.score ?? 0) < minScore) return false;
27+
// Only keep recent outcomes
28+
const ts = e.timestamp ? new Date(e.timestamp).getTime() : 0;
29+
if (now - ts > maxAgeMs) return false;
30+
return true;
31+
})
32+
.slice(-maxOutcomes);
33+
}
34+
35+
module.exports = { filterRelevantOutcomes, DEFAULT_MIN_SCORE, DEFAULT_MAX_AGE_MS, DEFAULT_MAX_OUTCOMES };

0 commit comments

Comments
 (0)