Potencialize seu agente
Instalação do publicador. Não é um endpoint do PlugMCP.
Host a copy with our keys and logs.
Ainda não há uma versão empacotada no registro. Siga o README do repositório.
URL remota ou um comando na sua máquina? Como as duas instalações diferem
Rodar no PlugMCP
A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.
AbrirLong-term memory for AI agents in a single SQLite file. Your agent remembers what matters, forgets what doesn't, and never repeats a critical mistake — no vector database, no external services, no infrastructure.
Inspired by AtomSpace: memories are graph nodes with truth values, attention weights, and emotional valence. Retrieval fuses vector and lexical search, expands one hop through extracted relations, and ranks by relevance scaled by standing (attention, confidence, tone) under a personality that sets the weights, so nothing outranks a memory about the question because it is important elsewhere. Consolidation runs when the agent is used, not when the clock ticks.
pip install and go.critical_warning, known_antipattern, or context.pip install smrti
Same package as pip install smrti, with the embedding model bundled so a fresh container recalls offline instead of stalling on a first-run download.
docker run -d -p 8420:8420 -v smrti-data:/data ghcr.io/cyqlelabs/smrti
That serves the REST API. Any other command replaces it, and every environment variable in the configuration reference works as usual:
docker run -d -p 8421:8421 -v smrti-data:/data \
-e SMRTI_UPSTREAM_URL=http://host.docker.internal:11434/v1 \
-e SMRTI_API_KEY=your-key \
ghcr.io/cyqlelabs/smrti serve proxy --host 0.0.0.0 --port 8421
v* release publishes latest, the exact version, and a rolling MAJOR.MINOR; pin whichever you want to track./data holds the database, the weights that download on first use (NER on the first extraction, the decision model on the first decision), and the mapped copies of the embedding and NER models that the first load writes; mount a volume or all of them die with the container.smrti.from smrti import Smrti
mem = Smrti(db_path="~/.smrti/memory.db", personality="balanced")
# Store memories
mem.remember("Alice prefers TypeScript", probability=0.9, valence=0.3)
mem.remember("The deploy pipeline is broken", probability=0.95, valence=-0.7)
# Recall by relevance and salience
results = mem.recall("programming languages")
for r in results:
print(f"{r.atom.label} (salience={r.salience:.2f}, confidence={r.atom.truth.confidence:.2f})")
# Report that the recalled memories were used
mem.reinforce([r.atom.id for r in results])
# Assert a belief with a reason, and read the reason back
atom_id = mem.believe("Python is the best language for ML", probability=0.85, evidence="Team survey results")
print(mem.evidence(atom_id)[0].text)
# Stop a memory from surfacing
mem.forget("deploy pipeline")
# Consolidate: revise evidence, decay, promote, prune
epoch = mem.reflect()
print(f"Updated {epoch.beliefs_updated} beliefs, pruned {epoch.atoms_pruned} atoms")
The constructor also takes tenant_id, write_space, read_spaces, ignore_patterns, and temporal (see Multi-Tenant / Space Model). The Python API stores, recalls, forgets, and consolidates; entity extraction and relative-date resolution run in the server modes (pass temporal=True for dates here).
Three model downloads happen on first use, each once: the embedding model (first remember/recall), the decision model (first decision — 250 MB, or the 93 MB student on small machines; SMRTI_DECISIONS=off skips it), and the NER weights (first extraction, server modes only; about 1.1 GB on disk). Plan memory for what you turn on: the decision model holds about 560 MB resident and the NER encoder about 400 MB plus its tokenizer, on top of the embedding model. The total resident size of a server with everything on has not been measured; SMRTI_DECISIONS=off and SMRTI_EXTRACT_MODE=llm (no local tagger) are the two switches that shrink it most.
smrti init --db ~/.smrti/memory.db --personality balanced # create a database
smrti status # inspect it
smrti serve mcp # MCP stdio server (Claude, etc.)
smrti serve rest # REST API on :8420
smrti serve viz # REST API + memory visualizer in the browser
smrti serve proxy # OpenAI-compatible proxy on :8421
smrti serve town # city-builder simulation demo on :8430
smrti serve decisions # student decision model on :8731 (see Semantic decisions)
smrti stop # gracefully stop all servers started by `smrti serve`
smrti stop rest # stop one mode (rest, viz, proxy, town, decisions); --port to narrow further
remember()Embeds and stores text as a typed atom (episode, concept, belief, or goal) with a truth value, attention weight, and valence.
valence unset is estimated from the text. Set it yourself and the memory is a deliberate report, the only kind recall can raise to a behavioral constraint. intensity is how strongly the tone is felt; unset, it is |valence|.type="belief" is believe(): a belief starts at confidence 0.3 and earns more through evidence. Asserted at probability ≥ 0.95 it is permanent and exempt from decay. The evidence reason is kept on the evidence log; evidence(atom_id) lists it.recall()Runs a vector KNN and a BM25 search over the read spaces, fuses them by Reciprocal Rank Fusion, expands one hop through the graph, and ranks by salience:
S = similarity × ( w_sim + w_sti × sti + w_conf × confidence + w_lti × lti + w_val × |valence| × intensity )
Similarity multiplies the standing terms, so a memory that is not about the question cannot outrank one that is; among memories that are, standing decides the order. On top of that:
agent_source_trust discounts an agent-authored memory's standing, never its similarity.max(2, top_k // 6) slots; beliefs keep up to two.min_confidence_to_surface are excluded unless you pass min_confidence; forgotten memories never return.evidence score. Pass rerank=False to skip the judgement. Only what is returned gets the access boost; attend(atom_ids) boosts what an external reranker kept out of a wider recall(boost=False). The REST and MCP recall take both flags.Each result carries a severity: critical_warning (a valence you stated, on anything but a bare concept), known_antipattern (a belief or extracted claim whose probability fell below 0.3, where a superseded preference, constraint or fact lands — episodes, goals and concepts never qualify), or context. An estimated valence never makes a critical warning, however negative: it scores the mood of the words, not a report of a mistake. To record one, state the valence — remember(..., valence=-0.9), the MCP/REST valence field, or the proxy's X-Smrti-Valence header.
forget()Stops memories from surfacing. They are excluded from every recall, no consolidation lifts them back, and the next epoch may prune them. Forgetting is final, so a query forgets only clear matches: up to top_k (5) results in the write space whose similarity to the query is at least min_similarity (0.35) and within 85% of the best match's — never simply the nearest ones. Quoting a memory back finds it. To forget an exact set, recall first and pass the ids: mem.forget(atom_ids=[...]) (also atom_ids on the MCP tool and POST /forget).
reinforce()Reports that recalled memories were used; a cheap test is that distinctive words from a memory appeared in the reply it informed. Use is weak evidence: confidence climbs a little, capped per epoch and discounted for agent-authored memories, and probability does not move.
reflect()One consolidation epoch: revise pending evidence, decay attention and confidence, propagate both to neighbors, heal orphaned episodes, promote high-STI atoms to long-term importance, resolve contradictions (a superseded claim loses), link similar high-LTI atoms (every tenth epoch), and prune what fell below the floors. The servers run one every SMRTI_REFLECT_INTERVAL seconds for each space used in that interval, so idle memory does not age. What you told the agent — episodes, beliefs and goals — decays only to the surfacing floor and stays recallable unless you forget it; what it inferred keeps fading, faster for agent-authored atoms. Contradictions are resolved here, not detected: the epoch acts on contradicts edges, which extraction draws when a new claim supersedes an older one (or which you can draw yourself); it does not compare arbitrary sentences for conflict.
At five points a rule cannot tell what a sentence means. Instead of a generative LLM call, the engine asks Laya, a local multilingual model that answers typed questions (a probability, a choice among options, a score) and never writes prose. It runs as an int8 ONNX graph — no PyTorch, about 560MB resident. Every task is active by default; a task can run in shadow (ask and record, apply nothing) or be turned off. Any failure or timeout falls back to the deterministic path.
The runtime installs with Smrti; the weights do not. The first decision fetches them once (250MB, checked against a checksum) into ~/.smrti/decision-model, or reuses ~/.factor/decision-model when Factor already holds a copy. Fetch and load run on their own thread, so recall answers from the deterministic path until the model is ready. SMRTI_DECISIONS_MODEL points at a directory you unpacked yourself; SMRTI_DECISIONS_URL asks a server that already holds the model (Factor's EdgeJev on loopback, smrti serve decisions, or any POST /v1/systemone) and loads nothing here — one copy of 560 MB is what a small machine can hold, not two; SMRTI_DECISIONS=off downloads nothing at all.
Laya needs AVX2. Without it, a 2011 dual-core took 30 to 48 seconds per decision against a 5-second deadline. So on a CPU without AVX2, or a machine with less than 4 GB of memory, a smaller student model answers instead: a 6-layer multilingual encoder trained on Laya's answers, fetched once (93 MB) into ~/.smrti/student-model. It answers in 0.1 to 2.3 seconds on that same dual-core and agrees with Laya on 75–94% of Smrti's questions. It cannot judge entity, because the candidates change with every call, so entity matches there take the deterministic path. SMRTI_DECISIONS_ENGINE forces either model. smrti serve decisions serves the student on :8731 so Factor and several Smrti processes can share one copy through SMRTI_DECISIONS_URL.
A decision never restores a forgotten atom, confers permanence, changes tenant or space, or mints a critical warning. Its confidence is logged, never written into a truth value.
export SMRTI_DECISIONS=off # deterministic only
export SMRTI_DECISIONS_RERANK=shadow # per task: off | shadow | active
export SMRTI_DECISIONS_MODEL=/models/laya-int8 # a directory you unpacked; no download
export SMRTI_DECISIONS_ENGINE=student # auto | laya | student
export SMRTI_DECISIONS_THREADS=2 # cap the cores inference may hold
GET /decisions lists every decision, /metrics counts them as smrti_decisions_total, make bench-decisions scores the routing gate, make bench-tone the tone check, and make distill retrains the student. Thresholds are in the Configuration Reference.
Exposes 8 tools over stdio for direct LLM integration.
Claude Code:
claude mcp add smrti -- smrti serve mcp
Claude Desktop (or any MCP client) — add to your MCP config:
{
"mcpServers": {
"smrti": {
"command": "smrti",
"args": ["serve", "mcp"],
"env": { "SMRTI_DB": "~/.smrti/memory.db" }
}
}
}
Full CRUD over HTTP on port 8420:
smrti serve rest --host 0.0.0.0 --port 8420
# Store a memory
curl -X POST http://localhost:8420/remember \
-H "Content-Type: application/json" \
-d '{"content": "Alice prefers TypeScript", "probability": 0.9}'
# Recall
curl -X POST http://localhost:8420/recall \
-d '{"query": "programming languages", "top_k": 5}'
# Report that recalled memories shaped the reply — being used builds confidence
curl -X POST localhost:8420/reinforce \
-H 'Content-Type: application/json' \
-d '{"atom_ids": ["4f2c…", "9ab1…"]}'
# Run consolidation
curl -X POST http://localhost:8420/reflect
# Get status
curl http://localhost:8420/status
# Compare two spaces (op = overlap | intersection | diff)
curl -X POST http://localhost:8420/space_query \
-d '{"op": "overlap", "other_space": "personal"}'
# Grow a bridge space from what two spaces share
curl -X POST http://localhost:8420/space_merge \
-d '{"other_space": "personal", "min_jaccard": 0.1}'
# Boost only what you kept from a wide, unboosted recall you reranked yourself
curl -X POST http://localhost:8420/attend \
-d '{"atom_ids": ["4f2c…"]}'
# The semantic decision log (see "Semantic decisions"), newest first
curl http://localhost:8420/decisions
Every endpoint takes an optional space to route the call; /space_query and
/space_merge compare that space with other_space and refuse a self-compare.
The fastest way to add memory to an existing app: point your OpenAI client at the proxy and keep everything else the same. It intercepts each chat request, injects relevant memories into the system prompt, and stores the exchange afterward.
smrti serve proxy --host 0.0.0.0 --port 8421 --upstream https://api.openai.com
from openai import OpenAI
client = OpenAI(
base_url="http://localhost:8421/v1",
api_key="sk-..." # forwarded to upstream
)
response = client.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "What do you know about Alice?"}],
extra_headers={
"X-Smrti-Tenant-Id": "user_123",
"X-Smrti-Write-Space": "work",
"X-Smrti-Read-Spaces": "work,personal",
}
)
On every request the proxy:
YOU MUST NOT / AVOID) for critical_warning and known_antipattern memories, and background context (Note:) for the rest — each with a confidence qualifiercritical_warning; a client that knows the user is reporting a mistake to avoid sends X-Smrti-Valence: -0.9 (and optionally X-Smrti-Intensity) with that request, and the user message is stored with the valence stated. An out-of-range or non-numeric value is a 400.Works with any OpenAI-compatible upstream — including local llama.cpp, vLLM, or Ollama endpoints.
smrti serve viz opens a browser-based graph explorer to inspect atoms, relations, and attention weights, plus an LLM Calls debug tab showing every extraction request with full request/response, timing, and recalled memories.
All server modes read the same environment variables. Everything works with zero configuration; set these to customize.
Core (all modes):
Security (REST / proxy / viz):
Proxy:
Extraction (all modes):
To get the knowledge graph from serve rest or serve mcp, point SMRTI_EXTRACT_URL (and SMRTI_EXTRACT_MODEL) at an OpenAI-compatible endpoint; the proxy uses its upstream. Unset, extraction runs local NER only.
Semantic decisions (all modes, see above):
Agentic frameworks often produce periodic system messages (heartbeat checks, status pings, tool scaffolding) that should not pollute memory. Any remember() call matching SMRTI_IGNORE_PATTERNS is silently dropped before embedding or extraction:
export SMRTI_IGNORE_PATTERNS="^# Heartbeat Check
^HEARTBEAT_OK$"
Patterns are matched with re.search (anchors optional) and apply to all server modes.
API key auth — HTTP servers are open by default for local use. Set SMRTI_API_KEY to require a key on every REST, proxy, and visualizer request (Authorization: Bearer <key> or X-Api-Key: <key>). The CLI warns when you bind to a non-loopback host without a key set.
Prometheus metrics — REST and proxy expose GET /metrics in Prometheus text format, with zero extra dependencies. Gauges include smrti_atoms_total, smrti_atoms_by_type, smrti_epoch_count, and the active personality hyperparameters, all labeled by tenant and space.
Tenants are hard walls: atoms, embeddings, and attention weights never cross them. Spaces are permeable layers within a tenant: you write to one, read from many, and each has its own personality and consolidation cycle.
researcher = Smrti(tenant_id="team", write_space="researcher",
read_spaces=["researcher", "shared"], personality="curious")
deployer = Smrti(tenant_id="team", write_space="deployer",
read_spaces=["deployer", "shared"], personality="deterministic")
coordinator = Smrti(tenant_id="team", write_space="coordinator",
read_spaces=["coordinator", "shared", "researcher", "deployer"],
personality="analytical")
shared = Smrti(tenant_id="team", write_space="shared")
Each space consolidates independently: the researcher forgets fast, the deployer holds onto critical failures, and the coordinator reads everything through its own personality. This suits agent teams with private working memory and shared context, multi-agent simulations, and per-role views of one user.
Spaces also support set operations (overlap, intersection, difference, union, symmetric difference) and can materialize a bridge space from what two spaces share, via the space_query and space_merge MCP tools or the POST /space_query and POST /space_merge REST endpoints. Bridges are built only on request, never by the consolidation epoch.
Six built-in presets control retrieval behavior, decay rates, and emotional dynamics:
Each preset tunes 17 hyperparameters. To create a custom personality, start from a preset and override individual values via the personality DB table or the /personality API endpoint.
Salience weights — control how retrieval ranks results (should sum to ~1.0):
Belief dynamics — govern how confidence evolves over time:
Attention dynamics — control what stays in focus:
Provenance — weighs what the agent wrote against what the user said:
Emotional dynamics — shape how valence influences behavior:
graph TD
subgraph Facade
S["Smrti<br/><small>remember · recall · attend · believe · reinforce · reflect · forget · status</small>"]
end
subgraph Servers
MCP["mcp.py<br/><small>MCP stdio</small>"]
REST["rest.py<br/><small>FastAPI :8420</small>"]
PROXY["proxy.py<br/><small>OpenAI proxy :8421</small>"]
end
subgraph Core
AS["AtomSpace"]
DB["Database"]
EMB["Embedder"]
MOD["Models"]
end
subgraph Retrieval
FAN["fan_out<br/><small>vector + BM25, fused</small>"]
SAL["salience"]
DIV["diversify"]
CLS["classify"]
end
subgraph Evolution
EPO["epoch"]
TRU["truth"]
REI["reinforcement"]
CON["connections"]
HEA["healing"]
end
subgraph Spaces
SOP["set_ops"]
EMG["emergence"]
end
subgraph Extraction
EXT["extract"]
RES["resolve"]
ALI["aliases"]
TMP["temporal"]
end
subgraph Decisions
DEC["engine · policies · audit<br/><small>core · active by default</small>"]
LAYA["laya · student · remote<br/><small>multilingual int8 ONNX · local or served · typed judgements</small>"]
end
subgraph Storage
SQL["SQLite + sqlite-vec<br/><small>multilingual-MiniLM-L12-v2 · 384d · ONNX CPU</small>"]
end
MCP & REST & PROXY --> S
S --> Core & Retrieval & Evolution & Extraction & Spaces
Retrieval & Extraction -.->|"shortlist · route · verify"| DEC
DEC --> LAYA
Core & Retrieval & Evolution & Extraction & Spaces --> SQL
Retrieval: embed the query → vector + BM25 search, fused → 1-hop graph expansion → salience ranking → local evidence judgement → diversity cap → top-k → access boost on what was returned. Consolidation: the epoch steps under reflect().
Each atom carries:
probability [0,1] and confidence [0,1]. Confidence grows with evidence: every stated reason, re-mention, report of use, or supersession revises it (PLN revision). For episodes and concepts, which hold no proposition, it is retention strength rather than truth.sti (short-term importance, decays fast) and lti (long-term, accumulates).valence a recall result reports is its current mood, which drifts toward its neighbors during consolidation.text).A living demo: smrti-town is a city-builder where every citizen carries a persistent smrti memory graph. You place the Town Hall and choose a mayor; an LLM-generated council debates what to build, citizens immigrate, work, and petition — and every decision they make is driven by what they remember.
smrti serve town # simulation + frontend on :8430
pytest tests/ -v
Two harnesses in bench/ ingest a published dataset as episodes and answer its questions through recall. Retrieval and answering are scored separately, so a strong answering model cannot hide a retrieval regression.
Config (2026-08-26): extraction off · no consolidation epochs · decisions off · top_k=50 · deterministic preset · gemini-3.7-flash answering and judging. This measures retrieval alone, and it predates the current ranking formula; re-run make bench before reading the numbers against the current engine. The decision layer, active by default in the engine, has not been benchmarked here.
make datasets # fetch both into data/ (265MB + 32MB, once)
make bench # fails if the retrieval hit rate drops
make bench-halumem # fails if the hallucination rate rises
# add --extract-url/--extract-model to either to build the entity graph
# add --epochs N to consolidate each history N times before querying it
# add --top-k 5 to measure at the proxy's injection budget (10 for the MCP tool)
Each benchmark locks its config beside a recorded baseline and refuses to compare across configs; --epochs and --top-k join the fingerprint when set. The harness runs with every decision task off unless --decisions shadow|active is passed, which joins the fingerprint too: the gate measures the deterministic retrieval path the baselines were recorded on, and a decision-mode run needs its own baseline (--update-baseline under that mode). Neither is a CI gate: both need the datasets, the embedding model, and a judge key.
Where it is strong. LongMemEval retrieves the annotated evidence for five of six abilities without a miss; temporal reasoning and assistant's-own-words questions are answered perfectly. On HaluMem's memory boundary questions (things the user never said), smrti answers correctly 97% of the time and invents something 2.9% of the time.
Where it is weak. HaluMem's synthesis categories hallucinate heavily: dynamic update 71%, multi-hop inference 63%, generalization 62%. smrti rarely declines to answer (8.9% omission, where published systems omit 17–35%), so an unknown often comes out as an assertion.
Unmeasured. The entity graph (--extract-url, about 1.25 s and one LLM call per turn) and consolidation (--epochs). HaluMem's memory-extraction and memory-update tasks are not implemented.
These numbers are not directly comparable to published results: the subsets are small (40 to 180 questions, so one question moves a category by several points), a single judge grades them where published protocols average three, and the answering model differs. LongMemEval leaderboard figures for reference: MemOS 77.8, Memobase 72.4, Mem0 66.4, Zep 63.8.
An existing database is upgraded the first time a newer version opens it, with a .pre-migration.bak snapshot written beside it first; restore that file to downgrade. Migrations and data repairs are idempotent. The repairs rebuild the tone of entities extracted by earlier versions, drop the hub edges the old healing step drew, and let the pruner remove memories forgotten before this version. Bridge spaces an older epoch created on its own (a_x_b) are left in place; remove one with DELETE /spaces/current?space=a_x_b.
MIT
Memory engine for self-evolving AI agent ecosystems. Multi-tenant, multi-space isolation with Bayesian truth maintenance, emotional valence, automatic consolidation, and configurable per-agent persona
Visão geral
Memory engine for self-evolving AI agent ecosystems. Multi-tenant, multi-space isolation with Bayesian truth maintenance, emotional valence, automatic consolidation, and configurable per-agent personality.
Ferramentas
Ainda não há lista de ferramentas. Servidores remotos recebem uma após a primeira verificação de saúde.
Perguntas frequentes
Copie nesta página a configuração stdio para Cursor, Claude Desktop, Claude Code ou VS Code. Ela usa a instalação do publicador, não um proxy do PlugMCP.
Este registro não lista nenhuma variável de ambiente obrigatória.
Smrti roda localmente via stdio.
Última verificação: 2026-10-28. Memory engine for self-evolving AI agent ecosystems. Multi-tenant, multi-space isolation with Bayesian truth maintenance, emotional valence, automatic consolidation, and configurable per-agent personality.