Memory System API
MCP TOOLSComplete reference for Model Context Protocol (MCP) tools that power Diverga's Memory System.
Memory Sections
Priority Context
Always loaded on session start (max 500 chars)
Working Memory
Timestamped entries, auto-pruned after 7 days
Manual Section
Never auto-pruned, permanent notes
Notepad Tools
Session memory at {worktree}/.omc/notepad.md
notepad_read
Read notepad content
Parameters
section'all' | 'priority' | 'working' | 'manual'optionalSection to read (default: all)
workingDirectorystringoptionalWorking directory
Returns
Notepad content (selected section)
Example
notepad_read({ section: "priority" })notepad_write_priority
Set Priority Context (replaces existing)
Parameters
contentstringrequiredContent to write (recommend under 500 chars)
workingDirectorystringoptionalWorking directory
Returns
Success message
Example
notepad_write_priority({
content: "Research question: How does AI improve learning?"
})notepad_write_working
Add entry to Working Memory (timestamped)
Parameters
contentstringrequiredContent to add
workingDirectorystringoptionalWorking directory
Returns
Success message
Example
notepad_write_working({
content: "Decided to use Two-Stage MASEM for mediation analysis"
})notepad_write_manual
Add entry to MANUAL section (permanent)
Parameters
contentstringrequiredContent to add
workingDirectorystringoptionalWorking directory
Returns
Success message
Example
notepad_write_manual({
content: "Always use Hedges' g for meta-analysis effect sizes"
})notepad_prune
Remove old Working Memory entries
Parameters
daysOldnumberoptionalAge threshold in days (default: 7)
workingDirectorystringoptionalWorking directory
Returns
Number of entries removed
Example
notepad_prune({ daysOld: 14 })notepad_stats
Get notepad statistics
Parameters
workingDirectorystringoptionalWorking directory
Returns
Size, entry count, oldest entry
Example
notepad_stats()
Project Memory Tools
Persistent project info at {worktree}/.omc/project-memory.json
project_memory_read
Read project memory
Parameters
section'all' | 'techStack' | 'build' | 'conventions' | 'structure' | 'notes' | 'directives'optionalSection to read (default: all)
workingDirectorystringoptionalWorking directory
Returns
Project memory content
Example
project_memory_read({ section: "techStack" })project_memory_write
Write/update project memory (supports merge)
Parameters
memoryRecord<string, any>requiredMemory object to write
mergebooleanoptionalMerge with existing (default: false)
workingDirectorystringoptionalWorking directory
Returns
Success message
Example
project_memory_write({
memory: {
techStack: ["Python", "LangChain", "Qdrant"],
build: "pip install -r requirements.txt"
},
merge: true
})project_memory_add_note
Add categorized note
Parameters
categorystringrequiredNote category (e.g., "build", "test", "deploy")
contentstringrequiredNote content
workingDirectorystringoptionalWorking directory
Returns
Success message
Example
project_memory_add_note({
category: "analysis",
content: "Use MASEM for mediation meta-analysis"
})project_memory_add_directive
Add persistent user directive (survives compaction)
Parameters
directivestringrequiredDirective content
contextstringoptionalDirective context
priority'high' | 'normal'optionalPriority (default: normal)
workingDirectorystringoptionalWorking directory
Returns
Success message
Example
project_memory_add_directive({
directive: "Always use TypeScript strict mode",
priority: "high"
})State Management Tools
All state stored at {worktree}/.omc/state/{mode}-state.json
state_read
Read state for a specific mode
Parameters
mode'autopilot' | 'ultrapilot' | 'swarm' | 'pipeline' | 'ralph' | 'ultrawork' | 'ultraqa' | 'ecomode' | 'ralplan'requiredMode to read
workingDirectorystringoptionalWorking directory
Returns
State JSON data or none
Example
state_read({ mode: "autopilot" })state_write
Write state for a mode (use with caution)
Parameters
mode'autopilot' | 'ultrapilot' | 'swarm' | 'pipeline' | 'ralph' | 'ultrawork' | 'ultraqa' | 'ecomode' | 'ralplan'requiredMode to write
activebooleanoptionalMode active state
iterationnumberoptionalCurrent iteration
max_iterationsnumberoptionalMax iterations
current_phasestringoptionalCurrent phase
stateRecord<string, any>optionalAdditional custom fields
workingDirectorystringoptionalWorking directory
Returns
Success message
Example
state_write({
mode: "autopilot",
active: true,
iteration: 3,
current_phase: "implementation"
})state_clear
Clear/delete state for a mode
Parameters
mode'autopilot' | 'ultrapilot' | 'swarm' | 'pipeline' | 'ralph' | 'ultrawork' | 'ultraqa' | 'ecomode' | 'ralplan'requiredMode to clear
workingDirectorystringoptionalWorking directory
Returns
Success message
Example
state_clear({ mode: "autopilot" })state_list_active
List all currently active modes
Parameters
workingDirectorystringoptionalWorking directory
Returns
Array of modes with active state files
Example
state_list_active()
state_get_status
Detailed status for a mode or all modes
Parameters
mode'autopilot' | 'ultrapilot' | 'swarm' | 'pipeline' | 'ralph' | 'ultrawork' | 'ultraqa' | 'ecomode' | 'ralplan'optionalMode to check (omit for all)
workingDirectorystringoptionalWorking directory
Returns
Active status, file paths, state contents
Example
state_get_status({ mode: "ralph" })Supported Modes
autopilotultrapilotswarmpipelineralphultraworkultraqaecomoderalplan