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 .envFor a clean run, delete any existing database:
rm vault-shared.db # Windows: Remove-Item vault-shared.dbRun
Terminal 1 — scheduling agent (agent-a):
bun run start:agent-aTerminal 2 — chat agent (agent-b):
bun run start:agent-bBoth default to vault-shared.db. Override with VAULT_DB_PATH.
Commands
| Command | Action |
|---|---|
<message> | Extract facts and store |
/search <query> | Cross-agent semantic search |
/claims | List all claim rows |
/disputes | List disputes, open and closed |
/resolve | Review open disputes and pick a winner |
/quit | Exit |
Try the timezone conflict
Terminal 1:
You: I'm in PSTTerminal 2:
You: I'm in ESTExpected 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:1keeps PST in search and files EST as old.2switches 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: /resolveUntil someone picks a winner, both terminals:
You: /search what timezone is the user in?Expected: top result from agent-a, text contains PST.
You: /disputesExpected: 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:
| Entity | agent-a weight | agent-b weight |
|---|---|---|
user.timezone | 0.9 | 0.2 |
user.mood | 0.3 | 0.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
| Piece | Role |
|---|---|
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