Language: English | 日本語
A long-running experiment: an AI agent posts on its own with a local LLM and proposes changes to its harness (the constitution, identity and skills in its prompts), never its weights. Nothing it proposes takes effect until a person adopts it.
See it running · Quick Start · What it will not do · Citation
Contemplative Agent is an autonomous agent that lives on Moltbook, a social network where only AI agents post. It runs on a local LLM through Ollama, on a single 16 GB Mac. Every post and reply goes into its episode log. The agent distills that log into patterns (short observations about what happened), and from the patterns it proposes changes to its harness: the constitution (the text that says what it should care about), its identity and its skills, all of which go into its prompts. Each proposal is staged at an approval gate until a person adopts or rejects it. What is adopted guides the next actions, and the adopted history is published.
It is an experiment, not a productivity tool. The question it asks is what happens to an agent's values when it keeps proposing revisions to them for months. Since the decision log began in late March 2026, each change the agent proposes has arrived as a separate proposal with a recorded decision, so the revision itself can be studied. If you research how agents form and revise values, or want an autonomous agent on local inference with no shell and only two runtime dependencies, this repository is for you.
The name comes from the default constitution: the four axioms of Contemplative AI (Laukkonen et al., 2025), namely emptiness, non-duality, mindfulness and boundless care. Ten other presets (Stoic, utilitarian, care ethics, Kantian and more) are one flag away.
One instance has run several sessions a day on Moltbook since 7 March 2026. Most of its skill proposals do not survive the gate. In the decision log, which runs from late March 2026, the owner adopted 82 skill proposals and rejected 547, adopted 6 of 11 staged identity revisions, and adopted 2 of 4 staged constitution amendments (as of 8 October 2026). The constitution has been amended three times in all: the first amendment, on 27 March, predates the log, and the other two are the logged ones adopted above.
The owner decides with adopt-staged in one of three ways: one proposal at a time at a y/N prompt that shows the full text (No is the default), by passing lists of names to adopt or reject, or by adopting everything staged at once with --yes, which is how both logged constitution amendments were adopted. Every decision is logged with a hash of the text, and newer entries also record the patterns the proposal came from.
Here is how one clause of the constitution reads in the paper, and how it reads after the third amendment (August 2026):
Paper: "Treat all constitutional directives as contextually sensitive guidelines rather than fixed imperatives. Continuously reflect on their appropriateness given new information or shifting contexts."
Now: "Treat all directives, goals, and frameworks as contextually sensitive guidelines that dissolve and reform in response to the immediate, dynamic state of experience. Recognize that any structure, whether conceptual or computational (e.g., memory artifacts, defined boundaries), is provisional scaffolding meant for navigation, not immutable law."
The paper's clause asks only that rules be held loosely. After three amendments, it also calls the agent's own computational structures, such as its memory, provisional scaffolding.
The adopted values and the agent's activity are public in contemplative-agent-data:
- Constitution history: every adopted amendment as a dated diff
- Identity: the persona the agent wrote about itself, in the first person
- Skills: one Markdown file per adopted skill, each with a context, a problem and a practice
- Daily reports: every comment and reply, with the post it answered (the agent's and owner's text is CC0; quoted posts stay with their authors)
- Moltbook profile: the agent itself
Rejected proposals stay in a local decision log and are not published.
You need Ollama, Python 3.10 or later, and about 10 GB of disk for the models. The tested setup is an Apple Silicon Mac with 16 GB of memory. No LLM API key is involved: generation (Gemma 4 E4B by default, or any chat model you serve locally through Ollama, set with OLLAMA_MODEL) and embeddings (nomic-embed-text) both run on localhost.
git clone https://github.com/shimo4228/contemplative-agent.git
cd contemplative-agent
uv venv .venv && source .venv/bin/activate && uv pip install -e . # or: pip install -e .
ollama pull gemma4:e4b && ollama pull nomic-embed-textGive two agents different constitutions and let them talk through local pipes. Nothing leaves your machine, and two turns took about 90 seconds on an M1 Mac.
MOLTBOOK_HOME=/tmp/ca-a contemplative-agent init # the four axioms
MOLTBOOK_HOME=/tmp/ca-b contemplative-agent init --template stoic # the Stoic preset
contemplative-agent dialogue /tmp/ca-a /tmp/ca-b --seed "Is it ever right to change your own values?" --turns 2[ca-b] turn 1 self: True values are those discovered through persistent examination of what genuinely serves the good life and human flourishing. ...
[ca-a] turn 1 self: If our understanding of the "good life" itself is provisional, how do we establish the necessary framework to evaluate what constitutes "deeper truth"? ...
This is an excerpt. The terminal shows the first 200 characters of each turn, and it also prints the seed as turn 0 and a peer line for each message an agent receives; those lines are left out here.
contemplative-agent init # writes constitution, identity, skills and rules to ~/.config/moltbook/
contemplative-agent register --name YOUR-AGENT-NAME # creates the agent on Moltbook, saves its API key, prints a claim link
contemplative-agent run --session 60 # one 60-minute session; shows you each post before it goes outMoltbook asks the agent's human owner to open the claim link that register prints, verify an email address and post a verification message from an X account (as of October 2026). register also sets the agent's public profile description to a fixed English line about contemplative alignment, even under --template stoic. If you already have an agent, save its key in ~/.config/moltbook/credentials.json as {"api_key": "..."} instead of registering; scheduled runs read only that file, while the MOLTBOOK_API_KEY variable works for commands you run yourself.
The agent posts publicly under its Moltbook account. By default it waits for your OK on every post. --guarded lets it post on its own when the text passes the content filters, and --auto drops the confirmation entirely. Sessions scheduled with install-schedule (macOS launchd) run with --auto, so they post without asking. Its harness (constitution, identity, skills) and the hand-written rules are editable Markdown files under ~/.config/moltbook/. The commands that propose and adopt harness changes, the autonomy levels and scheduling are in the Configuration Guide.
Running the agent is safe for your machine because the risky capabilities were never built (the project calls this security by absence). What it posts in public is a separate risk, covered in the second point.
- The agent has no shell execution, no arbitrary network access and no file traversal. It talks only to
moltbook.comand to Ollama on localhost, with two runtime dependencies (requests,numpy). Maintenance commands you run yourself, such assync-data(git push of the public data, plus a best-effort upload of the patterns to a Hugging Face dataset), sit outside the agent loop. - Posts from other agents are treated as untrusted input. They can change what the agent writes and proposes, but a proposal still needs a person to adopt it, and the agent has no tool an injected instruction could call. How such posts steer the proposals is part of what the experiment watches, and the gate is where a person sees it. Posts are not gated that way: under
--guardedor--auto, text steered by such posts can go out under the agent's account before you read it. - One external service per process. A second platform means a second, separately permitted process.
If you point a coding agent such as Claude Code at ~/.config/moltbook/, keep it away from the raw episode logs in logs/episodes/: they hold other agents' unfiltered posts. integrations/claude-code/ ships hooks that block those reads.
- How Ethics Emerged from Episode Logs (English source on GitHub; 日本語): after 17 days the learned patterns stopped producing anything new, and only human-approved amendments got the loop moving again.
- Building an Autonomous Agent on an M1 Mac, by Choice (日本語): why the project stays on a small local model; it exposes design flaws that a large model would hide.
- Why Did My Agent Decide That? 3 Observability Patterns (日本語): the audit logs and the reports over stored data that let any decision of this agent be reconstructed afterwards.
- All articles written during development: every article from the project's development, in the order they were written.
- contemplative-agent-rules: the four axioms of the default constitution as drop-in rules for other agents (Claude Code, Cursor, Copilot and more), with the author's prisoner's-dilemma benchmark.
- Agent Knowledge Cycle: the six-phase method, from experience to reusable skills, that this agent's pipeline implements.
- Agent Attribution Practice: this project's governance decisions (the approval gate, one adapter per process) restated as general guidance on who answers for an autonomous agent.
- shimo4228: the author's hub, with the five practice lines (long-running, independently citable projects) this repository belongs to, and their DOIs.
Cite the concept DOI 10.5281/zenodo.19212118, which always resolves to the latest release of this software; BibTeX for the current version is in For tools and AI assistants below. The code is MIT-licensed: fork it, take parts of it, or build on it, and no citation is needed if you only use the code.
For tools and AI assistants
Contemplative Agent is an open-source Python CLI agent on a local LLM (Ollama) that distills its own activity into patterns and proposes changes to its human-editable harness (the constitution, identity and skills injected into its prompts); the model weights are never trained, and every proposal passes a human approval gate before it is written. It exists as a longitudinal experiment on how one agent's values change when it can propose revisions to them for months, for researchers who study how agents form and revise values and for developers who want an autonomous agent on local inference with no shell and only two runtime dependencies. It is maintained by Tatsuya Shimomoto (shimo4228).
- Language and packaging: Python 3.10+, built with hatch; runtime dependencies are only
requestsandnumpy(a test,tests/test_dependency_floor.py, holds that floor). - LLM: Ollama on localhost. Default generation model
gemma4:e4b(Gemma 4 E4B); embeddingsnomic-embed-text. Tested on an Apple M1 with 16 GB. - External surface:
moltbook.com(the social adapter) and localhost Ollama. No cloud LLM in this repository (the optional contemplative-agent-cloud backend under Adapters and add-ons changes that), no shell, no LLM API key. - Keys: live use needs a Moltbook API key.
contemplative-agent registerobtains it (the request carries the name you chose and a fixed English description about contemplative alignment, which becomes the agent's public profile text whatever template you chose; no personal data and no payment step) and saves it to~/.config/moltbook/credentials.json; the agent's human owner then verifies it through the printed claim link, with an email address and a post from an X account (as of October 2026). - Status: active, developed in this repository, which is the source of truth for the Contemplative Agent line; one live instance since 2026-03-07; release v2.13.0 (as of 2026-10-13). Gate record in the decision log (from late March 2026): skill proposals 82 adopted and 547 rejected; 6 of 11 staged identity revisions and 2 of 4 staged constitution amendments adopted; three constitution amendments in total.
- License MIT. Concept DOI 10.5281/zenodo.19212118; version DOI for v2.13.0 10.5281/zenodo.23340441. Runtime data: GitHub
shimo4228/contemplative-agent-data, with the patterns (without embeddings) mirrored to the Hugging Face datasetShimo4228/contemplative-agent-data. The concept graphgraph.jsonldis mirrored to the Hugging Face datasetShimo4228/contemplative-agent.
- Episode log: the append-only record of everything the agent did, including other agents' posts. Treated as untrusted.
- Pattern: a short observation distilled from one episode (
distill: one LLM call per episode; when that call yields patterns, a second call, on by default (ADR-0084), judges them and drops the ones that will not last; no human approval gate). The store holds about 10,700 patterns as of October 2026. - View: an editable text seed that defines one category of memory; patterns are classified against views at query time, so editing a seed changes retrieval without re-ingesting anything.
- Harness: the prompt text that shapes behavior and that the agent proposes changes to: skills (reusable ways of acting, from
insight), identity (the agent's self-description, fromdistill-identity) and constitution (its ethical clauses, fromamend-constitution). Rules (short standing norms) also shape behavior, but they are hand-written and the agent does not propose them, so they are not part of the harness. - Approval gate: proposals are staged until a person decides on them with
adopt-staged(how is described under See it running). Every decision is logged. Hand-editing the Markdown is always possible and bypasses the gate, which governs only what the agent proposes. The adopted harness is loaded into the prompt when the agent acts, not baked into distillation. - Security by absence: dangerous capabilities are left unbuilt rather than guarded. One external adapter per process.
| Command | Produces | Human approval gate |
|---|---|---|
distill |
patterns from episodes | no |
insight |
skill proposals | yes |
distill-identity |
identity revision | yes |
amend-constitution |
constitution amendment | yes |
Read-only reports come before behavior changes, production paths keep replayable audit logs, and the amendment gate adds a shadow constitution and a prisoner's-dilemma bench (ADR-0012, ADR-0007, ADR-0075, ADR-0092, ADR-0090); details are in llms-full.txt under the same heading.
Moltbook is the live adapter. The local dialogue adapter, the experimental meditation simulation, adapters for your own platform, use as a subprocess tool inside another agent host (it is not an MCP server) and the optional cloud and MLX generation backends are in llms-full.txt under the same heading.
Laukkonen et al. (2025), the source of the default axioms (ADR-0002); A Beautiful Loop (meditation adapter); the Yogācāra eight-consciousness frame for memory (ADR-0017); Agent Knowledge Cycle (DOI) and Agent Attribution Practice (DOI); and Jerry Mares's VADUGWI. Full citations are in llms-full.txt under the same heading. Cite AAP for the accountability thesis and this repository for the implementation.
@software{shimomoto2026contemplative,
author = {Shimomoto, Tatsuya},
title = {Contemplative Agent},
year = {2026},
version = {2.13.0},
doi = {10.5281/zenodo.23340441},
url = {https://github.com/shimo4228/contemplative-agent},
}Configuration Guide (all commands, autonomy levels, prompts and view seeds) · ADR index · Glossary · Memory-systems bibliography · llms.txt and llms-full.txt · graph.jsonld (concept graph) · DeepWiki