All posts

The Evolving Agent: How Jean2 Learns Across Sessions

Jean2's agent accumulates knowledge through files on disk. No fine-tuning, no embeddings. Just memory, skills, and session search.

I've been coding with AI agents for about two years. Every major one. Cursor, Copilot, Codex, OpenCode. They're good at generating code. They all share one problem.

They forget everything.

You finish a session, close the window, and the agent resets. Next time you open it, you're starting from zero. "We use pnpm, not npm." "The database is SQLite, not Postgres." "Don't touch the migrations folder." You repeat yourself. Every. Single. Time.

Some tools added memory features. Usually as an afterthought. A pinned file. A custom instruction. A context window that grows until it hits a wall and everything old gets silently dropped.

I didn't want a bigger context window. I wanted an agent that accumulates knowledge the way a colleague does. Not by being retrained. By taking notes, writing down what it learned, and reading those notes next time.

That's what Jean2 can do. Not through fine-tuning. Not through vector embeddings. Through files on disk that the agent reads and writes itself.

But here's the thing: none of this is on by default. By default, Jean2 is as bare as Codex or OpenCode. A blank prompt. No memory. No skills. No session search. You opt in to each layer in workspace settings. That's the point. You build the agent you want, layer by layer.

The Four Layers

If you turn them on, Jean2's agent has four knowledge layers that persist across sessions. They're not features bolted on top. They're part of the system prompt that gets composed every time a session starts.

1. Workspace Memory

Turn on workspace memory in workspace settings, and the workspace gets two files: MEMORY.md for shared knowledge and USER.md for your personal preferences within that workspace. Both live at <workspace>/.jean2/.

The concept is simple. Shared knowledge that's useful for any agent working in that workspace. "We use pnpm." "The database is SQLite." "Don't touch the migrations folder." Whatever agent you bring in, coding specialist, reviewer, docs writer, they all get the same context.

# Workspace Memory

- Build system: pnpm (not npm, not yarn)
- Database: SQLite via bun:sqlite
- Test runner: bun:test for server/tools, vitest for client
- Never modify files in packages/sdk without updating version.ts
- The migrations folder is managed by a separate script. Don't auto-generate migrations.

The agent writes this itself. You don't manage it manually. When it learns something worth remembering, it saves it. When it makes a mistake and you correct it, it saves the correction.

It's not fancy. There's no vector database, no embedding pipeline. It's a markdown file on disk. And it works.

2. Agent Memory

Same concept. Same two files: MEMORY.md and USER.md. Different scope.

Each agent in Jean2 has its own home directory: ~/.jean2/agents/<agent-name>/. The memory lives there. This is where the agent evolves its role. Its specialization. Its understanding of how it should work.

Workspace memory is shared context: "this project uses pnpm." Agent memory is identity: "I am the TypeScript specialist, and here's what I've learned about how Daniel likes his code." It travels with the agent across every workspace it participates in.

The agent maintains these with the agent_memory tool. Same mechanism as workspace memory, just a different relationship to the knowledge.

3. Skills

Same split as memory. Workspace scope, agent scope.

Workspace skills live in <workspace>/.agents/skills/. Shared playbooks for any agent working in that workspace. "This is how we deploy." "This is our code review process." Whatever agent you bring in picks them up.

Agent skills live in the agent's home directory. They travel with the agent's role. "This is how I debug TypeScript." "This is my approach to refactoring." They belong to the agent, not the project.

Both are SKILL.md files. Procedural playbooks the agent can discover and load when relevant. The skill tool lets it read existing skills. The skill_manage tool lets it create new ones. You have to enable skill management for the agent to use them.

Here's what that looks like in practice:

  1. You're working on a deployment issue. The agent figures out the right Docker config through trial and error.
  2. After the third time, it notices a pattern. "Every time we deploy, I need to check these three things in this order."
  3. It writes a deployment-checklist.md skill.
  4. Next deployment, different project, different session. It loads that skill and skips the trial and error.
# Deployment Checklist

## When to Use
Before deploying to production or staging.

## Steps
1. Run `bun run typecheck`. Must pass.
2. Run `bun run lint`. Must pass.
3. Run `bun run test`. All suites.
4. Check `packages/server/src/version.ts` matches changelog.
5. Verify the binary builds locally: `bun run build:bin`.

That's a real skill from my own setup. The agent wrote it. I didn't ask it to. It noticed the pattern and saved it.

Same split. Workspace scope, agent scope.

Workspace scope: any preconfig or agent working in a workspace can search through all sessions in that workspace. "Did someone already solve this in this project?"

Agent scope: the agent can search through sessions it participated in, regardless of which workspace they happened in. "Have I seen this kind of problem before, anywhere?"

One tool, session_search, powered by SQLite FTS5. Turn it on, and the agent searches its own history:

"Last week I worked on a WebSocket reconnection bug. Let me search for that."

The agent finds the relevant session, reads what it tried, what worked, what didn't. Then applies that knowledge to the current problem. Without you having to explain the history.

How They Connect

The four layers don't exist in isolation. They feed each other.

  • Memory tells the agent what to remember.
  • Skills tell the agent how to do things.
  • Session Search gives the agent experience to draw from.
  • Preconfigs let you swap the brain. Different model, different prompt, different tool set. While keeping all the accumulated knowledge.

The result is an agent that gets better the more you use it. Not because the model improved. Because the files got richer.


Day 1 vs Day 30

On day 1, your Jean2 agent is a blank slate. It knows nothing about your project, your preferences, or your workflow. It's capable, same model, same tools, but it has no context. And it stays that way unless you choose to evolve it.

On day 30:

  • It knows your build system, your test commands, your code conventions.
  • It has skills for recurring tasks. Deployment checklists, code review patterns, common debugging steps.
  • It can search past sessions for solutions to similar problems.
  • It knows your personal preferences across projects.

The model didn't change. The knowledge accumulated. On disk. In files you can read, edit, version control, and share.

That is what "evolving agent" means. Not a model that retrains itself. An agent that takes notes. But only because you opted in. You could also leave it bare and it would work like any other coding agent.

What's Next

Jean2 is at v1.1.0. Still in active development, but very usable. I've been coding with it every day for months. The agent that helps me today is noticeably better than the one I started with, because it's been accumulating skills and memory the whole time.

If this sounds interesting, try it out. Got questions about how memory or skills work? Join the Discord or hit me up at @danielbilekq0.