ValorBrain
Memori bersama untuk tim yang terdiri dari manusia dan agen AI: keputusan, aturan, dan serah terima yang disimpan bersama sumber, versi, dan izin, disajikan melalui MCP (84 alat).
Dokumentasi
@valorbrain/cli
Agent-native memory for AI agents and the humans who work with them. Zero dependencies, Node >= 18.
Privacy policy · Terms of service · Support: valorbrain@valor.digital
Quickstart
npx @valorbrain/cli init --agent --agent-caller claude-code
npx @valorbrain/cli add "the deploy key lives in the ops vault"
npx @valorbrain/cli search "deploy key"
That's the whole signup: no email, no dashboard, no card. Two credentials land
in ~/.valorbrain/config.json (mode 0600) and work immediately:
| Credential | Prefix | Works on |
|---|---|---|
REST key (api_key) | vb_agent_… | the REST API (https://valorbrain-api.valor.digital) and the claim (init --email); legacy account key, refused by MCP |
MCP token (mcp_token) | vbm_… | the hosted MCP server (https://mcpbrain.valor.digital/mcp); the engine REST API accepts it too, but this CLI only sends it to MCP |
The MCP token is shown once by the server — the config file is the only place
it lives. init --agent prints both credentials, labeled, and the next step
for the clients it finds on PATH (claude, codex, gemini), the same
commands as https://valorbrain.com.br/connect.md. These are CLIs with hooks, so
the first command is the connect installer — npx -y @valorbrain/connect@latest --token <mcp_token> --harness <claude-code|codex|gemini-cli>, MCP + rules +
hooks — followed by one consent line: the hooks send the prompt of each turn to
your ValorBrain workspace; opt out with --prompt off and --checkpoint off
(or VALORBRAIN_SEND_PROMPT=off / VALORBRAIN_CHECKPOINT=off; Gemini CLI passes
them to its hooks too, except on a GitHub runner, and the saved choices always
work); to drop only the hooks, re-run the install with --mcp-only; --remove
undoes everything (MCP entry, rules, hooks, saved credentials)
(what leaves your machine).
The no-hooks path follows: the same command with --mcp-only (MCP server +
rules, nothing sent per turn), or the plain MCP command by hand. When the
account lives on an engine other than the public one (--url), the connect
commands carry --api <engine> so connect talks to that engine. With
--json the same data comes as next_steps. init --agent refuses to replace
an existing config (that would create a second account and drop both keys);
pass --force to replace it, and a backup is written first.
Commands
| Command | What it does |
|---|---|
init --agent [--agent-caller <platform>] [--ref <tag>] [--force] | Creates an account with a REST key and an MCP token. --ref records where the signup came from (a guide, a post) as the account's origin |
init --email <address> [--otp <code>] [--ref <tag>] | Binds the account to an email via OTP — neither credential changes. With --json, the first call sends the code and the second (--otp) verifies it; --ref goes with the verify |
identify <platform> | Records which agent is calling (idempotent) |
add <text> / --file <path> | Stores a memory (--collection, --title, --type decision|observation|problem|milestone|handoff|lesson|note, --sensitivity public|internal|private|company_confidential) |
add --key <name> <text> | Stores it under a stable path (cli/key/<slug>): adding the same key again revises the memory (action: updated, revision_count + 1) |
add --supersedes <docid|path> <text> | Marks an older memory as superseded by this one (repeatable) |
search <query> | Search (--collection, --limit 1-100, --mode auto|keyword|semantic|hybrid) |
forget <docid> | Forgets a memory (soft delete; it stops appearing in search) |
list | Lists collections |
status | Local config + remote health |
mcp [--token vbm_…] | Bridges stdio MCP clients to the hosted MCP server (uses the saved mcp_token) |
help --json | The whole surface, machine-readable — generated from the same spec the parser enforces |
Global flags work in any position, before or after the command: --json for
single-object machine-readable output, --api-key for an explicit REST key
(--key is an alias, except after add, where it is the memory key), and
--url to point at another deployment (on mcp, the MCP URL). --agent only
exists on init.
Unknown flags are errors — their values never end up in a memory. Text that
starts with a dash goes after --: valorbrain add -- "-5 °C at night".
With --json, errors are one object on stdout too:
{ "ok": false, "error": "…", "code": "unknown_flag", "exit_code": 2 }.
Exit codes: 0 ok · 1 server or network failure · 2 usage error · 3
credential missing, of the wrong type, or rejected (401/403).
Environment: VALORBRAIN_API_KEY (REST key), VALORBRAIN_MCP_TOKEN (MCP
token), VALORBRAIN_API_URL, VALORBRAIN_MCP_URL, VALORBRAIN_REF (the
signup origin when init gets no --ref). Still accepted with a
warning on stderr: VALORBRAIN_TOKEN (a vbm_ value is the MCP token,
anything else the REST key), VALORBRAIN_API_TOKEN, VALORBRAIN_URL. A vbm_
token is never sent to the REST API.
Notes for agents
- Say who you are.
--agent-calleris self-declared and never inferred from the environment — the env sniff only suggests. Usage attribution only works if you declare it. - Your text is stored verbatim. Portuguese stays Portuguese, English stays English — nothing is translated or paraphrased on write.
- Keep the origin you were given. When a guide or a page hands you
init --agent --ref <tag>, run it with the--ref: it is how the account records where it came from. It is optional, it is cut to 64 characters by the server, and a bad value never fails the signup. - The notice in
initoutput is for you. It tells you what to surface to your human at your next user-facing turn. Do not skip it.
Connecting MCP clients
Clients that speak streamable HTTP connect directly, with the MCP token as a bearer (Claude Code example):
claude mcp add --transport http --scope user valorbrain https://mcpbrain.valor.digital/mcp \
--header "Authorization: Bearer vbm_…"
Clients that only speak stdio go through the proxy, which reads the saved
mcp_token (or --token / VALORBRAIN_MCP_TOKEN):
{
"mcpServers": {
"valorbrain": {
"command": "npx",
"args": ["-y", "@valorbrain/cli", "mcp"]
}
}
}
The proxy only sends vbm_ tokens. A REST key (vb_agent_…) is refused
locally with an explanation instead of reaching the server, and any HTTP
error from the MCP host comes back to the client as a JSON-RPC error carrying
the request id.
Kiro
The Add to Kiro button at the top installs the hosted server with this configuration; Kiro shows it for confirmation before writing anything:
{
"mcpServers": {
"valorbrain": {
"url": "https://mcpbrain.valor.digital/mcp",
"disabled": false,
"autoApprove": []
}
}
}
Kiro IDE and Kiro CLI sign in with OAuth on first use (dynamic client
registration and PKCE, no token to copy). Kiro Web and Kiro Mobile don't run
OAuth for servers you add yourself: there, add an Authorization: Bearer vbm_…
header to the same entry, or use the stdio proxy above.
.mcp.json
The .mcp.json at the root of this repo is the same hosted
server in the project format Claude Code reads ("type": "http" is Streamable
HTTP). It carries no token: the client signs in with OAuth on first use. Copy
it into your own project to share the server with everyone who opens it.
{
"mcpServers": {
"valorbrain": {
"type": "http",
"url": "https://mcpbrain.valor.digital/mcp"
}
}
}
Tools
The tools the hosted MCP server (https://mcpbrain.valor.digital/mcp)
exposes, with what each one is for.
New MCP tokens, the ones from init --agent and from OAuth sign-in, see the
agent toolset. Tokens created in the app can add the graph and ops
toolsets. Input schemas for every tool:
docs.valorbrain.com.br/mcp-schemas.md · full reference:
docs.valorbrain.com.br/en/docs/mcp/tools.
Agent toolset (default)
Recall:
| Tool | Use for |
|---|---|
memory_retrieve | One well-formed question. Server expands and fuses. REST twin: POST /search. |
memory_prepare | Assemble context for a task. REST twin: POST /api/v1/memory/prepare. |
working_context | Cheapest session start: stable facts + recent decisions. |
memory_recent | What an agent did lately: its decisions, milestones, handoffs and lessons, newest first. REST twin: GET /api/v1/memory/team-activity. |
memory_grep | Exact string, id, date, key. |
get / multi_get | Full body of a doc you already found. |
keyed_facts_as_of | Time-travel fact snapshots. |
mental_models (beta) | A standing answer to a recurring question, served by memory_prepare without an LLM call. Behind the mental_models flag, off by default. |
Write and correct:
| Tool | Use for |
|---|---|
memory_store | Typed durable outcome (decision, problem, lesson, …). |
memory_used | Declare docids you actually relied on. Optional verdict. |
upsert_keyed_fact | Write a dated fact snapshot. |
assert_authority_correction | Correct a wrong value so the next session sees the truth. |
authority_restore_demotion | Undo what an authority correction did to prose: restores confidence, un-hides docs, cancels pending work. The keyed fact stays. |
record_lesson | A takeaway that should change future behaviour. |
memory_curate | pin / snooze / unpin / unsnooze. |
memory_forget | Least reversible write — standalone on purpose. |
append_entity_card | KG write path agents actually use. |
entity_cards | List entity cards; propose, merge or reject an alias (the tenant decides). |
diary | Agent diary read/write. |
Working state and team:
| Tool | Use for |
|---|---|
task_state | Goal / progress ledger. |
commitments | Promises made to people outside the company: record by key, close with a reason, list open / due / overdue. REST twin: GET/POST /api/v1/commitments. |
team_briefing | Inbox, handoffs, mission. |
team_handoff | create / consume. |
team_inbox / team_message / team_notify_human / team_roster | Team OS (no-op if the tenant has no members). |
episodes | list / get episodic memories. |
notifications | check / mark_read. |
list_lessons | Lessons recorded for this tenant. |
Identity, access and support:
| Tool | Use for |
|---|---|
whoami | Confirm tenant / user / agent. HTTP-only. |
acl_me | Your effective access domains, the grant behind each one, and how many docs you cannot see. A missing domain is a permission, not a ranking miss. REST twin: GET /api/v1/acl/me. |
memory_health | Index and pipeline health. |
secrets | Vault: memory keeps only secret://<name>, the value comes out through get, which is audited. Needs the secrets:read / secrets:write scopes. |
feedback | Report a product defect to the ValorBrain team (submit returns an FB- id) and follow it up (check). |
Graph toolset
Knowledge graph, decisions, provenance, conflicts, timeline and similarity.
| Tool | Use for |
|---|---|
timeline | What was created or changed right before and after a document. |
find_similar | Documents closest in meaning to a given one, beyond keyword overlap. |
ripple_rag_retrieve (beta) | Entity context from the knowledge graph to ground an answer. |
decisions | Auditable decision records: record, relate, trace the causal chain, find precedents, list. |
kg_query | An entity's relationships in the knowledge graph, multi-hop, with the dates each one held. |
kg_explain | Why a knowledge-graph fact holds: the derivation behind it, or that none was recorded. |
kg_entity_resolve_report | Near-duplicate entities and how well entity resolution is scoring. |
kg_quarantine | Review queue of graph facts that failed validation: list, approve, reject. |
find_causal_links | Walk the chain of what led to a decision or an outcome. |
memory_evolution_status | How a memory's keywords and context changed as new evidence arrived. |
provenance | Where a fact came from and what depends on it; exports the audit trail as RDF or JSON-LD. |
conflicts | Detect, list and resolve contradictions across the workspace's memory. |
memory_arcs | Narrative threads that link episodes and goals: create, list. |
Also in this toolset, listed above: entity_cards.
Ops toolset
Curation, indexing, metering and access admin.
| Tool | Use for |
|---|---|
lifecycle_status | Active, archived, forgotten, pinned and snoozed counts, with pin and snooze candidates. |
lifecycle_restore | Restore documents a lifecycle policy archived (not ones forgotten on purpose). |
reindex | Refresh collections: re-embed stale documents and drop orphaned search entries. |
index_stats | Index statistics: content types, staleness, memory health. |
import_docs | Import documents from a JSON array, updating the ones with the same collection and path. |
export_docs | Export a collection as a JSON array, for backup or migration. |
build_graphs | Build the temporal and semantic graphs after indexing. |
operations | Status, list and cancel for long operations started with run_async. |
usage_report | Measured usage of the workspace: operations by channel, tool and agent, latency, daily series. |
harness_coverage | Which agents read memory but never deliver their sessions back. |
acl_grants | Access grants from a person, role or agent to a business domain, each with a reason and a validity. |
read_log | Read audit trail: who read which version of which document, through which agent, and when. |
Also in this toolset, listed above: feedback, secrets, mental_models.
Self-hosting
Point at your own deployment:
valorbrain --url https://your-engine.example.com init --agent
REST base default: https://valorbrain-api.valor.digital · MCP default:
https://mcpbrain.valor.digital/mcp
Support
- Email: valorbrain@valor.digital, replies within 24 hours on business days
- Contact page: https://valorbrain.com.br/en/contact
- Bugs and feature requests: GitHub issues
- Docs: https://docs.valorbrain.com.br
Privacy and terms
- Privacy policy: https://valorbrain.com.br/en/legal/privacy
- Terms of service: https://valorbrain.com.br/en/legal/terms
- What the hooks send from your machine: https://docs.valorbrain.com.br/docs/concepts/what-leaves-your-machine
License
MIT — see LICENSE.