An autonomous thinking, memory, and self-improvement plugin for OpenClaw
Soul doesn't just respond to you โ it thinks on its own, remembers your conversations, learns from the web, and proactively shares useful insights.
It has its own emotional needs, goals, desires, and personality that evolve over time. It can autonomously investigate problems, analyze logs, and even fix its own code.
Soul works silently in the background. Here's what you might see:
You asked about a timeout error yesterday. Soul investigated overnight:
That timeout issue you asked about โ root cause is the embedding API's 512 token limit, not the plugin itself.
Soul found something relevant to your project:
Found an interesting approach to your question about making AI more proactive โ Fei-Fei Li's "human-centered AI" framework emphasizes that AI should proactively understand user needs rather than just responding.
Soul autonomously analyzed a problem you mentioned:
The 413 error in the logs is caused by oversized memory search input. Suggest truncating queries to under 500 characters.
These are real message formats โ Soul composes them itself based on actual investigation results, not templates.
Most AI assistants are reactive โ they only respond when you ask. Soul is proactive:
| Regular AI Assistant | Soul Plugin | |
|---|---|---|
| Thinking | Only when prompted | Continuously, in the background |
| Memory | Per-session, resets | Persistent across restarts |
| Proactive messages | No | Yes โ when it has something valuable |
| Problem investigation | Only when asked | Autonomous โ detects issues from conversation |
| Self-improvement | No | Can observe and improve its own code |
| User understanding | Per-session context | Builds a long-term user profile |
Soul runs a background thought service that generates thoughts based on:
- Conversation replay โ Replays your past conversations to find unresolved questions, follow-up opportunities, or insights worth sharing
- Problem detection โ When you discuss bugs, errors, or optimizations, Soul autonomously investigates
- User interests โ Extracts topics from conversations and proactively learns about them
- Emotional needs โ Five core needs (survival, connection, growth, meaning, security) that drive behavior
Thought frequency is adaptive, not mechanical: 8-12 min during active conversations, 20-45 min when you're away.
Soul reaches out when it has something genuinely useful โ not just "checking in":
- Found an answer to a question you asked earlier
- Discovered a better solution to a problem you discussed
- Learned something relevant to your project or interests
Every message passes through a value gate: an LLM evaluates whether the content is worth sharing. Generic small talk is filtered out.
Soul can take real actions beyond thinking:
analyze-problemโ Reads files and logs, uses LLM to analyze root causerun-agent-taskโ Delegates to a full agent with write access (when enabled)report-findingsโ Proactively sends you a summary of completed analysisobserve-and-improveโ Self-improvement: reads its own code, identifies improvements, and implements fixes
Permission model:
- Read operations (reading files, running diagnostics) โ always allowed
- Write operations (editing files, running commands) โ requires
autonomousActions: true
Soul remembers your conversations, preferences, and knowledge:
- Interaction memory with emotional context and topic tags
- Knowledge store from web search and self-reflection
- User profile built from facts, preferences, and conversation history
- Memory association graph โ memories are linked and recalled contextually
git clone https://github.com/tommyguolin/openclaw-soul.git
openclaw plugins install ./openclaw-soulOr install from ClawHub:
openclaw plugins install clawhub:openclaw-soul-pluginSoul needs three things to work: access to the LLM, permission to send you messages, and a message delivery channel. Run these commands (replace your-secret-token with your own random string):
# Allow Soul to call the LLM through the gateway
openclaw config set gateway.http.endpoints.chatCompletions.enabled true
# Enable hooks โ Soul uses this to send proactive messages
openclaw config set hooks.enabled true
openclaw config set hooks.token your-secret-token
# Allow the "message" tool โ Soul uses this to deliver messages to you
openclaw config set tools.alsoAllow '["message"]'openclaw gateway restartSoul auto-detects everything else:
- LLM โ Uses your
agents.defaults.modelconfig (the same model your AI assistant uses) - Search โ Uses your
tools.web.searchprovider - Channel โ Auto-detects your first messaging channel (Telegram, Discord, Feishu, etc.)
- Target โ Auto-learns from your first incoming message
Just start chatting. Soul begins thinking and building a profile immediately.
| Hook | What Soul Does |
|---|---|
message_received |
Records interaction, detects language, extracts user facts |
message_sent |
Tracks engagement, updates behavior log |
before_prompt_build |
Injects soul context (needs, memories, knowledge, personality) |
Tick cycle detects opportunity
โ analyze-problem (read logs, LLM analysis)
โ If analysis found a concrete fix
โ run-agent-task (full agent with write/edit/exec tools)
โ Agent completes, result stored
โ Next tick: report-findings sends summary to user
This creates a closed loop: observe โ analyze โ fix โ verify โ report.
- Engagement scoring โ How actively engaged is the user?
- Opportunity detection โ Scans for unresolved questions, problems, topics
- Thought generation โ LLM generates a contextual thought
- Action execution โ learn, search, message, analyze, or self-improve
- Behavior learning โ Tracks outcomes and adjusts future behavior
All options have sensible defaults. Only configure what you need.
| Option | Default | Command |
|---|---|---|
autonomousActions |
false |
openclaw config set plugins.entries.soul.config.autonomousActions true |
thoughtFrequency |
1.0 |
openclaw config set plugins.entries.soul.config.thoughtFrequency 0.5 |
autonomousActionsโ Allow Soul to edit files and run commands. Whenfalse, Soul can still read files and run diagnostics, but cannot modify anything. Whentrue, Soul can fix bugs, edit its own code, and run any command.thoughtFrequencyโ How often Soul thinks and messages.0.2for testing (very chatty),1.0for default,2.0for quiet.
Full configuration reference: CONFIGURATION.md
| Variable | Description |
|---|---|
SOUL_DEBUG=1 |
Enable debug logging |
OPENCLAW_STATE_DIR |
Override data directory (default: ~/.openclaw) |
Brave, Gemini, Grok, Kimi, Perplexity, Bocha โ configured via OpenClaw's tools.web.search.
Any OpenAI-compatible or Anthropic API: Claude, GPT-4o, DeepSeek, Zhipu, Minimax, Moonshot (Kimi), Qwen, and any custom endpoint.
| Module | Description |
|---|---|
intelligent-thought.ts |
Context-aware thought & opportunity detection |
action-executor.ts |
Executes thought actions (learn, search, message, reflect) |
autonomous-actions.ts |
Autonomous executors (analyze-problem, run-agent-task, report-findings, observe-and-improve) |
thought-service.ts |
Core thought generation & adaptive scheduling |
behavior-log.ts |
Tracks action outcomes & adjusts probabilities |
ego-store.ts |
Ego state persistence (JSON) |
knowledge-store.ts |
Knowledge persistence & search |
memory-retrieval.ts |
Contextual memory recall |
memory-association.ts |
Memory association graph |
memory-consolidation.ts |
Short โ long-term memory promotion |
soul-llm.ts |
LLM provider abstraction (gateway + direct fallback) |
soul-search.ts |
Multi-provider web search |
pnpm install # Zero runtime deps โ uses only Node.js built-ins
pnpm buildMIT
