Skip to main content
The General Engine is the default. It works for most AI products — chatbots, coding agents, productivity copilots, SaaS personalization, internal knowledge tools — anything that needs persistent user memory without an industry-specific schema.

Memory categories

CategoryExample
preferenceUser prefers concise answers with Python examples.
factUser works in a B2B SaaS support team.
goalUser is preparing to launch an AI product.
procedureUser wants weekly summaries every Friday.
relationshipUser reports to the Head of Product.
expertiseUser is comfortable with FastAPI and PostgreSQL.

Write

add() authenticates the tenant, resolves external_user_id, runs the quality gate, queues extraction, resolves conflicts, stores memories, and indexes vectors — then returns a job result. Extraction is async.
result = mem.add(
    messages=[
        {
            "role": "user",
            "content": "Remember that I prefer concise technical explanations with Python examples.",
        }
    ],
    external_user_id="user_123",
)
Possible outcomes:
StatusWhat to do
queuedContinue normally
passthroughSkip memory context, still call the LLM
L1Per-user rate limit — retry later
L2Low-quality input — don’t retry the same message
L3Near-duplicate — avoid repeated writes
L4Budget block — wait for reset or upgrade
Blocking add() should not affect LLM calls.

Retrieve

Call get() before the model call. MemoryOS ranks memories by semantic relevance, importance, recency, and hot-tier signals, then returns system_prompt_addition ready to prepend.
memories = mem.get(
    query="answer this user's integration question",
    external_user_id="user_123",
    limit=5,
    context_max_tokens=500,
)

system_prompt = "You are a helpful assistant."
if memories.has_context:
    system_prompt = f"{system_prompt}\n\n{memories.system_prompt_addition}"
Use a query that describes the current task. "answer this user's question" retrieves better than "preferences" or "memory".

When to switch to a domain schema

The General Engine is the right default. Move to a domain schema when your product needs structured domain memory:
  • EdTech — student profiles, weak topics, exams, forgetting stages
  • Support — customer issue history, support type, sentiment, escalation risk