Skip to content

Implement NATS KV Store for Agent Memory #11

@wonderwomancode

Description

@wonderwomancode

Overview

Use NATS JetStream KV Store to provide persistent memory for agents across sessions.

Why NATS KV

  • Already running NATS JetStream for messaging
  • Zero additional infrastructure
  • Distributed, can sync across Akash deployments
  • Key-value interface is simple for agent context

Proposed Structure

agent_memory bucket:
├── senku/context.json     # Senku's current project context
├── senku/decisions.json   # Past architectural decisions
├── lain/threat_model.json # Security findings
├── shared/glossary.json   # Team-wide terminology
└── shared/handoffs.json   # Recent handoff summaries

Acceptance Criteria

  • Create agent_memory KV bucket in NATS JetStream
  • Create decisions KV bucket for architectural decisions
  • Write helper scripts for agents to read/write memory
  • Implement memory expiration/TTL for stale data
  • Add memory sync to swarm startup script
  • Document usage patterns

Implementation

# Create buckets
nats kv add agent_memory --history 10 --ttl 7d
nats kv add decisions --history 5 --ttl 30d

# Agent writes context
nats kv put agent_memory "senku/context" '{"current_task": "...", "blockers": []}'

# Agent reads context
nats kv get agent_memory "senku/context"

Assigned Agent

@senku - Memory architecture design

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions