agentleFS
shyftlabsshyftlabs/continuum/.claude/skills/continuum-memory/SKILL.md

continuum-memory

Skill84 starsChanged 6 months agoApache-2.0View on GitHub

Configure and use Continuum's two-tier memory system — mem0+Qdrant/Milvus for long-term facts, Redis for short-term sessions, with multi-tenant scopes (USER / AGENT / SHARED / RUN / CONVERSATION). Invoke when the user asks about "remember", "user preferences", "long-term memory", "vector search over memories", "multi-tenant isolation", "PII filtering on memory writes", "Milvus", "Qdrant", or memory-related errors.

  • Reads credentials

The file

We split this skill into the rules it gives an agent

6 rules. About 0 are common, 1 is distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Default is Milvus. Switch via env var:

    line 25
  2. Very specific:

    Every async method has a *_sync counterpart.

    line 99
  3. Very specific:

    Don't pass role= / content= to SessionClient.add_message — use ChatMessage(...).

    line 212
  4. Very specific:

    Don't expect memory to work without OPENAI_API_KEY set — the default mem0 embedder is OpenAI's.

    line 214
  5. Very specific:

    Don't mix the two MemoryScope types — the enum goes into AgentMemoryConfig.

    line 217
  6. Very specific:

    Don't use client.reset() casually — it wipes the entire vector store.

    line 219

≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Continuum Memory Skill

Authoritative sources: docs/memory.md and docs/session.md.


Two layers

LayerClassBackendPurpose
Short-termSessionClientRedis (port 6380)Conversation history this session
Long-termMemoryClientmem0 + Qdrant or MilvusFacts extracted across sessions

AgentRunner uses both automatically when user_id and session_id are passed.

Vector store selection

Default is Milvus. Switch via env var:

VECTOR_STORE_PROVIDER=milvus      # default — Milvus (port 19530)
VECTOR_STORE_PROVIDER=qdrant      # Qdrant (port 6333)

Milvus config:

MILVUS_HOST=localhost
MILVUS_PORT=19530
MILVUS_TOKEN=                     # for Zilliz Cloud
MILVUS_COLLECTION=orchestrator_memories

Qdrant config:

QDRANT_HOST=localhost
QDRANT_PORT=6333
QDRANT_API_KEY=                   # for Qdrant Cloud
QDRANT_COLLECTION=orchestrator_memories

Quick agent setup

from continuum.agent import BaseAgent
from continuum.agent.config import AgentMemoryConfig
from continuum.agent.types import MemoryScope

agent = BaseAgent(
    name="assistant",
    instructions="...",
    memory_config=AgentMemoryConfig(
        search_memories=True,
        store_memories=True,
        search_scope=MemoryScope.USER,        # ENUM, not the dataclass
        store_scope=MemoryScope.USER,
        search_limit=5,
    ),
)
resp = await runner.run(agent, "...", user_id="u1", session_id="s1")

Direct memory access

from continuum.memory import MemoryClient

client = MemoryClient()                       # uses env defaults

# add (fact extraction via LLM)
await client.add(
    messages=[{"role": "user", "content": "I'm vegetarian"}],
    user_id="u1",
)

# semantic search
result = await client.search("dietary preferences", user_id="u1", limit=5)
for entry in result.results:
    print(entry.memory)

# CRUD
entry = await client.get(memory_id)
all_entries = await client.get_all(user_id="u1")
await client.update(memory_id, "Updated text")
await client.delete(memory_id)
await client.delete_all(user_id="u1")         # wipe a user's memories

Every async method has a *_sync counterpart.


Scopes (the two MemoryScope types — read carefully)

Agent-side enum (use here)

from continuum.agent.types import MemoryScope     # str-Enum
MemoryScope.SHARED / USER / AGENT / RUN / CONVERSATION
# Pass to AgentMemoryConfig

Memory-side dataclass (different!)

from continuum.memory.scopes import MemoryScope   # dataclass
MemoryScope.user("u1")
MemoryScope.shared()
MemoryScope.agent("billing")
MemoryScope.run("run_abc")
# Used internally; rarely passed by user code
ScopeVisible to
SHAREDAll agents, all users
USEROne user, all agents (default)
AGENTOne agent, all users
RUNOne run only — ephemeral
CONVERSATIONOne session only — scoped to session_id

Sessions

from continuum.session import SessionClient
from continuum.llm.types import ChatMessage

client = SessionClient()
sid = await client.get_or_create_session(user_id="u1", agent_id="support")
await client.add_message(sid, ChatMessage(role="user", content="Hi"))   # NOT role= kwarg
history = await client.get_conversation_history(sid)

Sessions cascade to long-term memory by default (store_in_memory=True); set False for ephemeral chats.


PII / extraction hooks

agent = BaseAgent(
    name="assistant",
    memory_config=AgentMemoryConfig(
        store_memories=True,
        pre_store_filter=lambda text: redact(text),       # sanitize before mem0
        on_stored=lambda items: log.info(f"stored {len(items)} memories"),
        extraction_prompt="Extract preferences and facts only.",
    ),
)

IntelligentMemoryClient (richer)

Adds importance scoring, time decay, entity memory, and user profiles.

from continuum.memory import IntelligentMemoryClient, IntelligenceConfig

client = IntelligentMemoryClient(
    intelligence_config=IntelligenceConfig(
        enable_entity_memory=True,
        enable_user_profiles=True,
        enable_scoring=True,
        enable_decay=True,
        prune_threshold=0.15,
    ),
)
profile = await client.get_user_profile("u1")
entities = await client.search_entities("Acme Corp", user_id="u1", limit=5)
removed = await client.prune(user_id="u1", threshold=0.15)

Wire into the container:

from continuum.core.container import get_container
get_container().set_memory_client(IntelligentMemoryClient())

Disable memory entirely

MEMORY_ENABLED=false
from continuum.core.container import Container, ContainerConfig
container = Container(ContainerConfig(enable_memory=False))

Don't

  • Don't pass role= / content= to SessionClient.add_message — use ChatMessage(...).
  • Don't expect memory to work without OPENAI_API_KEY set — the default mem0 embedder is OpenAI's. Either set the key, change EMBEDDER_PROVIDER, or disable memory.
  • Don't mix the two MemoryScope types — the enum goes into AgentMemoryConfig; the dataclass is internal.
  • Don't use client.reset() casually — it wipes the entire vector store. Use delete_all(user_id=...) for per-user resets.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.