Skip to main content
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 or circuit.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 beside agents/ and packages/.

Python (uv workspace)

1. Declare the workspace at the repo root. A virtual root (no [project]) is enough:
2. Make the shared code a package that owns its dependencies. Group shared packages under a namespace of your choosing (here, 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.)
3. Depend on it from the agent via a workspace source:
4. Import it by name - no sys.path manipulation:
Run uv lock once at the root and commit the uv.lock.

TypeScript (Bun workspace)

1. Declare the workspace at the repo root:
2. Make the shared code a package that owns its dependencies:
3. Depend on it from the agent:
4. Import it by name - no tsconfig path aliases:
Run 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 shared agents/* glob can’t hold both flavors. Give each language its own workspace root:
Upload each agent from its own directory as usual - the CLI walks up to the correct 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