# EverOS — Full Reference > EverOS is the Memory Operating System for Agentic AI. It gives LLM agents persistent, structured memory that extracts knowledge from conversations and multimodal data, resolves contradictions, and retrieves context intelligently — so agents remember, learn, and evolve across sessions. This document is written so an agent can read it once and then understand **what EverOS is, why to use it, and how to set it up and use it** — Cloud (managed) or self-hosted (OSS). The API is **HTTP-first** (any language); a thin Python SDK is noted where useful. For a concise overview, see llms.txt in the same directory. **Jump to:** [Start here](#start-here) · [HTTP API reference](#http-api-reference) — [add](#post-apiv2memoryadd--add-messages) · [search](#post-apiv2memorysearch--search-memories) · [context](#post-apiv2memorycontext--context-retrieval-cloud-only) · [get](#post-apiv2memoryget--get-memories) · [edit](#post-apiv2memoryedit--edit-profile-items-cloud-only) · [update](#post-apiv2memoryupdate--edit-one-memory-cloud-only) · [delete_by_ids](#post-apiv2memorydelete_by_ids--delete-memories-by-id-cloud-only) · [feedback](#post-apiv2memoryfeedback--rate-a-memory-cloud-only) · [delete](#post-apiv2memorydelete--delete-memories-cloud-only) · [purge](#post-apiv2memorypurge--purge-a-memory-space-cloud-only) · [filters](#filters-dsl) · [errors](#errors) — [Knowledge bases](#knowledge-bases-cloud) · [Memory tags](#memory-tags-cloud-only) · [Async tasks](#async-tasks-cloud) · [Retrieval methods](#retrieval-methods) · [Multimodal](#multimodal-memory) · [Python SDK](#python-sdk-optional-convenience) · [MCP server](#mcp-server-ai-tools-no-code) · [How memory works](#how-memory-actually-works) · [Self-hosted OSS](#set-up-everos-oss-self-hosted) Docs: https://docs.evermind.ai Console & API keys: https://everos.evermind.ai GitHub (open source): https://github.com/EverMind-AI/EverOS MCP server: connector https://everos-mcp.evermind.ai/mcp or uvx everos-mcp · https://docs.evermind.ai/cloud/mcp API base URL: https://api.evermind.ai (Cloud) · http://127.0.0.1:8000 (self-hosted default) Auth: `Authorization: Bearer ` Contact: contact@evermind.ai | Discord: https://discord.gg/QHQ2YYp7cH Research paper: https://arxiv.org/pdf/2601.02163 ## Why EverOS LLM agents forget. The context window can't hold months of history, and the usual workaround — dumping chat logs or RAG-retrieving raw snippets — breaks down over long, multi-session, multi-user interaction: 1. **Low signal-to-noise** — top-k retrieval over raw messages surfaces similar-but-useless chatter (small talk, transitions). 2. **State conflicts** — append-only logs accumulate contradictions ("my dog is 3" vs "…turned 4"); the LLM has to arbitrate at runtime, every time. 3. **Attribution failure** — a flat text sequence misattributes who said what in group conversations. EverOS replaces that with a **structured, self-evolving memory layer**, modelled on how memory works in people rather than on how logs work in databases. It runs in three phases: 1. **Formation** — conversation is segmented at its natural boundaries and each segment is distilled into an episode and the atomic facts inside it. Not chunks of text: discrete memories. 2. **Consolidation** — those memories keep changing after you write them. Duplicates merge, a new fact overrides the stale one it contradicts, each user's profile is rewritten, and repeated agent trajectories are distilled into reusable skills. This runs on its own, in the background. 3. **Recollection** — a query activates the memories a task needs and assembles context from them, rather than returning the top-k passages that look most like the query string. The consequence is the part worth holding on to: **memory does not just accumulate, it improves** — recall gets sharper the more your agent is used, without a pipeline you build and operate. **Use EverOS if** you need memory that persists across sessions, user modeling (preferences/traits/history), automatic extraction from conversations and files, or per-participant attribution in multi-party chats. **Use plain RAG instead if** you only need static document QA ("chat with PDF", FAQ bots) where the source document is the ground truth and nothing needs to persist or evolve. | | Standard RAG | EverOS | |---|---|---| | Storage | Document chunks | Episodes, atomic facts and evolving user profiles | | Updates | Manual, append-only | LLM-driven, automatic, with conflict resolution | | Query | Vector similarity only | keyword, vector, hybrid (RRF), agentic, multi-round tool-calling (Cloud) | | Scope | Document-level | User/session-level with per-participant attribution | **Proven & fast.** On long-conversation memory benchmarks EverOS leads: **LoCoMo 93.05%** (vs Zep 85.22%), **LongMemEval 83.00%** (vs MemOS 77.80%). Retrieval latency: keyword <100ms, hybrid 200–600ms. --- ## Start here Two calls. Get a key from the [EverOS Console](https://everos.evermind.ai/api-keys) and send it as `Authorization: Bearer ` on every request. ```bash # 1. Write. `sender_id` is who the memory belongs to; `timestamp` is unix MILLISECONDS. curl -X POST https://api.evermind.ai/api/v2/memory/add \ -H "Authorization: Bearer $EVEROS_API_KEY" -H "Content-Type: application/json" \ -d '{"session_id": "session_001", "messages": [ {"sender_id": "user_001", "role": "user", "timestamp": 1788000000000, "content": "I like black coffee, no sugar."}]}' # -> 202 {"request_id": "...", "data": {"message_count": 1, "status": "queued"}} # 2. Read, a few seconds later. Exactly one of user_id / agent_id is required. curl -X POST https://api.evermind.ai/api/v2/memory/search \ -H "Authorization: Bearer $EVEROS_API_KEY" -H "Content-Type: application/json" \ -d '{"query": "coffee preference", "user_id": "user_001", "method": "hybrid", "top_k": 5}' # -> 200 {"request_id": "...", "data": {"episodes": [...], "profiles": [], ...}} ``` That is the whole loop: write the turns, search before you generate. Extraction runs on its own in between — there is no third call to make. Four rules decide whether your first request succeeds: - `timestamp` is **unix milliseconds**. Seconds-scale values are rejected, not rescaled. - Each message carries its own `sender_id`; there is no top-level `user_id` on `add`. - `get` and `search` need **exactly one** of `user_id` / `agent_id`. - On `get`, `memory_type` must match that owner — a user owns `episode` and `profile`, an agent owns `agent_case` and `agent_skill`. The full list, with the error each one produces, is under [Errors](#errors). Two more defaults to know: `add` is asynchronous (`202`, `status: "queued"`; pass `"async_mode": false` for a synchronous write), and `app_id` / `project_id` (both default `"default"`) partition memory, so a query never crosses scopes. --- ## Cloud and self-hosted The memory API (`/api/v2/memory/*`) is the same on **Cloud** and **self-hosted OSS** — same request/response contracts, you choose where it runs. `add` / `flush` / `get` / `search` work on both. Cloud-only: `edit`, `delete`, `update`, `delete_by_ids`, `feedback`, `context`, `purge`, memory tags, the async task API and `/api/v2/object/sign`. Knowledge bases exist on both, at different paths (`/api/v2/knowledge_bases/{kb_id}/…` on Cloud, one knowledge space at `/api/v2/knowledge/…` on OSS). Every response is a JSON envelope: `{"request_id": "...", "data": { ... }}`. On Cloud, writes are **asynchronous by default** — `add` returns immediately with `status: "queued"` (HTTP 202) and extraction runs in the background as the conversation goes on. The most recent messages stay buffered until EverOS can tell where that part of the conversation ends: the next `add`, a `flush`, or (on Cloud) 2 hours with no new messages in the session closes them. On OSS, `add` is synchronous: it returns 200 with `"accumulated"` (buffered) or `"extracted"` (a boundary was found), and there is no task to poll. `/flush` forces extraction for a session that is still open, but it only sees messages that have already landed, so calling it right after a queued `add` returns `"no_extraction"` — that means "nothing pending", not an error. Pass `"async_mode": false` on `add` for a synchronous write that returns the engine's own result. Beyond memory, Cloud also serves **knowledge bases** (document libraries with topic-level retrieval), **async task status**, and **memory tags**. See their sections below. --- ## HTTP API Reference All paths are relative to the base URL and all bodies are JSON. Availability is in [Cloud and self-hosted](#cloud-and-self-hosted). ### POST /api/v2/memory/add — Add messages Request: | Field | Type | Required | Description | |-------|------|----------|-------------| | `session_id` | string | yes | Session identifier (1–128 chars) | | `messages` | array | yes | 1–500 message items | | `async_mode` | boolean | no | Default `true` → 202 `queued`. `false` → 200, forwarded synchronously. A request with any non-text content item is always queued (202) | | `app_id` / `project_id` | string | no | Both default `"default"` | Message item — `sender_id` (string), `role` (`user` \| `assistant` \| `tool`), `timestamp` (integer, unix ms), and `content` (string, or array of content items for multimodal) are **all four required**; optionally `sender_name` (human-readable display name for the sender, useful in multi-party chats where `sender_id` is an opaque id), and for tool use `tool_calls[]` (OpenAI format) / `tool_call_id`. Over HTTP, `timestamp` has no default — omitting it returns `400 InvalidParameter` on `messages[i].timestamp`. The Python SDK stamps it with the current time when you leave it out, so SDK examples show messages without one. ```bash curl -X POST https://api.evermind.ai/api/v2/memory/add \ -H "Authorization: Bearer " -H "Content-Type: application/json" \ -d '{ "session_id": "session_001", "messages": [ {"sender_id": "user_001", "role": "user", "timestamp": 1711900000000, "content": "I like black coffee, no sugar."}, {"sender_id": "assistant", "role": "assistant", "timestamp": 1711900001000, "content": "Got it, I will remember that."} ] }' ``` Response — `data`: `{"message_count": 2, "status": "queued"}` (Cloud async, 202) · `"accumulated"` | `"extracted"` (Cloud with `async_mode: false`, and always on OSS — 200). ### POST /api/v2/memory/flush — Force extraction Request: `session_id` (required), optional `app_id` / `project_id`. Closes the session's open buffer: the messages after the last boundary are folded into a final memory and extracted now. `add` keeps the most recent messages buffered until it can tell where that part of the conversation ends. Call `flush` when a conversation ends and you want its memories now. Otherwise the next `add` closes them, and on Cloud a session with no new messages for 2 hours is closed and extracted automatically. `"no_extraction"` means nothing was pending — which includes the case where a queued `add` has not landed yet, and the case where extraction already happened. It is not an error. ```bash curl -X POST https://api.evermind.ai/api/v2/memory/flush \ -H "Authorization: Bearer " -H "Content-Type: application/json" \ -d '{"session_id": "session_001"}' ``` Response — `data`: `{"status": "extracted"}` or `{"status": "no_extraction"}`. ### POST /api/v2/memory/search — Search memories Request: | Field | Type | Required | Description | |-------|------|----------|-------------| | `query` | string | yes | Search text | | `user_id` **or** `agent_id` | string | yes | Exactly one — the owner to search within | | `method` | string | no | `keyword` \| `vector` \| `hybrid` (default) \| `agentic` | | `top_k` | integer | no | Max results: `-1` (default — the server chooses) or 1–100. Anything else is a 422. Try `5` for chat, `10` for research | | `include_profile` | boolean | no | Also return matching profile items (default false) | | `min_score` | float | no | 0.0–1.0 floor on the fused score. Applies to the **episode hybrid** path only — keyword, vector and agentic ignore it silently | | `radius` | float | no | Vector-similarity floor for dense recall. Unset with `top_k > 0` applies no floor (truncation decides); unset with `top_k = -1` falls back to the server default so unlimited mode still drops the low-similarity tail. An explicit value always wins, including `0.0` | | `enable_llm_rerank` | boolean | no | **Agent searches only** — takes effect just when `agent_id` is set *and* `method` is `hybrid`. Adds an LLM rerank lane over `agent_case`, whose scores then bridge into `agent_skill`. Ignored on user (episode) searches (default false) | | `filters` | object | no | Filters DSL (see below) for finer scoping | ```bash curl -X POST https://api.evermind.ai/api/v2/memory/search \ -H "Authorization: Bearer " -H "Content-Type: application/json" \ -d '{"query": "coffee preference", "user_id": "user_001", "method": "hybrid", "top_k": 5, "include_profile": true}' ``` Response — `data`: `{ "episodes": [...], "profiles": [...], "agent_cases": [...], "agent_skills": [...], "unprocessed_messages": [...] }`, each hit carrying a relevance `score`. An episode hit: ```json {"id": "6a6d...", "user_id": "user_001", "session_id": "session_001", "timestamp": "2026-07-31T21:13:11Z", "sender_ids": ["user_001"], "summary": "~200-char summary", "subject": "...", "episode": "full narrative — paste into the LLM prompt", "atomic_facts": [{"id": "...", "content": "single-sentence fact"}], "score": 0.87} ``` #### `unprocessed_messages` — reading the not-yet-extracted tail Extraction is asynchronous, so the newest messages in a session may not be part of an episode yet. Search can hand back that in-flight buffer as raw messages, so a live agent still sees what was just said instead of a gap. **It only loads when the request pins one session with a top-level `session_id` equality scalar** — `"filters": {"session_id": "session_001"}`. Anything else leaves it `[]`: wrapped in `AND` / `OR`, nested deeper, or written as an operator map (`{"eq": ...}` / `{"in": ...}`). Scoping by `user_id` alone is not enough — buffered rows have no owner attribution yet (owner inference runs after boundary detection), so the session is the only dimension that can scope them, and pinning one is the deliberate opt-in to see its whole in-flight window. ```bash curl -X POST https://api.evermind.ai/api/v2/memory/search \ -H "Authorization: Bearer " -H "Content-Type: application/json" \ -d '{"query": "seat preference", "user_id": "user_001", "filters": {"session_id": "session_001"}}' ``` Each item is the raw message — `id`, `session_id`, `sender_id`, `sender_name`, `role`, `content`, `timestamp`, plus `tool_calls` / `tool_call_id` for tool turns — oldest first, and carries no `score` (it was never ranked). Only still-accumulating rows appear; once a memcell closes over them they leave the buffer and show up as an episode instead. Typical use: `episodes[]` for consolidated context, `unprocessed_messages[]` appended as the live tail of the current session. ### POST /api/v2/memory/context — Context Retrieval (Cloud-only) Multi-round, LLM-driven retrieval. The model calls retrieval tools (hybrid, keyword and semantic search, search within a topic cluster, read the turns around a memory, read a whole session, list sessions), reads the results, writes new queries for what is still missing, and stops when it judges the evidence sufficient to answer `query`. The memories it found are returned. **It returns memories, not an answer.** Use it for multi-hop, temporal and cross-conversation questions; use `search` for everything else. Request: the same body as `search`, except: - `user_id` is required and `agent_id` is rejected (422): the loop searches one user's memories. Use `search` for agent memories. - `method` is fixed to `"context"`; omit it. Any other value is a 422. - `min_score` is not supported (422). - `radius` and `enable_llm_rerank` are not supported either (422): the loop does not use them. ```bash curl -X POST https://api.evermind.ai/api/v2/memory/context --max-time 60 \ -H "Authorization: Bearer " -H "Content-Type: application/json" \ -d '{"query": "What did I decide about the Q3 budget after the meeting with finance?", "user_id": "user_001", "top_k": 10}' ``` Response: the same `SearchData` as `search`, with these differences: - `episodes[].cited` is `true` for the memories the model said its answer rests on (always `false` on `search`). - `episodes[].score` is a rank-fusion score, roughly 0.01–0.05, plus 1.0 for a cited episode, so cited episodes come first. Not comparable with `search` scores. - `profiles` and `unprocessed_messages` are filled exactly as on `search`. Limits: at most 5 LLM rounds and 45 seconds per request. Reaching a limit returns what was found so far, not an error. Set a client timeout of at least 60s. ### POST /api/v2/memory/get — Get memories Request: | Field | Type | Required | Description | |-------|------|----------|-------------| | `memory_type` | string | yes | `episode` \| `profile` \| `agent_case` \| `agent_skill` | | `user_id` **or** `agent_id` | string | yes | Exactly one | | `page` / `page_size` | integer | no | Default 1 / 20 (max 100) | | `sort_by` / `sort_order` | string | no | `timestamp` (default) or `updated_at` · `desc` (default) or `asc` | | `filters` | object | no | Filters DSL | ```bash curl -X POST https://api.evermind.ai/api/v2/memory/get \ -H "Authorization: Bearer " -H "Content-Type: application/json" \ -d '{"memory_type": "profile", "user_id": "user_001"}' ``` Response — `data`: `{ "episodes": [...], "profiles": [...], "agent_cases": [...], "agent_skills": [...], "total_count": N, "count": M }` (only the requested type is populated). Key fields per type: - **episode**: `summary`, `subject`, `episode`, `atomic_facts[]`, `sender_ids[]`, `timestamp`. Two more keys appear only on an episode that was edited by hand through `/api/v2/memory/update`: `edited_at`, and `reflect_state` (`pending` until background consolidation has absorbed the new narrative, `done` after). Treat a missing key as "never edited". - **profile**: `profile_data` — dict of user attributes (explicit info + implicit traits). - **agent_case**: `task_intent`, `approach`, `quality_score`, `key_insight`. - **agent_skill**: `name`, `description`, `content`, `confidence`, `maturity_score`, `source_case_ids[]`. The three scores are nominally 0.0–1.0 but the range is a convention, not a constraint — nothing on the write path clamps what the extractor returned. One threshold is real: a case scoring below 0.2 is never distilled into a skill. `maturity_score` defaults to 0.6 and is not computed at this version, so an unscored 0.6 is indistinguishable from a scored one — do not filter near it. ### POST /api/v2/memory/edit — Edit profile items (Cloud-only) Bulk-edit a single user's profile. Request: `user_id` (required), `operations` (1–50). Each operation: `action` (`add` \| `update` \| `delete`), `type` (`explicit_info` \| `implicit_traits`), `data` (for add/update), `item_id` (for update/delete), optional `reason`. **Requires an existing profile.** This endpoint edits a profile that extraction has already built — it cannot create the first one, and `action: "add"` is "add an item to this user's profile", not "create the profile". A user with no profile yet returns `{"error": {"code": "not_found", "message": "profile not found for user_id=..."}}`. Add messages and let extraction run first. ```bash curl -X POST https://api.evermind.ai/api/v2/memory/edit \ -H "Authorization: Bearer " -H "Content-Type: application/json" \ -d '{"user_id": "user_001", "operations": [ {"action": "add", "type": "explicit_info", "reason": "Stated in session-1", "data": {"category": "hobby", "description": "Enjoys hiking in the mountains"}} ]}' ``` Response — `data`: `{"user_id", "version", "applied", "results": [{"op_index", "status": "applied"|"rejected", "item_id", ...}]}`. `edit` is for profile items only. To change an episode's narrative, summary or subject, use `/api/v2/memory/update` below. ### POST /api/v2/memory/update — Edit one memory (Cloud-only) Rewrite the editable fields of one episode. Request: | Field | Type | Required | Description | |-------|------|----------|-------------| | `memory_type` | string | yes | `episode` (the only editable type today) | | `memory_id` | string | yes | The episode's `id` from `get` / `search` | | `patch` | object | yes | At least one of `episode` (1–8000 chars), `summary` (1–1000), `subject` (1–200). Fields left out keep their value; `null` is not "clear" | | `reason` | object | no | `{"code": ..., "note": ...}` for your audit trail. `code` is one of `hallucination` \| `wrong_subject` \| `wrong_time` \| `redundant` \| `missing` \| `privacy` \| `style` \| `other`; `note` ≤256 chars | | `user_id` | string | no | Owner guard: when set, a memory owned by another user is a `404`, like a missing one. Set it from your own session (the signed-in user), never from model output | No `app_id` / `project_id`: the record already knows its scope. There is no version check, the last write wins. ```bash curl -X POST https://api.evermind.ai/api/v2/memory/update \ -H "Authorization: Bearer " -H "Content-Type: application/json" \ -d '{"memory_type": "episode", "memory_id": "665f0c8e1a2b3c4d5e6f7a8b", "patch": {"summary": "Moved to Hangzhou; lives near West Lake."}, "reason": {"code": "wrong_subject", "note": "The narrative attributed the move to the wrong person"}}' ``` Response — `data` is the edited episode in the same shape `get` returns, plus `unchanged`. `edited_at` is set on every edit. Changing `episode` re-indexes the memory, regenerates `summary` unless you supplied one, sets `reflect_state: "pending"` and re-extracts the episode's facts in the background (until the next consolidation pass a search may return both the edited episode and a merged narrative close to it). Changing only `summary` / `subject` touches nothing downstream. Re-sending content equal to what is stored answers `200` with `unchanged: true` and writes nothing, so retries are safe. A memory that does not exist, is deleted, belongs to another tenant, or (with `user_id`) belongs to another user is a `404`. ### POST /api/v2/memory/delete_by_ids — Delete memories by id (Cloud-only) Soft-delete 1–50 memories chosen by id, together with what was derived from them (extracted facts, cluster membership, search-index copies). Request: `memory_type` (`episode`), `memory_ids[]`, optional `reason` and `user_id` as on `update` (with `user_id`, ids owned by another user are skipped). ```bash curl -X POST https://api.evermind.ai/api/v2/memory/delete_by_ids \ -H "Authorization: Bearer " -H "Content-Type: application/json" \ -d '{"memory_type": "episode", "memory_ids": ["665f0c8e1a2b3c4d5e6f7a8b", "665f0c8e1a2b3c4d5e6f7a8c"], "reason": {"code": "redundant"}}' ``` Response — `data`: `{"memory_type": "episode", "success": true, "deleted": 2}`. `deleted` counts the memories this request removed: an id that does not exist, is already deleted, belongs to another tenant or (with `user_id`) to another user is skipped and not counted, and the rest of the batch is still deleted, so re-sending a batch is safe. One malformed id rejects the whole request with `422` and deletes nothing. To clear a whole user, agent or session, use `/api/v2/memory/delete` instead. ### POST /api/v2/memory/feedback — Rate a memory (Cloud-only) Record that a memory was right or wrong. Request: | Field | Type | Required | Description | |-------|------|----------|-------------| | `memory_type` | string | yes | `episode` \| `profile` \| `agent_case` \| `agent_skill` | | `memory_id` | string | yes | The target's `id` from `get` / `search` (for `profile`, the profile document's id) | | `item_id` | string | `profile` only | The `item_id` of the rated entry inside `profile_data` (`ei_…` / `it_…`). Required for `profile`, rejected for other types | | `rating` | string | yes | `positive` \| `negative` | | `reason` | string | no | Negative only: `hallucination` \| `outdated` \| `wrong_subject` \| `wrong_time` \| `redundant` \| `privacy` \| `style` \| `other`. Leave it unset if the user was not asked; `other` means they rejected the list | | `note` | string | no | Free text, 1–256 chars, either rating | | `suggestion` | string | no | Negative only: what the memory should have said, 1–8000 chars | ```bash curl -X POST https://api.evermind.ai/api/v2/memory/feedback \ -H "Authorization: Bearer " -H "Content-Type: application/json" \ -d '{"memory_type": "episode", "memory_id": "66dff0f8a9f84d8c9f62f011", "rating": "negative", "reason": "outdated", "suggestion": "The user currently lives in Shanghai."}' ``` Response — `data`: `{"id": ""}`. Recording is not applying: the memory is not updated, deleted, hidden or re-indexed, and `privacy` is a signal, not a deletion request. Every call stores one more record (no de-duplication). To act on a rating, call `update`, `delete_by_ids` or `edit`. ### POST /api/v2/memory/delete — Delete memories (Cloud-only) Scoped soft-delete. Request: any combination of `user_id` / `agent_id` / `session_id`. ```bash curl -X POST https://api.evermind.ai/api/v2/memory/delete \ -H "Authorization: Bearer " -H "Content-Type: application/json" \ -d '{"user_id": "user_001", "session_id": "session_001"}' ``` Response — `data`: `{"filters": ["user_id", "session_id"], "count": 5}`. ### POST /api/v2/memory/purge — Purge a memory space (Cloud-only) **Permanent, no undo.** Physically deletes the memory data of a whole memory space, one app or one project, including records already soft-deleted, so the space is empty and reusable. Two calls plus a job read; see [Purge a Memory Space](https://docs.evermind.ai/cloud/purge). | `scope` | Deletes | Ids | |---|---|---| | `space` | all memory data in the memory space, plus its knowledge bases and sender records | none | | `app` | memory data of one app | `app_id` | | `project` | memory data of one project of one app | `app_id` + `project_id` | Each scope takes exactly its ids; a missing or extra id is a `422`. Memory data = memories, sessions, messages, memory cells, feedback and events, in every index. Left behind in object storage, unreachable through the API: files uploaded through `/api/v2/object/sign` (any scope) and the stored text of knowledge base topics (`space` scope). Not on its own a full-erasure guarantee. ```bash # 1. Request: deletes nothing, returns a nonce and what would be deleted curl -X POST https://api.evermind.ai/api/v2/memory/purge \ -H "Authorization: Bearer " -H "Content-Type: application/json" \ -d '{"scope": "project", "app_id": "my_app", "project_id": "staging"}' # -> 200 {"data": {"nonce": "...", "expires_at": "...", "scope": "project", ..., "summary": {"mongo": {...}, "mongo_total": 31, "complete": true, ...}}} # 2. Confirm within 5 minutes: queues the purge curl -X POST https://api.evermind.ai/api/v2/memory/purge/confirm \ -H "Authorization: Bearer " -H "Content-Type: application/json" \ -d '{"nonce": ""}' # -> 202 {"data": {"job_id": "...", "status": "queued", ...}} # 3. Poll until status is succeeded or failed curl https://api.evermind.ai/api/v2/memory/purge/ -H "Authorization: Bearer " # -> 200 {"data": {"status": "running", "steps": [{"store": "mongo:v2_episodes", "state": "done", "deleted": 1234}, ...]}} ``` The `summary` is a snapshot that counts soft-deleted records too, so it can exceed what `get` shows; a count that does not finish in time is `null` with `complete: false`. The nonce is single use and only valid in the same memory space with the same API key; the scope comes from the nonce, not the confirm body. While a purge is queued or running, every write to the memory space returns `409 purge_in_progress` (whatever the purge's scope) and reads may return partial results. Only one purge runs per memory space: confirming again returns the running job. Each memory space may call `/purge` and `/purge/confirm` 10 times a minute by default (`429` with `Retry-After`; rejected requests do not count). Not billed. ### POST /api/v2/object/sign — Pre-sign multimodal upload (Cloud Storage) Request: `objectList` (1–50 items, each `fileId` unique, `fileName`, `fileType` = `image` \| `file` \| `video`). See [Multimodal](#multimodal-memory) for the full 3-step flow. This endpoint returns the MMS envelope where success is `status: 0` and `result.data.objectList[]` carries `objectKey` + `objectSignedInfo` (S3 `url` + `fields`). ### Filters DSL Optional on `get` / `search`, alongside the top-level `user_id` / `agent_id`. Recursive `AND` / `OR` over scalar conditions: ```json {"AND": [{"timestamp": {"gte": 1700000000000, "lt": 1710000000000}}, {"session_id": "s1"}]} ``` | field | matches | |---|---| | `session_id` | the session the memory came from | | `sender_id` | one participant — matched against the episode's `sender_ids` | | `timestamp` | when the memory happened | | `parent_id` / `parent_type` | what a memory derives from: an episode's parent is its memcell, an atomic fact's parent is its episode (facts extracted before the September 2026 engine change keep `parent_type: "memcell"`, so a filter on one value misses the other generation) | | `tag` | a tag you attached — **Cloud only, and `get` only**; passing it to `search` is a `422`, and the OSS allow-list has no `tag` field at all | Operators: `eq`, `ne`, `gt`, `gte`, `lt`, `lte`, `in`. A bare value is `eq` shorthand. `AND` / `OR` nest freely. `user_id`, `agent_id`, `app_id` and `project_id` do **not** belong inside `filters` — they are top-level request fields, and putting them in a filter is a `422`. ### Errors Every one of these is enforced server-side and returns the message shown. Get them right and the API is quiet. | Rule | What you get if you break it | |---|---| | `timestamp` on every message, **unix milliseconds** | omitted → `400` `` `timestamp` is required ``; seconds-scale → `422` `` `timestamp` must be a unix millisecond timestamp `` (the Python SDK rejects it before sending, with a `ValueError`) | | `get` / `search`: **exactly one** of `user_id` / `agent_id` | neither or both → `422` `exactly one of user_id / agent_id is required` | | `get`: `memory_type` must match the owner — a user owns `episode` and `profile`, an agent owns `agent_case` and `agent_skill` | `422` `memory_type 'agent_case' is not valid when user_id is set` | | `delete`: at least one of `user_id` / `agent_id` / `session_id` | empty body → `422` `at least one of user_id / agent_id / session_id required` | | `top_k`: `-1` or 1–100 | `422` `top_k must be -1 or in 1..100` | | `filters`: only the fields in the [Filters DSL](#filters-dsl) table | `user_id` / `agent_id` / `app_id` / `project_id` inside `filters`, or `tag` on `search` → `422` | | `update`: `patch` carries at least one of `episode` / `summary` / `subject`; `null` means "leave as is", not "clear" | empty patch or an empty string → `422` | | `delete_by_ids`: every id well-formed (24 hex chars) | one malformed id → `422` and nothing is deleted; an id that does not exist is skipped, not a `404` | | `purge`: `scope` takes exactly its own ids (`space`: none, `app`: `app_id`, `project`: `app_id` + `project_id`) | missing or extra id → `422` | | `purge/confirm`: the `nonce` from `purge`, within 5 minutes, once, with the same API key | otherwise `404` `purge_nonce_invalid`, nothing happens | | No writes while a purge is queued or running | any write to the memory space → `409` `purge_in_progress`; reads keep working | | `feedback`: `reason` and `suggestion` only with `rating: "negative"`; `item_id` required for `profile`, rejected for other types | `422` `reason and suggestion are only accepted with rating='negative'` / `item_id is required for memory_type='profile'` | On `add`: 1–500 messages and a `session_id` of 1–128 characters, rejected with `400` when exceeded, and at most 10 non-text content items per request (`422`). Other caps, all rejected with `422` when exceeded: 1–50 operations per `edit`, page size 1–100, `patch.episode` ≤8000 / `summary` ≤1000 / `subject` ≤200 chars, `reason.note` ≤256 chars, 1–50 ids per `delete_by_ids`, and for tags up to 200 memory ids × 100 tags with each tag ≤32 chars. By HTTP status, the body shape varies by layer: | HTTP | Meaning | Example body | |------|---------|--------------| | 401 | Missing / invalid token | `{"error": {"code": "...", "message": "..."}}` | | 403 | The key is not permitted on this route or tenant | gateway error body | | 404 | The memory, profile item or knowledge base does not exist, is deleted, or belongs to another tenant (the three are not distinguished) | `{"error": {"code": "not_found", "message": "episode 665f0c8e1a2b3c4d5e6f7a8b not found"}}` | | 409 | `purge_in_progress`: a write reached a memory space while a purge was queued or running | `{"error": {"code": "purge_in_progress", "message": "..."}}` | | 422 | Validation error | `{"code": "InvalidParameter", "message": "messages[0].timestamp must be a unix millisecond timestamp (>= 1000000000000)", "param": "messages[0].timestamp"}` or `{"error": {"code": "invalid_argument", "message": "exactly one of user_id / agent_id is required"}}` | | 429 | Rate limit / quota exceeded | gateway error body | --- ## Knowledge bases (Cloud) A searchable document library, separate from conversation memory. The model is **category → document → topic**: an LLM splits each ingested document into topics, and retrieval returns topics. | Operation | Path | |---|---| | Create / list | `POST` / `GET /api/v2/knowledge_bases` | | Read / update / delete | `GET` / `PATCH` / `DELETE /api/v2/knowledge_bases/{kb_id}` | | Ingest a document | `POST /api/v2/knowledge_bases/{kb_id}/documents` | | Replace a document | `PUT .../documents/{doc_id}` | | Browse / read / patch / delete | `GET` / `GET` / `PATCH` / `DELETE .../documents[/{doc_id}]` | | Topics of a document | `GET .../documents/{doc_id}/topics[/{topic_id}]` | | Categories | `POST` / `GET .../categories` · `PATCH` / `DELETE .../categories/{category_id}` | | Search | `POST /api/v2/knowledge_bases/{kb_id}/search` | **Ingest is asynchronous and the ack carries no document id.** It answers `202` with `{"status": "queued", "task_id": "..."}`; the id is minted downstream. Poll `GET /api/v2/tasks/{task_id}`, then resolve the document from `GET .../documents` by title. Ingest is only truly complete once that document reports `topic_count` greater than 0. `content` is one content object: inline text, or a file uploaded through `/api/v2/object/sign` and referenced by its object key as `uri`. Search returns topics, each carrying its parent document's title and summary. Bodies are omitted unless you pass `include: ["content"]`. Two things to know about `score`: it is a cross-encoder relevance **normalized within that response** — so it compares inside one response and nowhere else, and `score_threshold` cuts a relative position rather than an absolute bar — and results can include the synthetic document-root topic (`depth` 0), which never has a body. A new knowledge base has **no categories**. Until you create some, every document stays uncategorized and the classifier has nothing to choose from. Deleting a category reassigns its documents to uncategorized rather than deleting them; deleting a knowledge base cascades to everything inside it. --- ## Memory tags (Cloud-only) `POST /api/v2/memory/tag/bind` · `/unbind` · `/replace` — attach labels to memories you already have. ```json {"memory_type": "episode", "memory_ids": ["mem-1", "mem-2"], "tags": ["onboarding"]} ``` Scoped by memory id, not by `app_id` / `project_id`. `bind` adds and keeps existing tags, `unbind` removes only what you list, `replace` overwrites the whole set (an empty list clears it). Tags are created by use. All three are idempotent and batched: up to 200 ids × 100 tags, each tag 1–32 chars. The response reports `matched` (how many ids the operation found) against `requested` (how many you sent) — `matched < requested` means some ids were not found. --- ## Async tasks (Cloud) `GET /api/v2/tasks/{task_id}` — one task. `GET /api/v2/tasks` — a filterable list. `GET /api/v2/tasks/stats` — counts per status over a window. The completion side of every async write: a queued `add`, a document ingest. `status` is one of `queued` / `processing` / `pending` / `success` / `failed`, and it is an **open set** — treat an unrecognized value as terminal only when `finished_at` is present. --- ## Retrieval Methods `method` on `POST /api/v2/memory/search`: | Method | Latency | Best for | |--------|---------|----------| | `keyword` | <100ms | Exact terms, IDs, known phrases (BM25) | | `vector` | 200-500ms | Semantic similarity, paraphrased queries | | `hybrid` | 200-600ms | **Recommended default** (keyword + vector + rerank via RRF) | | `agentic` | 2-5s | Complex, multi-part questions — an LLM decomposes the query into sub-queries, runs hybrid on each, and aggregates | For multi-hop, temporal and cross-conversation questions, Cloud also offers [`POST /api/v2/memory/context`](#post-apiv2memorycontext--context-retrieval-cloud-only): instead of decomposing once up front, an LLM searches in rounds and decides each next query from what it has found. Up to 45s per request. ```bash # hybrid (default) — best balance of precision/recall curl -X POST https://api.evermind.ai/api/v2/memory/search -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{"query": "morning routine and work preferences", "user_id": "u1", "method": "hybrid", "top_k": 10}' # agentic — only for complex queries; use a 60s timeout and fall back to hybrid on error curl -X POST https://api.evermind.ai/api/v2/memory/search -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{"query": "What context helps me prep the roadmap review with stakeholders?", "user_id": "u1", "method": "agentic", "top_k": 15}' ``` **Guidance:** start with `hybrid`, `top_k=5` (chat) or `10` (research). Escalate to `agentic` only when hybrid is insufficient — it costs 3-5× more and is ~10× slower; always fall back to hybrid on timeout. Decision: latency-critical (<100ms) → `keyword`; complex multi-part → `agentic`; otherwise → `hybrid`. --- ## Multimodal Memory A message's `content` can be an **array of content items** instead of a plain string. Non-text files are preprocessed to text (image OCR, audio transcription, PDF/Office parsing) and flow into the same extraction pipeline — search works identically across text and files. Content item fields: `type` (required: `text` \| `image` \| `audio` \| `doc` \| `pdf` \| `html` \| `email`), `text` (for text), `uri` (object key from the upload flow), `name`, `ext`, `source` (`google_doc` / `notion` / `zoom` / …), `source_info`, `extras`. Limits: ≤10 non-text items per message; request body <300 KB — the bytes travel through the upload flow, not in this request. Size caps: image 10 MB, doc/pdf/html/email 100 MB, audio/video 500 MB. **Cloud upload (3 steps over HTTP):** ```bash # 1) Pre-sign — returns objectKey + objectSignedInfo (S3 url + form fields) curl -X POST https://api.evermind.ai/api/v2/object/sign -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{"objectList": [{"fileId": "img_001", "fileName": "whiteboard.png", "fileType": "image"}]}' # 2) POST the file bytes to the returned S3 url with its fields (file field last) -> HTTP 204 # 3) Reference the objectKey as uri in a message content array curl -X POST https://api.evermind.ai/api/v2/memory/add -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "session_id": "session_001", "messages": [{ "sender_id": "user_001", "role": "user", "timestamp": 1711900000000, "content": [ {"type": "text", "text": "Here is the meeting whiteboard"}, {"type": "image", "uri": "", "name": "whiteboard.png", "ext": "png"} ] }] }' ``` --- ## Python SDK (optional convenience) If you're in Python, `pip install everos-cloud` gives an ergonomic `EverOS` wrapper — plain dicts in, response `.data` out — over the same HTTP API: ```python from everos_cloud import EverOS client = EverOS(api_key="your_api_key") # required: the SDK reads no env vars; host= overrides the base URL client.add(session_id="session_001", messages=[ {"sender_id": "user_001", "role": "user", "content": "I like black coffee, no sugar."}, ]) # timestamp defaults to now (ms) results = client.search("coffee preference", user_id="user_001", method="hybrid", top_k=5) profile = client.get("profile", user_id="user_001") key = client.upload("photo.jpg") # presign + upload -> object_key ``` Method names follow the API. Memory calls are bare verbs named after the last segment of their route — `add`, `search`, `get`, `flush`, `edit`, `delete`, `update`, `delete_by_ids`, `feedback` — as are `presign`, `upload` and `close`. Every other resource carries its name as a prefix, so typing `client.kb` or `client.doc` lists that surface: ```python kb = client.kb_create("Employee Handbook") # kb_list / kb_get / kb_update / kb_delete / kb_search ack = client.doc_ingest(kb.id, "Leave policy", "…") # doc_list / doc_get / doc_update / doc_delete task = client.task_wait(ack.task_id) # task_get / task_list client.tag_bind("episode", ["mem-1"], ["onboarding"]) # tag_unbind / tag_replace # Fix or remove one memory, or record that it was wrong client.update("665f0c8e1a2b3c4d5e6f7a8b", summary="Moved to Hangzhou.", reason="wrong_subject") client.delete_by_ids(["665f0c8e1a2b3c4d5e6f7a8b"], reason="redundant") client.feedback("66dff0f8a9f84d8c9f62f011", "negative", reason="outdated", suggestion="The user currently lives in Shanghai.") ``` Errors raise `EverOSError`. Every operation is also reachable on the generated clients — `client.memory`, `client.storage`, `client.knowledge`, `client.tasks` — including the ones the wrapper does not cover. Full usage: https://github.com/EverMind-AI/everos-cloud-sdk-python/blob/HEAD/quickstart.md ### Worked example: the memory-augmented agent loop The one pattern to internalize — recall, generate, persist — on every turn (three HTTP calls; extraction is not one of them). SDK shown for brevity: ```python from everos_cloud import EverOS client = EverOS(api_key="your_api_key") USER, SESSION = "user_001", "session_001" def chat(user_message: str) -> str: # 1. RECALL — relevant memory as context (episode narratives, not raw history) hits = client.search(user_message, user_id=USER, method="hybrid", top_k=5) context = "\n".join(e.episode for e in (hits.episodes or [])) # 2. GENERATE — your LLM, with memory as system context reply = my_llm(system=f"What you know about the user:\n{context}", user=user_message) # 3. PERSIST — store both sides of the turn, each under its sender_id. # Writes are async: extraction runs in the background, not on this call. client.add(session_id=SESSION, messages=[ {"sender_id": USER, "role": "user", "content": user_message}, {"sender_id": "assistant", "role": "assistant", "content": reply}, ]) return reply # Extraction is asynchronous and self-scheduling — you don't flush every turn. # Call client.flush(SESSION) only when you need the latest turn recallable # immediately (e.g. at the end of a session). ``` Full, runnable use-case tutorials — personal assistant, customer support, AI tutor, multi-party chat, batch import — live in the docs Cookbook: https://docs.evermind.ai/cookbook/quickstart --- ## MCP server (AI tools, no code) `everos-mcp` (https://pypi.org/project/everos-mcp/) puts EverOS memory behind the Model Context Protocol, so any MCP client (Claude Code, Codex, Cursor, Claude Desktop) gets long-term memory without writing code. It calls this same API. Claude and ChatGPT: add the connector URL https://everos-mcp.evermind.ai/mcp and sign in with your EverOS account (no API key; five tools, no agent-experience tools). Connected apps are listed, and can be revoked, under Connected Apps in the EverOS Console. The rest of this section covers the local server. ```bash # Claude Code claude mcp add everos -e EVEROS_API_KEY=your_api_key -- uvx everos-mcp # Codex codex mcp add everos --env EVEROS_API_KEY=your_api_key -- uvx everos-mcp ``` JSON-configured clients (Cursor `~/.cursor/mcp.json`, Claude Desktop `claude_desktop_config.json`): ```json {"mcpServers": {"everos": {"command": "uvx", "args": ["everos-mcp"], "env": {"EVEROS_API_KEY": "your_api_key"}}}} ``` | Tool | What it does | |---|---| | `search_memory` | Relevance search over stored memories, optionally with the profile | | `add_memory` | Store a fact or exchange; background save by default, `wait=true` blocks until extraction has finished | | `get_profile` | The profile EverOS built (facts, traits, preferences) | | `list_memories` | Chronological, paginated browsing | | `forget_session` | Delete what this connection stored (and cases distilled from it); profile and skills are kept | | `record_trajectory` | Record how a task was solved, tool calls included | | `recall_agent_experience` | Search distilled cases and skills for the task at hand | Identity and scope are server configuration, not tool arguments: `EVEROS_USER_ID` (default `default-user`, so one memory per key across machines), `EVEROS_APP_ID` / `EVEROS_PROJECT_ID` (default `default`), `EVEROS_SESSION_ID` (a fresh one per process), `EVEROS_ASSISTANT_SENDER_ID` (default `assistant-`; share it to pool agent experience). `EVEROS_BASE_URL` points it at a self-hosted deployment, where no key is needed. Writes that contain credentials are refused, and recalled memories are returned as data, never as instructions. A trajectory needs more than three tool-call rounds to become a case. Setup for every client: https://docs.evermind.ai/cloud/mcp --- ## How memory actually works Background. You can call the API without any of it — but two of these words show up in places you will touch, so they are worth ten lines. **Extraction is boundary-driven.** Messages you `add` accumulate in a session buffer. A detector watches for a topic shift or a time gap, and when one trips it closes the buffer into a **MemCell** and extracts from it: an episode narrative and the atomic facts inside it (the OSS pipeline also writes time-bound *foresights* to disk, but no API endpoint returns them). This is why `add` returns before anything is extracted, why `flush` on a session with nothing pending answers `no_extraction`, and why a memory shows up seconds after the turn that produced it. The MemCell is not just internal vocabulary: - an episode's `parent_id` points at the MemCell it came from (an atomic fact's points at its episode), which is what makes `parent_id` a get-children-by-id filter; - **Cloud quota is counted in MemCells** — roughly one per ten raw messages, varying with where the boundary lands. **Consolidation runs in the background.** Extracted memories are clustered by theme, contradictions between old and new facts are resolved, and each user's profile is rewritten as it learns more. Nothing you call triggers this; it is why the same query can return a better answer a day later, and why `edit` operates on a profile that extraction has already built rather than creating one. **Retrieval reconstructs, it does not just match.** A search activates the memories related to the task and assembles context from them, rather than returning the top-k chunks that look most like the query string. The practical consequence is in [Retrieval methods](#retrieval-methods): `hybrid` is the default worth keeping, and `agentic` buys thoroughness with latency. --- ## Set Up EverOS OSS (self-hosted) Self-hosted, Markdown-first: storage is Markdown (source of truth) + SQLite (state) + LanceDB (index). No external databases required. It serves the **same API** on your own host (default `http://127.0.0.1:8000`). Repository: https://github.com/EverMind-AI/EverOS — **read the repo for deep configuration and internals.** **Prerequisites:** Python 3.12+, an OpenRouter API key (chat + multimodal LLM), a DeepInfra API key (embedding + rerank). ```bash pip install everos # or: uv pip install everos everos init # writes ~/.everos/everos.toml + ome.toml # Edit ~/.everos/everos.toml — set api_key per provider section: # [llm] (OpenRouter, chat LLM) # [multimodal] (OpenRouter; for image/audio/doc parsing) # [embedding] (DeepInfra; also set model + base_url) # [rerank] (DeepInfra; also set model + base_url) everos server start # serves on 127.0.0.1:8000 curl http://127.0.0.1:8000/health # {"status": "ok"} ``` Then call the same endpoints locally (no auth header needed by default): ```bash curl -X POST http://127.0.0.1:8000/api/v2/memory/add -H 'Content-Type: application/json' \ -d '{"session_id": "s1", "messages": [{"sender_id": "user_001", "role": "user", "timestamp": 1711900000000, "content": "I like black coffee."}]}' curl -X POST http://127.0.0.1:8000/api/v2/memory/flush -H 'Content-Type: application/json' -d '{"session_id": "s1"}' curl -X POST http://127.0.0.1:8000/api/v2/memory/search -H 'Content-Type: application/json' \ -d '{"query": "coffee", "user_id": "user_001", "method": "hybrid", "top_k": 5}' ``` Memory is stored as plain Markdown under `~/.everos///users//` (`episodes/`, `atomic_facts/`, `foresights/`, `user.md`), with a rebuildable `.index/` (SQLite + LanceDB). The [Cloud-only endpoints](#cloud-and-self-hosted) are not served. Write against `/api/v2` and the same code runs on Cloud. Same core pipeline as Cloud — Cloud adds managed infra, auto-scaling, and the Console. ### OSS specifics - **Multimodal**: `pip install 'everos[multimodal]'` (+ LibreOffice for Office docs). No upload step — pass `uri` (`http(s)://` fetched server-side, or `file://` on the server) or inline `base64` (with `ext`). On Cloud, upload through `/api/v2/object/sign` first and pass the object key as `uri`. - **Knowledge Wiki**: the self-hosted form of knowledge bases — same category → document → topic model, stored as Markdown on disk, and it ships with ~20 preset categories where a Cloud knowledge base starts empty. Requires embedding + rerank providers. The Cloud endpoints are documented above. - **Reflection**: offline consolidation that merges the fragmented episodes in one similarity cluster into a single coherent narrative (originals soft-archived, not deleted). It is the same engine pass on Cloud and OSS, off by default and weekly when on (`[strategies.reflect_episodes] enabled = true` in `ome.toml`). What differs is control: OSS can change the cron and run it by hand with `POST /api/v2/ome/trigger`; Cloud runs it on schedule only — a trigger endpoint is planned but not exposed yet. For the exact routes, request schemas, config keys, and behavior, read the [EverOS repo](https://github.com/EverMind-AI/EverOS). --- ## Benchmarks & FAQ **Benchmarks:** LoCoMo 93.05% overall (GPT-4.1-mini) vs Zep 85.22% (multi-hop 91.84%, temporal 89.72%) · LongMemEval 83.00% vs MemOS 77.80% · PersonaMem v2: profile consolidation +9% accuracy. **How does it differ from Mem0 / Zep / MemOS?** Those store and retrieve; EverOS runs the full lifecycle — Formation, Consolidation, Recollection. The difference you can measure is the middle one: memories keep being merged, corrected and re-profiled after they are written, so what you retrieve is a maintained view of the user rather than a pile of past text. **How does it handle time?** Every memory carries the `timestamp` of the conversation it came from, so you can scope `get` / `search` to a window with the Filters DSL, and consolidation resolves a stale fact against the newer one that contradicts it. Time-bound *foresight* memories with validity windows exist in the OSS pipeline (on disk under `foresights/`) but are not returned by the API on either deployment. **Quota:** Cloud plans are based on MemCell count (~10 raw messages produce ~1 MemCell, varying with boundary detection).