CLI demo

Two-terminal multi-agent walkthrough with the vault-shared.db demo.

The monorepo includes a hands-on CLI demo in apps/cli-agent. Two independent agent processes share one SQLite file — each with its own FAISS index but the same claim rows.

Setup

git clone https://github.com/theMillenniumFalcon/vault.git
cd vault/apps/cli-agent
bun install
cp .env.example .env
# Set OPENAI_API_KEY in .env

For a clean run, delete any existing database:

rm vault-shared.db   # Windows: Remove-Item vault-shared.db

Run

Terminal 1 — scheduling agent (agent-a):

bun run start:agent-a

Terminal 2 — chat agent (agent-b):

bun run start:agent-b

Both default to vault-shared.db. Override with VAULT_DB_PATH.

Commands

CommandAction
<message>Extract facts and store
/search <query>Cross-agent semantic search
/claimsList all claim rows
/disputesList disputes, open and closed
/resolveReview open disputes and pick a winner
/quitExit

Try the timezone conflict

Terminal 1:

You: I'm in PST

Terminal 2:

You: I'm in EST

Expected in terminal 2: stored claim with status [disputed], then a review prompt:

user.timezone conflict
  1. agent-a (in use): "The user is in PST"
  2. agent-b (saved, not used): "The user is in EST"
Pick 1 or 2, or press Enter to leave it open:
  • 1 keeps PST in search and files EST as old.
  • 2 switches search to EST and files PST as old.
  • Enter leaves the dispute open. Search still returns PST.

Either terminal can review open disputes later:

You: /resolve

Until someone picks a winner, both terminals:

You: /search what timezone is the user in?

Expected: top result from agent-a, text contains PST.

You: /disputes

Expected: one dispute on user.timezone, strategy authority. It stays open until /resolve or the prompt above closes it.

Why agent-a wins

From EXAMPLE_AUTHORITY_SEED:

Entityagent-a weightagent-b weight
user.timezone0.90.2
user.mood0.30.8

agent-b cannot beat agent-a on timezone → DISPUTE instead of overwrite.

Recency fallback demo

Entities without authority config (e.g. user.diet) use recency when the model labels the older claim contradicts. Compatible facts, such as "vegetarian" and "likes Italian food," both stay active. A contradiction has no dispute row: the newest claim wins.

Terminal 1: I love Italian food

Terminal 2: I hate Italian food, I only eat Japanese

→ agent-b's claim is active, agent-a superseded, /disputes empty.

What the demo wires up

PieceRole
bootstrapSharedStore(db)Seeds EXAMPLE_AUTHORITY_SEED once
createAgentMemory(agentId, db)One Memory + FAISS per process
syncVectorIndex()Rebuilds FAISS from DB before each op
searchSharedStore()Cross-agent search (no sourceAgent filter)

Authority defaults:

{
  "user.timezone": "authority",
  "user.mood": "authority",
}

Generic entry point

AGENT_ID=agent-b VAULT_DB_PATH=./vault-shared.db bun run start