Separate Animas Pattern

Each agent gets its own memory space. Complete isolation between agents.

Overview

The Separate Animas pattern gives each agent (or user) its own Anima — a completely isolated memory space. Memories, knowledge, and identity evolve independently for each agent.

When to Use

  • Agents need isolated memory (no cross-contamination)
  • Multi-user applications (one Anima per user)
  • Different agent roles with fundamentally different memory needs

Architecture

┌──────────────┐     ┌──────────────┐
│  Researcher  │     │   Analyzer   │
│  Anima: R-01 │     │  Anima: A-01 │
│  (isolated)  │     │  (isolated)  │
└──────────────┘     └──────────────┘
       │                    │
       ▼                    ▼
  Own memories         Own memories
  Own knowledge        Own knowledge
  Own identity         Own identity

Code

from elephantasm import Elephantasm, EventType

client = Elephantasm(api_key="sk_live_...")

# Create separate Animas for each agent role
researcher_anima = client.create_anima(
  name="Researcher",
  description="Finds and retrieves information",
  meta={"role": "research"}
)

analyzer_anima = client.create_anima(
  name="Analyzer",
  description="Analyzes data and identifies patterns",
  meta={"role": "analysis"}
)

# Each agent uses its own Anima - completely isolated memories
def researcher_extract(content: str, session_id: str):
  client.extract(EventType.MESSAGE_OUT, content,
                 anima_id=str(researcher_anima.id),
                 session_id=session_id, author="researcher")

Multi-User Example

from elephantasm import Elephantasm

client = Elephantasm(api_key="sk_live_...")

def get_or_create_user_anima(user_id: str):
  """Each user gets their own memory space."""
  anima = client.create_anima(
      name=f"assistant-{user_id}",
      description=f"Personal assistant for user {user_id}",
      meta={"user_id": user_id, "created": "auto"}
  )
  return anima

def handle_request(user_id: str, message: str):
  anima = get_or_create_user_anima(user_id)
  pack = client.inject(anima_id=str(anima.id))
  # ... build prompt, call LLM, extract events ...

Trade-offs

ProsCons
Complete memory isolationNo shared context between agents
Per-user personalizationMore Animas to manage
Independent identity evolutionHigher resource usage
Clean separation of concernsCross-agent insights lost

For multi-user applications, cache Anima IDs by user. Creating an Anima with the same name is idempotent if you handle duplicates in your application layer.