Tools that come apart.
On purpose.

Foundry builds local, open-source tools for working with agents, creating things, and understanding code.

Explore the tools
Marbles@foundry/workflows@foundry/agents@foundry/models@foundry/workspaces@foundry/artifacts@foundry/sandbox

Tools

Marbles

Agentic infrastructure, unpacked.

Write workflows in TypeScript, give agents a workspace, and decide what happens next. This is a whole workflow file.

Make a workflow
.foundry/marbles/assess.ts
import { readFile } from "node:fs/promises";import { resolve } from "node:path";import { agent, artifact, monitor, step } from "@foundry.sh/marbles";import { z } from "zod"; // Another workflow collects reports and appends them to incidents.md.// This one watches that file and decides what happens next. const triage = agent({  provider: "codex",  prompt: `Is the last entry in this file an incident?    Reply with JSON only: {"isIncident": boolean, "reason": string}`,}); const verdict = z.object({ isIncident: z.boolean(), reason: z.string() });const brief = artifact({ name: "investigation-brief", type: "text/markdown" }); const assess = step("assess")  .input(z.object({ entry: z.string() }))  .do(async ({ input: { entry }, agents, report, log }) => {    const session = await agents.session(triage);    const reply = await session.generate(entry);    const { isIncident, reason } = verdict.parse(JSON.parse(reply.text));     if (!isIncident) {      log(`Not an incident: ${reason}`);      return { isIncident };    }     const draft = await session.generate("Write an investigation brief.");    await report.artifact(brief, { "brief.md": draft.text });    return { isIncident };  }); monitor("incidents.md")  .every("1m")  .do(async ({ files, workspaces }) => {    if (!files?.modified.length) return;    const path = resolve(workspaces.current.root, "incidents.md");    return assess({}, { entry: await readFile(path, "utf8") });  });
  1. One workflow leaves a note.

    Another workflow appends reports to incidents.md.

  2. An agent makes the judgment.

    Codex reads the entry and answers in JSON. The step validates the answer before trusting it.

  3. Your code makes the decision.

    An ordinary if finishes the run or writes an investigation brief.

  4. A monitor starts it.

    Marbles polls incidents.md and starts assess when it changes.

Spyglass

Get the lay of your code.

Explore your codebase as a landscape of files, packages, and dependencies. See what belongs together, where dependencies circle back, and which abstractions deserve a closer look.

Explore your codebase
packagesfilesFind your bearings.

Works Coming soon

Make something. Make the tool fit.

Create documents, images, videos, and apps with tools you can change. Each editor is a module: a small app you can customize, build yourself, or share.

Found a bug in your word processor? Fix it without applying for a job there first.

For example, add a citation checker to your document editor, then use it to review your next draft. The editor is the module. The document is the artifact.

Parts

And the parts to build your own.

Marbles and Works are assembled from these libraries. Every one lives in the same repository, and you can read it.

PackageWhat it isUsed by
@foundry/workflowsSteps, workflows, runs, and queues.Marbles
@foundry/agentsAgent sessions, tools, and authorization.Marbles
@foundry/modelsOne registry for providers, CLI harnesses, and local models.Marbles
@foundry/workspacesA durable catalog over your files.Marbles
@foundry/artifactsVersioned outputs with a stable identity.Marbles, Works
@foundry/sandboxA portable filesystem and command runner.Marbles, Works

Nothing leaves your machine unless you say so.

Every Foundry tool runs on your machine and keeps its state on disk.

The source is open and MIT licensed, and the tools are built from libraries you can read in the same repository. When a tool doesn’t fit, you can see why, and you can change it.

Read the source

Pick a tool.
Take it apart.

Marbles and Spyglass run from a checkout of the repository today. The docs cover both.

Read the docs