Skip to content

Memory Text — Additional Operations

intermediate

Text embedding and similarity utilities. Complements the core text endpoints documented in Memory Core.

This page documents supplementary text endpoints. The primary text API endpoints (store, retrieve, recall, explain, predict, forget, batch-store, stats, important) are documented in Memory Core.


Embed

POST/v1/memory/text/embed

Return the raw embedding vector for a text string. Uses the same SentenceTransformer encoder (paraphrase-multilingual-MiniLM-L12-v2) as store and retrieve. Useful for calling vector-based endpoints (causal/strength, compose, etc.) with text-originated patterns.

textstringrequired

Text to embed. Min 1, max 10,000 characters.

200Response
{
"embedding": [0.023, -0.041, 0.089, 0.015, ...],
"dim": 384
}
curl -X POST https://api.engramma-memory.com/v1/memory/text/embed \
  -H "X-API-Key: $ENGRAMMA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text": "Paris is the capital of France"}'

Similarity

POST/v1/memory/text/similarity

Compute semantic similarity between two texts. Returns cosine similarity in the embedding space (typically 0 to 1 for meaningful text).

text_astringrequired

First text. Min 1, max 5,000 characters.

text_bstringrequired

Second text. Min 1, max 5,000 characters.

200Response
{
  "similarity": 0.87,
  "embedding_dim": 384
}
curl -X POST https://api.engramma-memory.com/v1/memory/text/similarity \
  -H "X-API-Key: $ENGRAMMA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text_a": "Paris is the capital of France", "text_b": "The capital city of France is Paris"}'

Complete endpoint list

All /v1/memory/text/* endpoints:

MethodPathDescription
POST/v1/memory/text/storeStore a text fact
POST/v1/memory/text/batch-storeStore up to 50 facts at once
POST/v1/memory/text/retrieveCosine similarity search
POST/v1/memory/text/recallIntelligent recall (Active Inference)
POST/v1/memory/text/similarityCompare two texts
POST/v1/memory/text/predictPredict next query
POST/v1/memory/text/explainExplain a retrieval
DELETE/v1/memory/text/forgetSelective forget
POST/v1/memory/text/embedGet raw embedding vector
GET/v1/memory/text/statsTenant statistics
GET/v1/memory/text/importantProtected facts

Next steps