Skip to main content
Plyra Memory Retrieval Flow

recall()

Searches across all three memory layers simultaneously and returns a ranked list of results.

How scores are computed

Each result carries a composite score fused from three signals: Weights are configurable via MemoryConfig or env vars:
The weights must sum to 1.0.

Filtering by layer

RecallResult fields

RankedMemory fields

context_for()

Builds a token-budgeted string ready to inject into a prompt. Internally calls recall() with top_k=50, then fills the budget with the highest-scoring results.

ContextResult fields

Token budget

The default token budget comes from MemoryConfig.default_token_budget (default: 2048). Override per-call:

Embedding model

By default, plyra-memory uses all-MiniLM-L6-v2 from sentence-transformers (384-dimensional embeddings, runs locally).