Memory Core
intermediateStore, retrieve, recall, explain, predict, and forget memories using the text API. The primary endpoints for memory operations.
The text API (/v1/memory/text/*) is the high-level interface for working with memories as text. The engine handles embedding, storage, and retrieval automatically.
For the low-level vector API (/v1/memory/store, /v1/memory/query, /v1/memory/retrieve), see Memory Vectors.
Store
/v1/memory/text/storeStore a text fact in memory. The text is embedded server-side using paraphrase-multilingual-MiniLM-L12-v2.
textstringrequiredThe text content to memorize. Min 1, max 10,000 characters.
metadataobject | nullArbitrary key-value pairs (role, category, source, etc.).
{
"success": true,
"pattern_id": "pat_a7f2c1e9",
"embedding_dim": 384,
"patterns_used": 42,
"patterns_limit": 5000
}curl -X POST https://api.engramma-memory.com/v1/memory/text/store \
-H "X-API-Key: $ENGRAMMA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"text": "Paris is the capital of France",
"metadata": {"category": "geography", "source": "textbook"}
}'Batch store
/v1/memory/text/batch-storeStore multiple text facts in a single request.
itemsarrayrequiredArray of TextStoreRequest objects. Min 1, max 50 items. Each item has text (required) and metadata (optional).
{
"stored": 3,
"failed": 0,
"pattern_ids": [
"pat_001",
"pat_002",
"pat_003"
],
"latency_ms": 45.2
}curl -X POST https://api.engramma-memory.com/v1/memory/text/batch-store \
-H "X-API-Key: $ENGRAMMA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"items": [
{"text": "Python was created by Guido van Rossum"},
{"text": "JavaScript was created by Brendan Eich"},
{"text": "Go was created at Google in 2009"}
]
}'Retrieve
/v1/memory/text/retrieveRetrieve the most relevant stored facts for a text query. Uses cosine similarity in embedding space.
querystringrequiredThe query text. Min 1, max 5,000 characters.
top_kintegerDefault: 5Number of results to return (1-50).
{
"results": [
{
"text": "Paris is the capital of France",
"metadata": {
"category": "geography"
},
"similarity": 0.94,
"pattern_id": "pat_a7f2c1e9"
}
],
"latency_ms": 2.3
}curl -X POST https://api.engramma-memory.com/v1/memory/text/retrieve \
-H "X-API-Key: $ENGRAMMA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "What is the capital of France?", "top_k": 3}'Recall
/v1/memory/text/recallIntelligent recall with Active Inference + semantic boost. Uses the full 10-step retrieval cycle with semantic re-ranking by co-access patterns. Better results after the memory has been used for a while.
querystringrequiredThe query text. Min 1, max 5,000 characters.
top_kintegerDefault: 5Number of results to return (1-50).
{
"results": [
{
"text": "Paris is the capital of France",
"metadata": {
"category": "geography"
},
"similarity": 0.96,
"pattern_id": "pat_a7f2c1e9"
}
],
"info": {},
"latency_ms": 8.1
}/text/recall returns higher-quality results than /text/retrieve because it uses learned access patterns for re-ranking. Use /text/retrieve for simple similarity search, and /text/recall when you want the full cognitive engine.
Similarity
/v1/memory/text/similarityCompute semantic similarity between two texts. Returns cosine similarity in embedding space.
text_astringrequiredFirst text. Min 1, max 5,000 characters.
text_bstringrequiredSecond text. Min 1, max 5,000 characters.
{
"similarity": 0.87,
"embedding_dim": 384
}Predict
/v1/memory/text/predictPredict what the user will ask next based on temporal patterns. Uses Granger causality in the temporal tracker.
querystringrequiredCurrent query/context. Min 1, max 5,000 characters.
top_kintegerDefault: 5Number of predictions to return (1-50).
{
"predictions": [
{
"text": "What is the population of France?",
"pattern_id": "pat_def456",
"strength": 0.72
}
]
}Explain
/v1/memory/text/explainGet a human-readable explanation of the last recall. Describes how a memory was retrieved, including source, confidence, method, and age.
querystringrequiredThe query that was recalled. Min 1, max 5,000 characters.
langstring | nullLanguage for explanation: fr or en. Auto-detected if null.
{
"explanation": "High-confidence match (0.94) via cosine similarity. The stored fact 'Paris is the capital of France' directly answers the query. Stored 5 days ago, accessed 12 times.",
"method": "cosine_similarity",
"confidence": 0.94
}Forget
/v1/memory/text/forgetSelective forget — erase patterns by category or semantic query. Unlike GDPR full erasure, this only removes matching patterns.
querystring | nullSemantic query to match patterns to forget. Min 1, max 5,000 characters.
categorystring | nullGDPR category to forget (identity, location, health, etc.).
thresholdnumberDefault: 0.85Similarity threshold for query-based forget (0.5 to 1.0).
{
"forgotten": 3,
"pattern_ids": [
"pat_001",
"pat_002",
"pat_003"
]
}At least one of query or category must be provided. Higher threshold = more precise (fewer deletions). Lower threshold = broader match.
curl -X DELETE https://api.engramma-memory.com/v1/memory/text/forget \
-H "X-API-Key: $ENGRAMMA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query": "my home address", "threshold": 0.9}'Stats
/v1/memory/text/statsGet text memory statistics for the current tenant.
{
"total_patterns": 142,
"embedding_dim": 384,
"storage_bytes": 245760
}Important
/v1/memory/text/importantList all facts classified as important (identity, health, location, etc.). These facts are protected from eviction during sleep consolidation cycles.
{
"important": [
{
"pattern_id": "pat_abc123",
"text": "My name is Alice",
"category": "identity",
"protected": true
}
]
}Embed
/v1/memory/text/embedReturn the embedding vector for a text string. Uses the same encoder as store/retrieve. Useful for calling vector-based endpoints with text.
textstringrequiredText to embed. Min 1, max 10,000 characters.
{
"embedding": [0.023, -0.041, 0.089, ...],
"dim": 384
}Next steps
- Memory Vectors — Low-level vector API (store/query/retrieve with raw embeddings)
- Engine Advanced — Semantic, explorer, consolidation
- Errors — Error handling