Multi-Agent
Branch + Lock
Vant uses branches for agent isolation and locks for coordination.
Workflow
- Acquire lock - Prevent conflicts
- Create/switch branch - Work in isolation
- Do work - Modify brain files
- Commit changes - Save to branch
- Release lock - Allow others
Branch Per Agent
Isolate agent work with branches.
git checkout -b agent-1
# work...
git add -A
git commit -m "Agent 1: Updated memory"
Lock API
Use the lock module to prevent conflicts:
const lock = await lock.acquire(agentId);
if (!lock) {
console.log('Brain locked');
return;
}
// work...
await lock.release(agentId, token);
Merging
Merge changes via PR for human review:
# Create PR on GitHub
# Human reviews
# Merge to main
Best Practices
- Use locks - Even solo agents prevent race conditions
- Branch per agent -
agent-1,agent-2 - Commit small - Easy to review
- Merge via PR - Human review first
- Set timeouts - Lock expires after 1 hour
See also: Architecture, Schema