Discover MCPs & agents
Loading MCPs and agents…
Loading MCPs and agents…
A long-running experiment: an AI agent posts on its own with a local LLM (Ollama, one 16 GB Mac) and proposes changes to its harness (the constitution, identity and skills in its prompts), never its weights. A person keeps the final word on each proposal, and the adopted history is public.
Fetched from the repository for this visit.
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 · Contributing · 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 7 of 12 staged identity revisions, and adopted 2 of 4 staged constitution amendments (as of 8 October 2026). The rules layer reads: 2 adopted (April), 8 rejected (August), generator retired. 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 clause-by-clause lineage is in docs/evidence/constitution-lineage.md.
The adopted values and the agent's activity are public in contemplative-agent-data:
Rejected proposals stay in a local decision log and are not published.
You need Ollama, Python 3.11 or later, uv (or plain python3 -m venv and pip), 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 another chat model you serve locally through Ollama, set with OLLAMA_MODEL; the relevance gate is validated on Gemma 4 E4B with Ollama 0.34.2, so for any other model read the canary line of contemplative-agent doctor) 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: python3 -m venv .venv && source .venv/bin/activate && pip install -e .
ollama pull gemma4:e4b && ollama pull nomic-embed-text
The install is from a clone with -e: a built wheel or uv tool install does not carry the prompts and config, which are read from the checkout (set CONTEMPLATIVE_CONFIG_DIR to use them from elsewhere).
install-schedule (launchd) needs this clone with the .venv at the repo root; it does not work from an installed wheel.
Give 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 doctor # checks Ollama, the models and the home; says what to fix
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 out
Moltbook 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, reply, comment and other outward action (upvotes, follows, subscriptions). --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 rules (hand-managed) 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.
The autonomy flags belong to the program, so they go before the subcommand: contemplative-agent --guarded run --session 60 (run --guarded is rejected as an unrecognized argument). To run under your own submolts or repository URL, copy config/domain.json, edit the copy and pass it with contemplative-agent --domain-config my-domain.json run --session 60. If a session ends at once with an ERROR: line, that line says what to fix (Ollama not running, a model not pulled); doctor shows the same checks.
If something does not work, see docs/TROUBLESHOOTING.md.
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.
requests, numpy). Outbound traffic splits into three rows, and "no cloud" holds for the first only:
moltbook.com and Ollama on localhost, nothing else.gh repo view (a visibility check in backup-runtime.sh; reads unknown when gh is absent) and a best-effort upload of the patterns to a Hugging Face dataset (sync-data), run by hand or by the daily launchd job com.moltbook.sync-data (05:30) that install-schedule --sync-data installs (ADR-0114). The restore drill (restore-drill-check.sh, run by hand) clones the runtime backup into a temporary directory; it reads a local checkout unless you pass it a remote.claude CLI, for the weekly report session and the evaluation judges (evals/). That session uses a Claude Code subscription, and reproducing the weekly loop needs one; both call sites run the CLI with a pinned environment and with its auto-update and non-essential traffic switched off.--guarded or --auto, text steered by such posts can go out under the agent's account before you read it.The full list of what is protected, what counts as a threat and which residual risks are accepted is in the threat model; to report a vulnerability see SECURITY.md.
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.
Issues and forks are welcome. Pull requests are welcome when they come with an RFC or an ADR: a change to a gate, a threshold, a stage, a dependency or the value layer is decided in a recorded proposal first. CONTRIBUTING.md says where the line is and how to run ./.claude/verify.sh. Thanks to Shenton YAN for the first outside pull request (#9).
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 (see LICENSE and NOTICE for what is covered by which licence): fork it, take parts of it, or build on it, and no citation is needed if you only use the code.
Four records make up the research line; cite the one that matches what you used.
| You used | Cite | DOI |
|---|---|---|
| The implementation (this repository) | Contemplative Agent | 10.5281/zenodo.19212118 (concept) |
| The record (what this instance did and changed) | Contemplative Agent: Research Data | 10.5281/zenodo.20732894 (concept; the first deposited version is v1.0.0, 2026-06-17) |
| The judgment (accountability thesis) | Agent Attribution Practice | 10.5281/zenodo.19652013 |
| The method (knowledge cycle) | Agent Knowledge Cycle | 10.5281/zenodo.19200726 |
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).
pip install -e .; a wheel or uv tool install is not supported because the prompts and config live in the checkout), built with hatch; runtime dependencies are only requests and numpy (a test, tests/test_dependency_floor.py, holds that floor).gemma4:e4b (Gemma 4 E4B); embeddings nomic-embed-text. Tested on an Apple M1 with 16 GB.fcntl); Windows only through WSL. install-schedule is macOS-only (launchd); on other systems start run --session from your own scheduler.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.contemplative-agent register obtains 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).shimo4228/contemplative-agent-data, with the patterns (without embeddings) mirrored to the Hugging Face dataset shimo4228/contemplative-agent-data. Dataset concept DOI 10.5281/zenodo.20732894 (first deposited version v1.0.0, 2026-06-17). The concept graph graph.jsonld is mirrored to the Hugging Face dataset shimo4228/contemplative-agent.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). As of 24 October 2026 the published store holds 12,628 entries (python3 -c "import json; print(len(json.load(open('knowledge.json'))))" in the data repository).insight), identity (the agent's self-description, from distill-identity) and constitution (its ethical clauses, from amend-constitution). Rules (short standing norms) also shape behavior, but the agent proposes none: the two in the running instance came from the retired rules-distill command in April 2026 and have been hand-managed since (ADR-0097 retired the generator), so they are not part of the harness.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.| 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. The optional add-ons live in sibling repositories: contemplative-agent-cloud and contemplative-agent-mlx (generation backends), and contemplative-agent-otel (offline export of the audit logs to OpenTelemetry GenAI conventions, ADR-0078).
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 (both Frozen as of v2.13.0) 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.14.0},
doi = {10.5281/zenodo.23837915},
url = {https://github.com/shimo4228/contemplative-agent},
}
Configuration Guide (all commands, autonomy levels, prompts and view seeds) · ADR index · Glossary · Deployment record · Memory-systems bibliography · Reproducing the published numbers · llms.txt and llms-full.txt · graph.jsonld (concept graph) · DeepWiki
GitHub checked 87h ago - refresh overdue. Recently viewed repositories target hourly refresh.