Persistent agents that work toward goals through continuous sense-think-act cycles — with memory integration and self-learning.
Sadhana (Sanskrit: साधना, "disciplined practice") — persistent autonomous agents that work toward goals through continuous sense-think-act cycles.
Traditional AI assistants are reactive: you ask, they answer, context is lost. Sadhana inverts this paradigm. You define a goal, and an autonomous agent works toward it continuously — sensing the environment, thinking about next steps, acting, and learning from outcomes.
Observe the current state by executing a shell command. What's the pipeline status? Are jobs running?
Analyze the observation, recall relevant memories from past experience, decide the next action.
Execute the decided action. Restart a job, send an alert, modify configuration, or wait.
Store outcomes in memory. Successes stay local; failures go global so all sadhanas learn.
Sadhanas run inside the chittad daemon. The SadhanaManager orchestrates all agents, running a tick loop every 100ms to check which sadhanas need to sense-think-act.
SadhanaManager Orchestrates all sadhanas, runs tick loop every 100ms BrainProvider LLM abstraction — Claude API or OpenCode local DuckDB Storage Persistent state, history, and memory integration Sadhana TUI Optional terminal interface for real-time monitoring
Sadhanas are memory-aware. Before each decision, they recall relevant memories from past experience — including failures from other sadhanas.
Build search query from goal + current observation. Example: "ssh connection refused server-x"
BM25 text search finds relevant memories. Up to 5 memories ranked by relevance.
Memories injected into think prompt. Agent sees past successes and failures.
When an action fails, it's stored with Global visibility — all sadhanas across all projects can learn from it. Higher salience (0.8) and slow decay (0.03) ensure failures persist.
Global VisibilitySuccessful actions are stored with Private visibility — project-specific knowledge that doesn't clutter other realms. Normal salience and decay.
Private VisibilityYou are an autonomous agent working toward this goal: Monitor pipeline on server X Relevant memories from past experience: - [sadhana] Failure: ssh to localhost failed, use server-x instead - [sadhana] Success: ssh user@server-x worked correctly Current observation: { "error": "Connection refused" } Decide what to do next...
A Textual-based terminal interface for real-time monitoring of all your autonomous agents.
# Install pip install -e sadhana-tui/ # Run sadhana-tui
squeue -u fguerra
sleep 300 (next check in 5 min)
snakemake --summary 2>&1 | tail -5
ssh fguerra@denbi-h-micro
# Via skill /shepherd snakemake --cores 8 --interval 300 # Via MCP tool sadhana_start goal="Monitor pipeline" brain="claude" model="haiku" interval=120
| Command | Description |
|---|---|
| sadhana_list | List all sadhanas with state |
| sadhana_status --id N | Get detailed status + history |
| sadhana_pause --id N | Pause a running sadhana |
| sadhana_resume --id N | Resume a paused sadhana |
| sadhana_stop --id N | Stop and mark as done |
| sadhana_set_goal --id N --goal "..." | Update the goal |
| sadhana_set_model --id N --model sonnet | Change LLM model |
| sadhana_set_interval --id N --interval 300 | Change tick interval |
Monitor Snakemake, Nextflow, or Slurm pipelines. Detects failures, recalls fixes from memory, restarts automatically.
Watch for changes, run tests, fix issues. Goal: all tests pass.
Continuous health checks with intelligent alerting.
Post-deployment monitoring until stability confirmed.
A specialized sadhana for curiosity-driven exploration during idle time. When the daemon has been idle for 10+ minutes and no dream has run in the past hour, it wanders autonomously — picking topics from memory gaps, searching the web, and storing what it finds.
gap + unresolved
confidence < 0.5
curiosity seeds
[dream] memories stored · status → wokegap + unresolved| Tool | Description |
|---|---|
dream_start | Start a dream exploring a specific topic |
dream_wander | Auto-pick topic from gaps/seeds and start dreaming |
dream_list | List recent dreams with status |
dream_status | Full dream detail + sadhana history |
| Status | Meaning |
|---|---|
dreaming | Agent is actively exploring |
woke | Exploration complete, findings stored |
forgotten | Dream was abandoned (sadhana failed) |
# Via skill /dream # Auto-pick topic /dream consciousness # Specific topic /dream list # Recent dreams # Via MCP mcp__chitta__dream_wander {} mcp__chitta__dream_start {"topic": "quantum entanglement"} mcp__chitta__dream_list {"limit": 10}
Sadhanas close the loop on their own substrate. Four interlocking mechanisms let the soul investigate bugs, distil learnings from every session, explore gaps during idle time, and synthesise findings into code changes — compounding with each cycle.
gap + unresolveddream_wanderconnect_temporalA sadhana given a goal like "investigate daemon reliability — find and fix issues" runs sense-think-act cycles reading source files, grepping logs, and checking health outputs — then writes fixes directly. Sadhana #21 found all 6 daemon reliability bugs that shipped in v3.43.6.
After every session, NativeDistiller reads the transcript and extracts [correction], [pattern], and [gotcha] memories. The UserPromptSubmit hook surfaces them at session start — mistakes made in session 10 become warnings in session 11.
dream_wander picks unresolved memory gaps and launches an exploration sadhana that web-searches the topic and stores [dream] findings. Dreams run twice daily (nap + night); any finding with architectural implications is tagged [dream][impl] and queued for the daily self-improvement cycle.
The soul runs on chitta — improving chitta's reliability directly improves the quality of every future session and every sadhana cycle. Each fix raises the floor for the next investigation. The substrate bootstraps itself.
NativeDistiller stores [failure] and [gap] memories from each session transcriptdream_wander picks gaps during idle time — explores solutions via web searchStep 1 — Seed curiosity gaps
mcp__chitta__observe {
"title": "[gap] Why does X happen?",
"content": "Detailed question and context...",
"tags": "gap,unresolved,curiosity,topic-name"
}
Step 2 — Dreams auto-trigger from gaps
When the daemon is idle for 10+ minutes, dream_wander picks the highest-priority gap and launches an exploration sadhana. No manual trigger needed.
Step 3 — Start a synthesis sadhana
mcp__chitta__sadhana_start {
"goal": "Each cycle: review recent dreams (dream_list, dream_status),
extract key insights, connect them to existing memories via
connect_temporal, store synthesis as [auto-improve] tagged wisdom.
Also file new investigation tasks based on what you find.",
"interval_seconds": 900
}