Feature · Context recall

Memory

Prism Memory stores what was said in a conversation and retrieves the records that bear on a new question, ranked by meaning and, optionally, by how recent they are.

Use it with a Harness thread or on its own to select context without sending the complete conversation on every turn.

  • PHP
  • TypeScript
  • Python

Capabilities

What it does

01

Remember and recall

Store a whole exchange, including tool steps, then recall by meaning and add the result to the prompt as context.

PHP
$memory = PrismMemory::for($user, scope: 'support');

$ids = $memory->remember($response->messages);

$recollection = $memory->recall('billing address', budget: 1500);

02

Fits a token budget

Recall can fill up to a number of estimated tokens instead of a fixed limit. Memories are taken best first; one that does not fit is skipped and smaller ones behind it can still be taken.

03

Relevance and recency

A weighting mixes relevance and recency, or uses relevance only.

04

Scoped by owner

Memory is addressed by owner and scope. Recall in one scope never returns another scope’s memories.

05

Your database, then pgvector (PHP)

The PHP package embeds through Prism and stores in your database, with no Redis, vector database or queue worker required. Larger collections can switch to pgvector, and other vector stores can be registered.

06

Harness recall (PHP)

Memory can act as the Harness eviction sink: turns compaction pushes out of the context window are stored, and the agent gets a recall tool that searches them within the budget Harness passes.

How it fits

Where it sits in the ecosystem

The PHP package is a complete memory layer: it embeds through Prism, stores in your database, queues the embedding work and fits recall to a token budget.

The TypeScript and Python packages provide the storage contract, vectors, ranking and an in-memory store. They do not embed text: you supply the vectors from your own embeddings call.

Install

Add it to your project

  1. 01

    particle-academy/prism-memory PHP

  2. 02

    @particle-academy/prism-memory TypeScript

  3. 03

    prism-ai-memory Python

The packages

On the registries

PHP · Packagist

particle-academy/prism-memory

TypeScript · npm

@particle-academy/prism-memory

Python · PyPI

prism-ai-memory