Integration Patterns
Multiple Agents in One Repo
Use multiple agentIds to isolate different SDK Agents in the same project directory
Multiple Agents in One Repo
If you create several local SDK Agents inside the same project directory, the most important rule is:
- give each agent a stable and different
id
For example:
new Agent({
id: "planner",
workspace: new Workspace({ path: repo_path }),
});
new Agent({
id: "reviewer",
workspace: new Workspace({ path: repo_path }),
});Each Agent requires a separate Workspace instance. Both Workspaces may target the same physical directory; Store partitions Sessions by agent_id. If both Agents need command capabilities, create and pass a separate Shell instance to each Workspace as well.
This is especially useful when one repository needs several agents with different roles.