Skip to content

Repository files navigation

Commissary

Commissary is a durable, provider-neutral agent runtime for TypeScript. It separates durable Run admission from process-bound execution and keeps Models, Tools, Hooks, and storage behind typed interfaces.

Commissary is in 0.x. Public APIs can change between minor releases.

Packages

PackagePurpose
@commissary/coreProvider-neutral Agent, Model, Tool, Hook, and Runtime APIs
@commissary/storeTyped persistence, SQL Record, and SQL Store contracts
@commissary/store-memoryProcess-local Thread Store for tests and local development
@commissary/drizzleConnection-free PostgreSQL, MySQL, and SQLite definitions
@commissary/effectEffect client adapters and the Effect AI bridge
@commissary/streamJavaScript and Effect execution stream adapters

Supported runtimes

  • Node.js 22.14 or later
  • The current stable Bun
  • The current stable Deno
  • Modern browsers
  • Cloudflare Workers

Repository development requires Node.js 22.14 or later and pnpm 11.16.

Quick start

Install the core runtime and the development Thread Store:

pnpm add @commissary/core @commissary/store-memory

Create and execute one Agent Run:

import{Agent,Content,Model,commissary}from"@commissary/core";import{MemoryThreadStore}from"@commissary/store-memory";constmodel=Model.define({id: "example-model",async*invoke(){yield{type: "finish",response: {message: {role: "assistant",content: [Content.text("Hello")]},finishReason: "stop",},};},});constagent=Agent.define({id: "example-agent",fragments: model});constapp=commissary({threadStore: MemoryThreadStore.make()});constthread=awaitapp.createThread();constbranch=awaitapp.createBranch({threadId: thread.id,name: "main"});constclient=app.agent(agent);constcreated=awaitclient.createRun({threadId: thread.id,branchId: branch.id,message: {role: "user",content: [Content.text("Start")]},});if(created.type==="accepted"){constexecution=awaitclient.execute(created.runId);console.log(awaitexecution.result);}

MemoryThreadStore is not durable. Production hosts must provide a durable Thread Store adapter.

Development

pnpm run bootstrap
pnpm run verify
pnpm run build
pnpm run check:imports
pnpm run smoke

Package changes must include a Changeset:

pnpm changeset

See CONTRIBUTING.md for the full contribution process.

Maintainers can use the release setup and bootstrap guide for the first npm publication and remote repository settings.

Policies

About

Composable Agent Builder

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages