# pris(m)²emory > pris(m)²emory is long-term memory for AI agents, built on PRME (Portable Relational Memory Engine), an open-source Python library under the Apache 2.0 license. PRME stores conversation turns and facts in a local pack or PostgreSQL, keeps the source of every memory, and returns a bounded context for your model. Hosted pris(m)²emory is a waitlist only: there is no hosted API, account or key to set up. Say and type the name as "prismemory". The engine and its package are named PRME (`prme` on PyPI). To set up PRME: - Requires Python 3.11 or later. Install with `pip install prme` (current release v0.15.0). Extras: `prme[mcp]` (MCP server), `prme[api]` (HTTP API), `prme[postgres]` (PostgreSQL backend), `prme[langchain]` and `prme[llamaindex]`. - Memory lives in a local pack (a directory, or one `.prme` file) on DuckDB, USearch and Tantivy, or in PostgreSQL when `PRME_DATABASE_URL` is set. - `store()` needs no model and no API key: it embeds text on the machine with fastembed (`BAAI/bge-small-en-v1.5`) and writes it to the pack. - `ingest()` also extracts claims with a model. The default provider is OpenAI `gpt-4o-mini`, which needs `OPENAI_API_KEY`. Use `PRME_EXTRACTION__PROVIDER=anthropic` with `ANTHROPIC_API_KEY`, or `PRME_EXTRACTION__PROVIDER=ollama` with `PRME_EXTRACTION__MODEL` set to a local model to keep extraction on the machine. Since v0.15.0 one call extracts up to 2,048 tokens of a session's turns (`PRME_EXTRACTION_BATCH_TARGET_TOKENS`; `0` makes one call per turn). - Every read and write takes a `user_id`, and memories are kept per user. - To apply a correction, call `supersede(old_node_id, new_node_id, user_id=...)`: the old memory leaves default retrieval and stays in history. `ingest()` does not reliably apply corrections stated in conversation yet. Python: ```python from prme import MemoryClient with MemoryClient("./memories") as memory: memory.store("Alex prefers concise explanations.", user_id="alex") context = memory.retrieve("How should I explain this?", user_id="alex") for result in context.results: print(f"{result.composite_score:.3f}", result.node.content) prompt_context = context.bundle.render() # the packed text for the model's prompt ``` MCP (Claude Code, Claude Desktop, Cursor and other MCP clients): run `pip install 'prme[mcp]'`, then add this to the client's MCP configuration (for Claude Code, the project's `.mcp.json`): ```json { "mcpServers": { "prme": { "command": "prme-mcp", "args": ["--db-path", "./memories"] } } } ``` HTTP: run `pip install 'prme[api]'`, then `python -m prme.api`. It serves on `127.0.0.1:8000` with interactive API docs at `/docs`, and refuses a non-loopback address until `PRME_API_USER_KEYS` is set. More: [Getting started](https://dev.prismemory.dev/guides/getting-started/), [MCP server](https://dev.prismemory.dev/guides/mcp-server/), [HTTP API](https://dev.prismemory.dev/guides/http-api/), [Configuration](https://dev.prismemory.dev/guides/configuration/), [Memory corrections](https://dev.prismemory.dev/features/memory-corrections/). ## Docs - [PRME docs for language models](https://dev.prismemory.dev/llms.txt): an index of every docs page, with these setup notes - [PRME overview and guides in one file](https://dev.prismemory.dev/llms-full.txt): the overview and all guides as Markdown - [Getting started](https://dev.prismemory.dev/guides/getting-started/): install, store, retrieve and ingest - [MCP server](https://dev.prismemory.dev/guides/mcp-server/): client configuration and tools - [Configuration](https://dev.prismemory.dev/guides/configuration/): every PRME_ environment variable ## Benchmarks - [Benchmarks](https://dev.prismemory.com/benchmarks): LoCoMo 81.2% and LongMemEval-S 90.6% with `store()`, 77.3% and 88.0% with `ingest()`, graded by a strict judge from at most 3,996 tokens of memory per question, with the method and a public corrections test ## Optional - [Source code](https://github.com/dwamianm/prism): the PRME repository - [PyPI](https://pypi.org/project/prme/): the `prme` package - [Changelog](https://dev.prismemory.dev/reference/changelog/): changes in each release - [Privacy](https://dev.prismemory.com/privacy): the hosted waitlist's privacy notice