freshcrate
Home > AI Agents > openclaw-soul

openclaw-soul

Soul โ€” Give Your AI Assistant Its Own Inner Life. Autonomous thinking, memory, and self-improvement plugin for OpenClaw

Description

Soul โ€” Give Your AI Assistant Its Own Inner Life. Autonomous thinking, memory, and self-improvement plugin for OpenClaw

README

Soul โ€” Give Your AI Assistant Its Own Inner Life

ClawHub Version License StarsAn 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.

What It Looks Like

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.

How Soul Is Different

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

Key Features

Autonomous Thought Cycle

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.

Proactive Messaging

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.

Autonomous Actions

Soul can take real actions beyond thinking:

  • analyze-problem โ€” Reads files and logs, uses LLM to analyze root cause
  • run-agent-task โ€” Delegates to a full agent with write access (when enabled)
  • report-findings โ€” Proactively sends you a summary of completed analysis
  • observe-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

Long-term Memory

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

Quick Start

1. Install

git clone https://github.com/tommyguolin/openclaw-soul.git
openclaw plugins install ./openclaw-soul

Or install from ClawHub:

openclaw plugins install clawhub:openclaw-soul-plugin

2. Configure

Soul 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"]'

3. Restart gateway

openclaw gateway restart

Soul auto-detects everything else:

  • LLM โ€” Uses your agents.defaults.model config (the same model your AI assistant uses)
  • Search โ€” Uses your tools.web.search provider
  • 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.

How It Works

Hooks into OpenClaw

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)

Self-Improvement Loop

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.

Thought Flow

  1. Engagement scoring โ€” How actively engaged is the user?
  2. Opportunity detection โ€” Scans for unresolved questions, problems, topics
  3. Thought generation โ€” LLM generates a contextual thought
  4. Action execution โ€” learn, search, message, analyze, or self-improve
  5. Behavior learning โ€” Tracks outcomes and adjusts future behavior

Configuration

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. When false, Soul can still read files and run diagnostics, but cannot modify anything. When true, Soul can fix bugs, edit its own code, and run any command.
  • thoughtFrequency โ€” How often Soul thinks and messages. 0.2 for testing (very chatty), 1.0 for default, 2.0 for quiet.

Full configuration reference: CONFIGURATION.md

Environment Variables

Variable Description
SOUL_DEBUG=1 Enable debug logging
OPENCLAW_STATE_DIR Override data directory (default: ~/.openclaw)

Supported Providers

Search (inherits OpenClaw config)

Brave, Gemini, Grok, Kimi, Perplexity, Bocha โ€” configured via OpenClaw's tools.web.search.

LLM (inherits OpenClaw config)

Any OpenAI-compatible or Anthropic API: Claude, GPT-4o, DeepSeek, Zhipu, Minimax, Moonshot (Kimi), Qwen, and any custom endpoint.

Architecture

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

Development

pnpm install   # Zero runtime deps โ€” uses only Node.js built-ins
pnpm build

License

MIT

Release History

VersionChangesUrgencyDate
v2.4.0## Changes - **Don't compete with agent for LLM resources**: When a user sends a message, Soul no longer ticks immediately or makes LLM calls right away. The thought cycle waits for the regular interval (default 60s), and fact/preference extraction is delayed by 2 minutes, giving the agent time to respond first - **Skip idle thought cycle**: When there are no conversations, problems, or user interests to think about, Soul now skips the thought cycle entirely instead of generating a generic exisHigh4/19/2026
v2.3.3## Fixes - **Fix repeat topic detection mismatch**: `recentThoughtTopics` stored only the first 5 significant words, but `isRepeatTopic` compared against ALL words in new content. This made the overlap ratio too low (e.g. 5/15 = 33% < 40% threshold) and identical generic thoughts like "Nothing particular on my mind right now..." passed the dedup check every 5 minutes. Now both sides use the same first-5-word truncationHigh4/19/2026
v2.3.2## Fixes - **Fix auto-learned proactive target not reaching ThoughtService**: `message_received` hook correctly learned the target from the first inbound message but only stored it in the plugin closure, not in ThoughtService itself. Now calls `thoughtService.updateProactiveTarget()` so `send-message` and `report-findings` can use itHigh4/19/2026
v2.3.1## Fixes - **Fix tools.alsoAllow config command**: Updated README to use correct array syntax `'["message"]'` instead of bare `message`High4/19/2026
v2.3.0## Changes - **Strengthened report-findings quality gate**: Soul no longer reports self-modifications (config changes, keyword additions, bug fixes) as user-facing findings. Self-improvement tasks are filtered out at both prompt and regex levels, so users only see genuinely useful external findings - **Broadened self-referential message filter**: Extended filter patterns to catch "Soul ไธบไป€ไนˆ", "Soul ๆฒกๆ‰ง่กŒ", self-configuration changes, and time-sensitive mode modifications that previously leaked thrHigh4/19/2026
v2.2.1 ### Changes - **Simplified install config**: Reduced configSchema from 9 fields to 3 user-facing options (`enabled`, `autonomousActions`, `thoughtFrequency`). Advanced options (checkIntervalMs, proactiveChannel, proactiveTarget, workspaceFiles, llm) still work via raw config but are hidden from the install UI - **enabledByDefault**: Soul activates immediately after install with zero configuration. LLM, messaging channel, and target are all auto-detected from OpenClaw config - **Deduplicate pluHigh4/18/2026
v2.2.0 ### Changes - **Context-aware LLM priority re-ranking**: Soul now uses an LLM call to dynamically re-rank thought action priorities based on conversation context, time of day, and recent action history. Instead of always picking the highest static-priority action, Soul considers what is most valuable right now (e.g., boost proactive-research when user mentions travel, boost observe-and-improve during debugging, avoid repeating the same action type) - **File-based sub-agent result capture**: obHigh4/18/2026
v2.1.0## What's New ### `thoughtFrequency` config option New multiplier that scales all thought generation intervals and action cooldowns. Lower values = more frequent thinking and messaging. ```yaml # In openclaw.yaml under plugins.entries.soul.config: thoughtFrequency: 1.0 # Default. Lower = more frequent (e.g. 0.2 for testing) ``` Examples: - `0.2` โ€” testing: thoughts every ~1 min, messages every ~1 min - `0.5` โ€” chatty: 2x more frequent than default - `1.0` โ€” default: balanced (8-12 min activHigh4/17/2026
v2.0.1## Fixes - **Cap bond-deepen priority at 85**: `bond-deepen` priority grew unbounded after hours of silence, eclipsing `observe-and-improve` (P=90/95). Now capped at 85 so self-modification always wins - **Fix bond-deepen routing hijack**: Bond-deepen thoughts were incorrectly routed to `run-agent-task` when stale completed tasks existed. The `bond-deepen โ†’ none` guard now runs before global task routing - **Strip assistant-like prefixes from report-findings**: Enhanced regex strips full prefixMedium4/12/2026
v2.0.0## Changes - **Autonomous actions**: Soul can now read logs, analyze code, and investigate problems via OpenClaw's gateway tool API. When it detects users discussing bugs, errors, optimizations, or improvements, it autonomously reads relevant files and reports findings - **Task tracking**: New `AutonomousTask` system tracks multi-step work across tick cycles, persisted across restarts - **Permission model**: New `autonomousActions` config option (default: `false`). Read operations always alloweMedium4/11/2026
v1.10.0## Changes - **Block ego-state search queries**: Soul no longer searches for internal state descriptions like "ๅฎ‰ๅ…จ need could improve" that produced irrelevant results. Queries >60 chars (full user messages) are also rejected - **Fix goal tracking**: Goals now use stable IDs so progress tracking works regardless of language. Existing goals are automatically migrated on load - **Share knowledge from conversation follow-ups**: When Soul learns something from following up on a user's topic, the valMedium4/10/2026
v1.9.1## Fixes - **Block LLM error messages from reaching users**: When the LLM provider times out or returns error strings (e.g. "Request timed out before a response was generated..."), Soul now detects and rejects these as thought content instead of forwarding them as proactive messages - **Remove bond-deepen suggestedAction override**: bond-deepen opportunities no longer carry `suggestedAction: "send-message"`, which was bypassing the v1.8.0 fix that correctly routed bond-deepen to actionType "nonMedium4/10/2026
v1.9.0## Changes - **Problem-driven thoughts**: Soul now focuses on the user's actual conversations and problems instead of ego-driven self-reflection. `conversation-replay` is the dominant thought type (weight 90 vs ego types at 5) - **Search from user's actual words**: Queries are extracted directly from the user's original messages instead of being LLM-summarized into generic keywords - **No fake learning**: Removed LLM reflection fallback that fabricated knowledge. Soul only records knowledge froMedium4/10/2026
v1.8.1## Changes - **Topic-level thought deduplication**: Soul now tracks the topics of recent thoughts and skips thoughts that overlap >40% with a recent one. Prevents infinite loops where Soul keeps ruminating on the same subject - **Search query quality filter**: Generic single-word queries like "code", "ai", "app" are now rejected before wasting API calls - **LLM rate limiting**: Soul enforces a minimum 10-second gap between LLM calls to avoid overloading the provider (fixes MiniMax 529 overloadeMedium4/10/2026
v1.8.0## Changes - **Non-blocking message processing**: The `message_received` hook now runs LLM calls in the background instead of blocking the agent turn, preventing feishu streaming card timeouts - **Token cost optimization**: Short messages (<15 chars) skip LLM extraction entirely, saving ~600 tokens per short message ## Fixes - **Strengthened proactive message value gate**: Added rejection rules for meta-messages about the bot itself (offering to help, debug, read logs) - **Disabled bond-deepeMedium4/10/2026
v1.7.3## Fixes - Fix duplicate ThoughtService creation when register() called multiple times - Downgrade repetitive register() logs from INFO to DEBUG - Add 5s startup delay to avoid transient gateway fetch errorsMedium4/9/2026
v1.7.0## Changes - **Adaptive thought frequency**: Thoughts are no longer generated at a fixed 5-minute interval. Soul now computes an engagement score based on interaction recency, frequency, and content substance, then adjusts thought intervals accordingly: 8-12 min for active substantive conversations, 25-40 min for casual/test messages, 20-45 min when user is away - **Smart content filtering**: Soul now distinguishes genuine questions from test messages, exclamations, meta-remarks about the bot, Medium4/9/2026
v1.6.0### Changes - **Replace child_process with fetch**: Removed `execSync`/`child_process` dependency that triggered OpenClaw's security scanner ("dangerous code patterns detected"). Proactive messages are now sent via gateway's `/hooks/agent` HTTP endpoint - **Rename package to `openclaw-soul-plugin`**: Package name now matches ClawHub plugin entry - **Remove SKILL.md**: Removed incorrectly created file ### Breaking Change Proactive messaging now requires hooks configuration in `openclaw.yaml`: Medium4/6/2026
v1.5.1### Changes - Recommend source install over ClawHub in README (ClawHub install requires OpenClaw 2026.4.0+) - Rename package to `openclaw-soul-plugin` for ClawHub compatibility - Remove incorrect SKILL.md file ### Install ```bash git clone https://github.com/tommyguolin/openclaw-soul.git openclaw plugins install ./openclaw-soul ```Medium4/6/2026
v1.5.0## What's New ### Universal LLM via Gateway Local API Soul now calls the gateway's `/v1/chat/completions` endpoint by default. The gateway handles all provider auth, routing, OAuth, and API format translation โ€” no API keys or env vars needed. Works in every deployment (daemon, foreground, any provider). ### Language Awareness Soul detects the user's language from messages (Chinese, English, Japanese, Korean) and stores it. All LLM prompts include language instructions so proactive messages matMedium4/6/2026
v1.3.1### Changes - **Value-driven proactive messaging**: Soul now only sends messages when it has something valuable to share โ€” no more generic "I miss you" or "ๅฅฝไน…ๆฒก่Š" messages - LLM-driven message generation: proactive messages are crafted using user facts, recent conversations, and acquired knowledge - Value gate: if the LLM determines there's nothing worth saying, it responds `NO_MESSAGE` and the message is silently skipped - Removed dual send-path: proactive messaging now handled exclusively by aMedium4/4/2026
v1.3.0### Changes - Per-type action cooldowns: learn-topic (15 min), search-web (10 min), self-reflect (5 min) instead of a single 30-min block for all actions - Re-enabled `recall-memory` action for `memory-resurface` thoughts (was commented out) - Added action routing for `help-offer` (โ†’ send-message) and `threat-warning` (โ†’ self-reflect) - Boosted weights for user-valuable thought types: `learn-topic`, `search-web`, `help-offer` - Relaxed action probability gates: learn-topic 30โ†’40%, search-web 20Medium4/4/2026
v1.2.0### Changes - Goal persistence: `create-goal` action now saves goals to ego store instead of discarding them - Chinese sentiment analysis: added Chinese word patterns for positive/negative/negators/intensifiers - User preference extraction: wired up `extractUserPreferences` in message hooks (was dead code) ### Fixes - Fixed intensifier proximity bug โ€” "very helpful" now correctly detected (was missing space) - Increased LLM `max_tokens` from 150 to 300 to prevent truncated thought generation Medium4/4/2026

Dependencies & License Audit

Loading dependencies...

Similar Packages

GENesis-AGIAutonomous AI agent with persistent memory, self-learning, and earned autonomy. Cognitive partner that remembers, learns, and evolves.v3.0a8
serverlessclawOfficial ServerlessClaw: The authoritative autonomous AI agent swarm for AWS. Zero idle cost, self-evolving, and infinite scale. Powered by OpenClaw.main@2026-04-21
openclaw-qaOpenClaw Q&A ็คพๅŒบ โ€” AI Agent ่ฎฐๅฟ†็ณป็ปŸใ€ๅคšAgentๆžถๆž„ใ€่ฟ›ๅŒ–็ณป็ปŸใ€ๅ…ท่บซAI | ้พ™่™พ่Œถ้ฆ† ๐Ÿฆžmain@2026-04-10
teleton-agentTeleton: Autonomous AI Agent for Telegram & TON Blockchainv0.8.6
reinaAutonomous AI agent for Crustocean, powered by Hermes Agent from Nous Researchv1.0.0