Memory System API

MCP TOOLS

Complete 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'optional

Section to read (default: all)

workingDirectorystringoptional

Working directory

Returns

Notepad content (selected section)

Example

notepad_read({ section: "priority" })

notepad_write_priority

Set Priority Context (replaces existing)

Parameters

contentstringrequired

Content to write (recommend under 500 chars)

workingDirectorystringoptional

Working 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

contentstringrequired

Content to add

workingDirectorystringoptional

Working 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

contentstringrequired

Content to add

workingDirectorystringoptional

Working 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

daysOldnumberoptional

Age threshold in days (default: 7)

workingDirectorystringoptional

Working directory

Returns

Number of entries removed

Example

notepad_prune({ daysOld: 14 })

notepad_stats

Get notepad statistics

Parameters

workingDirectorystringoptional

Working 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'optional

Section to read (default: all)

workingDirectorystringoptional

Working directory

Returns

Project memory content

Example

project_memory_read({ section: "techStack" })

project_memory_write

Write/update project memory (supports merge)

Parameters

memoryRecord<string, any>required

Memory object to write

mergebooleanoptional

Merge with existing (default: false)

workingDirectorystringoptional

Working 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

categorystringrequired

Note category (e.g., "build", "test", "deploy")

contentstringrequired

Note content

workingDirectorystringoptional

Working 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

directivestringrequired

Directive content

contextstringoptional

Directive context

priority'high' | 'normal'optional

Priority (default: normal)

workingDirectorystringoptional

Working 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'required

Mode to read

workingDirectorystringoptional

Working 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'required

Mode to write

activebooleanoptional

Mode active state

iterationnumberoptional

Current iteration

max_iterationsnumberoptional

Max iterations

current_phasestringoptional

Current phase

stateRecord<string, any>optional

Additional custom fields

workingDirectorystringoptional

Working 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'required

Mode to clear

workingDirectorystringoptional

Working directory

Returns

Success message

Example

state_clear({ mode: "autopilot" })

state_list_active

List all currently active modes

Parameters

workingDirectorystringoptional

Working 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'optional

Mode to check (omit for all)

workingDirectorystringoptional

Working directory

Returns

Active status, file paths, state contents

Example

state_get_status({ mode: "ralph" })

Supported Modes

autopilotultrapilotswarmpipelineralphultraworkultraqaecomoderalplan