Building a single agent? Skip this - a standalone project (what
circuit new creates) is all you need. This page is for running multiple agents from one repository and sharing code between them.Two repository structures
The CLI supports two shapes, and detects which one you’re in automatically - there is no mode flag orcircuit.toml setting to choose.
In a workspace, shared code lives in real packages that each own their dependencies, and an agent depends on them by name - the same pattern any uv/Bun monorepo uses. No import-path hacks, no per-agent dependency duplication. When you upload, the CLI installs the depended-on packages into the agent’s deploy bundle; the running agent is shaped exactly like a standalone one.
Layout
A single-language monorepo: a workspace root manifest besideagents/ and packages/.
Python (uv workspace)
1. Declare the workspace at the repo root. A virtual root (no[project]) is enough:
lib) so they read as lib.<pkg>:
name is the distribution name (the key the agent depends on and that
[tool.uv.sources] resolves), not the import path. Give shared packages a
prefix like lib-: the workspace resolves to a single version and a workspace
package wins over the registry, so a bare name = "hyperliquid" would shadow the
PyPI package of that name and no member could install the real one. The prefix
keeps shared code in a private namespace that can’t collide with a registry
dependency. (The import path lib.hyperliquid comes from only-include, not
from name.)sys.path manipulation:
uv lock once at the root and commit the uv.lock.
TypeScript (Bun workspace)
1. Declare the workspace at the repo root:tsconfig path aliases:
bun install once at the root and commit the bun.lock.
Mixing Python and TypeScript in one repo
uv requires every member-glob match to be a Python package, so a sharedagents/* glob can’t hold both flavors. Give each language its own workspace root:
Forking a workspace agent
Forking (or editing) a published workspace agent copies its stored source into the builder exactly as uploaded: the workspace root config and lockfile, the agent in its own directory, and the shared packages it depends on beside it. Nothing is rewritten -bun / uv link the packages in the
builder the same way they do in your monorepo, and the lockfile carries over,
so the fork runs the same dependency versions the original published with.
The fork is still a snapshot: it starts as a copy of your code, not a live
link to your monorepo.
Next steps
- Execution Model - how sessions and the run loop work
circuit.tomlreference