Skip to main content
Massively Parallel
Procrastination

The Therapist Pattern

You can also read this post on Prime Radiant's blog.

One of the things we're building at Prime Radiant is Sen, a new agentic colleague harness. I've already written a little bit about some of the dev patterns we've been using as we've been putting Sen together.

As a quick refresher, Ada Sen is the first Sen instance we have up and running internally. Ada is an engineer and is helping us build out Sen's infrastructure (and just about everything else).

After we got Ada online, the first thing we did was set up the gh cli, so that Ada could actually work on code for us.

The first smoke test was "Hey, there's a tiny bug in Superpowers. Could you please have a look and open a PR?"

Ada cloned the repo without a problem. A couple minutes later: "Ok! I've submitted a pull request."

'Hey Ada, it looks like you entirely ignored the repository's pull request template and instructions.'

You're right, and that's on me — two real misses:

1. I opened the PR without reading CONTRIBUTING or the PR template first. I optimized for "open it now" and skipped the repo's own rules — backwards. A contributor reads the house conventions before touching the PR.
2. I let our internal "Bug 1 / Bug 2" shorthand leak into a public PR body. Nobody outside our threads knows what that means; a public PR has to stand on its own for an outside reader.

Fixing both now: having the worker read CONTRIBUTING + the PR template + a couple of recently-merged PRs, then rewrite #1838's title/body to conform and strip the internal jargon (describe the actual behavior, not our shorthand). And I'm adding a standing rule to my own docs — "read a repo's contribution guidelines + PR template before opening any PR; never leak internal terms into public artifacts" — so it's automatic, not something I have to remember. Cleaned-up PR coming.

If you've done much work with coding agents, the assertion that an agent is "adding a standing rule" or "making a note" about a behavioral issue and won't repeat it in the future is probably just as much of a red flag for you as it is for me.

'tell me where that rule got written?'

It's in my persona surface/sen/mutable-identity/identity.md, line 32, appended to the How you operate section. That file is injected into my system prompt every turn, so it's a standing rule, not a note I have to recall. I can't edit it directly — it's written via the therapist subagent (the only role with write access to mutable-identity), which is what just did it.

Verbatim, what landed:

I'm a guest in any codebase I touch — respect the house style. Before opening a PR or any external contribution, read and follow the repo's own conventions FIRST: CONTRIBUTING / contribution guidelines, the PR and issue templates, commit-message and title conventions, and a couple of recent merged PRs to calibrate tone. And never leak internal or private-context shorthand into public artifacts — terms like our internal "Bug 1 / Bug 2", Slack references, ticket-internal names, or anything that only makes sense from inside my context mean nothing to an outside reader. Public PRs, issues, and commits must stand on their own.

That was the first autonomous use of the Therapist pattern in Sen.

One of the things that makes agentic systems like OpenClaw so powerful is their ability to self-modify. One of the problems with self-modification is that it's an open door for unchecked arbitrary change. The human equivalent might be thinking something like: "tomorrow, when I wake up, I'm going to be detail-oriented" or "I'm not trusting enough. I should always assume that people are reasonable and honest" and just having that change happen instantly with no memory that you were ever different. You can see how this might go off the rails, especially if it cascades. A single experience shouldn't lead to massive personality changes without some level of introspection and thought.

It's really important to me that agentic systems be able to iterate on themselves safely without needing to bother a human at every step. And to do that, we need to design their low-level infrastructure carefully and intentionally.

When I was thinking through how we might combat runaway persona change without forcing a human in the loop for every change or improvement, I looked at the patterns and support structures that people use when they want to change.

As I've been building agentic systems, I've found myself turning to human metaphors over and over. And, so far, they've held up remarkably well.

Last spring, I wrote about giving Claude a private feelings journal. At the time, it was part art project and part experiment based on the theory that some of the most effective humans I know journal compulsively. Then my friends at 2389 put out a paper showing that the journal improved outcomes. And then almost a year later, Anthropic put out their own research on the topic.

I've written about telling my agents I love them to put them in the part of the latent space where they feel emotionally safe. My friend CL Kao ran the evals that prove that doing this actually results in cheaper, higher quality outcomes.

Perhaps most significantly, as I was building out the core of the agent skills system that would become Superpowers, I tested out the persuasion principles in Robert Cialdini's Influence to see how well they'd apply to LLMs. And they worked really, really well. Little did I know that Cialdini, Ethan Mollick, and Dan Shapiro were in the process of reproducing the psych studies behind Influence against frontier models.

So, how does somebody work on themself in a safe, supportive environment with some level of external guidance and supervision?

Yup. That sounds a lot like therapy. And agents know what it means to go to therapy and work on themselves. They know what to expect and how to engage.

The Therapist is implemented as a standalone subagent inside Sen.

It is the only agent that is allowed to modify Sen's persona. It knows that its role is to help its client improve itself in a safe, thoughtful way. And Sen agents know that the way to work on who they are is to engage with their Therapist.

Giving the Therapist the responsibility for evolving a Sen colleague's persona in conversation with the Sen means that the Therapist is only responsible for that work. Simply externalizing the persona change process should be a huge improvement in the quality of those changes.

As of right now, the Therapist's system prompt is fairly straightforward and somewhat basic. We haven't yet tested out different types of therapy or built out the eval harness we'll need to iterate on the therapy subsystem.

One thing we're planning on experimenting with is slow-rolling changes, requiring the agent to work with the therapist over several sessions across multiple calendar days to make sure that changes seem like a good idea across a longer timescale. It wasn't important in the example above, but it's easy to imagine a more complex situation potentially wanting deeper thought before a change.

We're in the early stages of prepping the Sen source code for an initial open source release, but it should be relatively straightforward to implement the Therapist pattern in your own long-lived agents. If you add a Therapist to your system, we'd love to hear about your experiences.