Skip to main content

Daily Workflows & Automation

Automate daily memory management tasks with MEMANTO.

What Are Daily Workflows?

Daily workflows are automated tasks that run on a schedule:
  • Daily Summaries - Compile all day’s memories into a summary
  • Conflict Detection - Find contradictory memories
  • Memory Validation - Verify important memories
  • Export & Backup - Regular memory exports

Daily Summaries

What They Include

A daily summary shows:
  • Total memories created today
  • Breakdown by memory type
  • Key facts discovered
  • Important decisions made
  • Potential issues detected

Generate Summary - CLI

memanto daily-summary
Output:
═══════════════════════════════════════════════════════
Daily Memory Summary: customer-support
Date: 2025-03-30
═══════════════════════════════════════════════════════

<Icon icon="chart-simple" /> STATISTICS
├── Total Memories: 42
├── New Today: 8
├── Updated: 2
└── Archived: 1

<Icon icon="folder" /> BY TYPE
├── facts: 15
├── preferences: 8
├── events: 12
├── commitments: 4
├── decisions: 2
└── other: 1

<Icon icon="star" /> KEY FACTS
- Customer Alice is in Finance dept
- Order #12345 status: shipped
- Payment method: credit card on file

<Icon icon="lightbulb" /> IMPORTANT DECISIONS
- Chose to prioritize email support
- Approved custom integration request

<Icon icon="bullseye" /> COMMITMENTS
- Deliver API docs by Friday
- Complete customer training by end of month

⚠️  ISSUES DETECTED
- 1 potential conflict found
- 1 memory with low confidence

Generate via REST API

response = httpx.post(
    f"http://localhost:8000/api/v2/agents/{agent_id}/daily-summary",
    headers={
        "Authorization": f"Bearer {api_key}",
        "X-Session-Token": session_token
    }
)
summary = response.json()
print(f"Today: {summary['memory_count']} memories")
print(f"Facts: {summary['fact_count']}")

Conflict Detection

Find Contradictions - CLI

memanto conflicts
Output:
═══════════════════════════════════════════════════════
Conflict Detection: customer-support
═══════════════════════════════════════════════════════

Found 2 Potential Conflicts:

CONFLICT 1 (Confidence: 0.88)
─────────────────────────────────
Contradiction Type: Direct Opposite
Memory A (older):  "Customer is in finance team"
Memory B (newer):  "Customer moved to marketing team"
Created: A (2025-03-15), B (2025-03-28)
Action:  MANUAL REVIEW RECOMMENDED

CONFLICT 2 (Confidence: 0.75)
─────────────────────────────────
Contradiction Type: Likely Inconsistent
Memory A (older):  "Project deadline is April 15"
Memory B (newer):  "Project deadline was extended to May 1"
Created: A (2025-03-10), B (2025-03-25)
Action:  UPDATE RECOMMENDED

═══════════════════════════════════════════════════════
Next Steps:
1. Review each conflict
2. Supersede outdated memories
3. Re-run to verify resolution

Resolve Conflicts Interactively

When conflicts are detected, you can resolve them:
memanto conflicts
After viewing conflicts:
ACTION MENU:

For Conflict 1:
[1] Mark Memory A (2025-03-15) as outdated
[2] Mark Memory B (2025-03-28) as outdated
[3] Keep both (document difference)
[4] View full context
[5] Skip for now

Choose action (1-5): 1

✓ Memory A marked as superseded by Memory B
  New current state: "Customer is in marketing team"

Via REST API

# Detect conflicts
response = httpx.post(
    f"http://localhost:8000/api/v2/agents/{agent_id}/conflicts",
    headers={
        "Authorization": f"Bearer {api_key}",
        "X-Session-Token": session_token
    }
)
conflicts = response.json()["conflicts"]

for conflict in conflicts:
    print(f"Conflict: {conflict['memory_a']} vs {conflict['memory_b']}")
    print(f"Confidence: {conflict['confidence']}")

    # Resolve by superseding old memory
    if conflict['confidence'] > 0.8:
        httpx.post(
            f"http://localhost:8000/api/v2/agents/{agent_id}/supersede/{conflict['old_memory_id']}",
            json={
                "new_content": conflict['newer_memory_content'],
                "reason": "Conflict resolution - newer info"
            },
            headers={
                "Authorization": f"Bearer {api_key}",
                "X-Session-Token": session_token
            }
        )

Scheduled Tasks

Enable Daily Summary Schedule

Run summaries automatically at a specific time:
memanto schedule enable
When prompted:
What time should daily summaries run? (HH:MM in 24-hour format, UTC)
Example: 09:00 for 9 AM UTC
Enter time: 08:00

✓ Daily summaries enabled
  Time: 08:00 UTC
  Next run: 2025-03-31 08:00:00 UTC

Check Schedule Status

memanto schedule status
Output:
Daily Summary Schedule

Status:    ENABLED
Time:      08:00 UTC
Last Run:  2025-03-30 08:00:00 UTC
Next Run:  2025-03-31 08:00:00 UTC

Disable Schedule

memanto schedule disable
Output:
✓ Daily summaries disabled

Batch Operations

Batch Store Memories

Store multiple memories efficiently:
# From JSON file
memanto remember --batch batch.json
Example batch.json:
[
  {"content": "Customer Alice", "type": "fact"},
  {"content": "Prefers email", "type": "preference"},
  {"content": "PST timezone", "type": "fact"},
  {"content": "Will deliver report Friday", "type": "commitment"}
]
Output:
✓ Batch stored successfully
  Stored: 4 memories
  Status: queued for processing
Via REST API:
memories = [
    {"content": "Customer Alice", "type": "fact"},
    {"content": "Prefers email", "type": "preference"},
    {"content": "PST timezone", "type": "fact"},
    {"content": "Will deliver report Friday", "type": "commitment"}
]

response = httpx.post(
    f"http://localhost:8000/api/v2/agents/{agent_id}/batch-remember",
    json={"memories": memories},
    headers={
        "Authorization": f"Bearer {api_key}",
        "X-Session-Token": session_token
    }
)
data = response.json()
print(f"Stored {len(data['memory_ids'])} memories")

Memory Export & Backup

Export to Markdown

memanto memory export
Creates {agent_id}_memories.md:
# Agent: customer-support
Date: 2025-03-30
Total Memories: 42

## Facts
- Customer Alice Johnson (2025-03-20)
- Works in Finance (2025-03-20)
- PST timezone (2025-03-22)

## Preferences
- Email communication (2025-03-21)
- Concise responses (2025-03-22)

## Events
- Initial contact: 2025-03-20
- Follow-up call: 2025-03-25

## Commitments
- Will deliver report by Friday (2025-03-29)
- Attend quarterly review (2025-04-05)

Export to JSON

memanto memory export --format json
Creates machine-readable JSON:
{
  "agent_id": "customer-support",
  "export_date": "2025-03-30T16:45:00Z",
  "memory_count": 42,
  "memories": [
    {
      "id": "mem_abc123",
      "content": "Customer Alice Johnson",
      "type": "fact",
      "created_at": "2025-03-20T10:30:00Z",
      "confidence": 1.0
    }
  ]
}

Automated Backups

Set up a cron job for daily exports:
#!/bin/bash
# backup_memories.sh

AGENT_ID="customer-support"
BACKUP_DIR="./backups"
DATE=$(date +%Y-%m-%d)

mkdir -p "$BACKUP_DIR"
memanto memory export --output "$BACKUP_DIR/${AGENT_ID}_${DATE}.md"

# Keep only last 30 days
find "$BACKUP_DIR" -type f -name "${AGENT_ID}_*.md" -mtime +30 -delete
Add to crontab:
crontab -e

# Add line:
0 0 * * * /path/to/backup_memories.sh

Workflow Automation Examples

Daily Review Workflow

def daily_workflow(agent_id: str):
    """Run complete daily workflow."""

    # 1. Generate summary
    print("📊 Generating daily summary...")
    summary = httpx.post(
        f"http://localhost:8000/api/v2/agents/{agent_id}/daily-summary",
        headers={...}
    ).json()
    print(f"  Total memories: {summary['memory_count']}")
    print(f"  New today: {summary['new_today']}")

    # 2. Check for conflicts
    print("🔍 Checking for conflicts...")
    conflicts_resp = httpx.post(
        f"http://localhost:8000/api/v2/agents/{agent_id}/conflicts",
        headers={...}
    ).json()
    if conflicts_resp['conflicts']:
        print(f"  ⚠️  Found {len(conflicts_resp['conflicts'])} conflicts")
    else:
        print("  ✓ No conflicts detected")

    # 3. Export backup
    print("💾 Exporting backup...")
    # memanto memory export command

    # 4. Report
    print("✓ Daily workflow complete")

Weekly Analysis

def weekly_workflow(agent_id: str):
    """Run weekly memory analysis."""

    # Recall all new memories from past week
    week_ago = (datetime.now() - timedelta(days=7)).isoformat()

    response = httpx.get(
        f"http://localhost:8000/api/v2/agents/{agent_id}/recall/changed-since",
        params={"changed_since": week_ago},
        headers={...}
    )
    new_memories = response.json()["memories"]

    # Analyze patterns
    type_counts = {}
    for mem in new_memories:
        mem_type = mem['type']
        type_counts[mem_type] = type_counts.get(mem_type, 0) + 1

    print(f"Weekly Summary ({week_ago}):")
    for mem_type, count in sorted(type_counts.items(), key=lambda x: x[1], reverse=True):
        print(f"  {mem_type}: {count}")

Best Practices

DO

  • Run daily summaries to track memory growth
  • Check conflicts weekly
  • Export backups regularly
  • Use batch operations for large imports
  • Schedule recurring tasks for consistency

DON’T

  • Ignore detected conflicts
  • Let old memories accumulate unchecked
  • Skip backups
  • Manually process memories that could be automated
  • Leave failed workflows unreviewed

Next Steps


Automate your memory workflows for consistent, reliable agent operations!