Expand description
Agentic Memory substrate for Kyma.
Memory is stored as ordinary Kyma columnar tables (memory_nodes /
memory_edges) registered as the memory graph, so it is first-class
queryable (run_sql/run_kql/Discover) and renders in the unified
GraphView. Embeddings are a FixedSizeList<Float32> column searched via the
platform cosine_distance UDF. Storage is append-only; mutations write a new
version and recall dedups to the latest by updated_at.
See docs/superpowers/specs/2026-05-31-agentic-memory-design.md (M1).
Re-exports§
pub use embed::build_embedding_backend;pub use error::MemoryError;pub use error::Result;pub use types::CreateMemory;pub use types::MemoryStatus;pub use types::MemoryType;pub use types::RecallFilter;
Modules§
- embed
- Embedding-backend construction. Memory is the first server-side consumer of
kyma-embed; the backend (an ONNX model for fastembed) is built once and shared process-wide via aOnceCellso the model loads at most once. - error
- Error type for the memory layer.
- rows
- Build JSON rows for the columnar memory tables. Rows are serialized to
NDJSON and coerced to Arrow by
kyma_ingest_core::parse_ndjson, so theembeddingvalue is a plain JSON array of floats. - schema
- Arrow schemas for the columnar memory tables.
- sql
- SQL builders for memory recall / listing. The queries run server-side
(where
KymaTable+ thecosine_distanceUDF live) against the columnar memory tables. Each query first dedups to the latest version per node id (row_number() ... ORDER BY updated_at DESC), matching the append-only “latest-wins” model. - types
- Memory domain types.
Structs§
- Memory
Writer - Writes memory data and provisions the memory database/tables/graph on demand.
Constants§
- DEFAULT_
DATABASE - Dedicated database that holds the memory tables.
- DEFAULT_
REALM - Default per-item realm when none is supplied.
- EDGE_
DERIVED_ FROM - EDGE_
INVALIDATES - EDGE_
MERGED_ INTO - EDGE_
REFERENCES - Canonical memory edge-relationship types.
- EDGE_
RELATES_ TO - EDGE_
RESOLVES_ TO - EDGE_
TABLE - GLOBAL_
REALM - Shared realm for cross-project facts; recall unions project ∪ global.
- GRAPH_
NAME - Registered graph name for memory.
- HALF_
LIFE_ DAYS - Half-life (days) for recency decay
exp(-ln2 * age_days / HALF_LIFE_DAYS). - IMPORTANCE_
WEIGHT - NODE_
TABLE - RELEVANCE_
WEIGHT - Recall re-rank blend:
score = RELEVANCE_WEIGHT*(1-distance) + IMPORTANCE_WEIGHT*importance. - RRF_K
- Reciprocal-rank-fusion constant in
1/(RRF_K + rank). - W_GRAPH
- W_
IMPORTANCE - W_
KEYWORD - W_
RECENCY - W_RRF
- Graph-aware hybrid recall blend. The final score fuses reciprocal-rank
fusion (RRF) of the vector + keyword candidate lists with semantic
similarity, keyword match, graph proximity, importance, and recency (see
the
memory_retrieveorchestrator). Tunable; sane defaults below. - W_
SEMANTIC