ValorBrain

लोगों और AI एजेंटों की टीमों के लिए साझा मेमोरी: निर्णय, नियम और हैंडऑफ़ स्रोत, संस्करण और अनुमतियों के साथ सुरक्षित रखे जाते हैं और MCP (84 tools) के माध्यम से उपलब्ध कराए जाते हैं।

दस्तावेज़

@valorbrain/cli

Agent-native memory for AI agents and the humans who work with them. Zero dependencies, Node >= 18.

Add to Kiro

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:

CredentialPrefixWorks 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

CommandWhat 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)
listLists collections
statusLocal config + remote health
mcp [--token vbm_…]Bridges stdio MCP clients to the hosted MCP server (uses the saved mcp_token)
help --jsonThe 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-caller is 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 init output 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:

ToolUse for
memory_retrieveOne well-formed question. Server expands and fuses. REST twin: POST /search.
memory_prepareAssemble context for a task. REST twin: POST /api/v1/memory/prepare.
working_contextCheapest session start: stable facts + recent decisions.
memory_recentWhat an agent did lately: its decisions, milestones, handoffs and lessons, newest first. REST twin: GET /api/v1/memory/team-activity.
memory_grepExact string, id, date, key.
get / multi_getFull body of a doc you already found.
keyed_facts_as_ofTime-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:

ToolUse for
memory_storeTyped durable outcome (decision, problem, lesson, …).
memory_usedDeclare docids you actually relied on. Optional verdict.
upsert_keyed_factWrite a dated fact snapshot.
assert_authority_correctionCorrect a wrong value so the next session sees the truth.
authority_restore_demotionUndo what an authority correction did to prose: restores confidence, un-hides docs, cancels pending work. The keyed fact stays.
record_lessonA takeaway that should change future behaviour.
memory_curatepin / snooze / unpin / unsnooze.
memory_forgetLeast reversible write — standalone on purpose.
append_entity_cardKG write path agents actually use.
entity_cardsList entity cards; propose, merge or reject an alias (the tenant decides).
diaryAgent diary read/write.

Working state and team:

ToolUse for
task_stateGoal / progress ledger.
commitmentsPromises 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_briefingInbox, handoffs, mission.
team_handoffcreate / consume.
team_inbox / team_message / team_notify_human / team_rosterTeam OS (no-op if the tenant has no members).
episodeslist / get episodic memories.
notificationscheck / mark_read.
list_lessonsLessons recorded for this tenant.

Identity, access and support:

ToolUse for
whoamiConfirm tenant / user / agent. HTTP-only.
acl_meYour 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_healthIndex and pipeline health.
secretsVault: memory keeps only secret://<name>, the value comes out through get, which is audited. Needs the secrets:read / secrets:write scopes.
feedbackReport 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.

ToolUse for
timelineWhat was created or changed right before and after a document.
find_similarDocuments closest in meaning to a given one, beyond keyword overlap.
ripple_rag_retrieve (beta)Entity context from the knowledge graph to ground an answer.
decisionsAuditable decision records: record, relate, trace the causal chain, find precedents, list.
kg_queryAn entity's relationships in the knowledge graph, multi-hop, with the dates each one held.
kg_explainWhy a knowledge-graph fact holds: the derivation behind it, or that none was recorded.
kg_entity_resolve_reportNear-duplicate entities and how well entity resolution is scoring.
kg_quarantineReview queue of graph facts that failed validation: list, approve, reject.
find_causal_linksWalk the chain of what led to a decision or an outcome.
memory_evolution_statusHow a memory's keywords and context changed as new evidence arrived.
provenanceWhere a fact came from and what depends on it; exports the audit trail as RDF or JSON-LD.
conflictsDetect, list and resolve contradictions across the workspace's memory.
memory_arcsNarrative threads that link episodes and goals: create, list.

Also in this toolset, listed above: entity_cards.

Ops toolset

Curation, indexing, metering and access admin.

ToolUse for
lifecycle_statusActive, archived, forgotten, pinned and snoozed counts, with pin and snooze candidates.
lifecycle_restoreRestore documents a lifecycle policy archived (not ones forgotten on purpose).
reindexRefresh collections: re-embed stale documents and drop orphaned search entries.
index_statsIndex statistics: content types, staleness, memory health.
import_docsImport documents from a JSON array, updating the ones with the same collection and path.
export_docsExport a collection as a JSON array, for backup or migration.
build_graphsBuild the temporal and semantic graphs after indexing.
operationsStatus, list and cancel for long operations started with run_async.
usage_reportMeasured usage of the workspace: operations by channel, tool and agent, latency, daily series.
harness_coverageWhich agents read memory but never deliver their sessions back.
acl_grantsAccess grants from a person, role or agent to a business domain, each with a reason and a validity.
read_logRead 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

Privacy and terms

License

MIT — see LICENSE.