openagentry

01 Volume i · Open source

Swap
providers
not code.

OpenAgentry is the plumbing for AI agents that aren't welded to one vendor. Change the language model, the database, the host, or the email service later — without rewriting the app on top. Thirteen open-source adapters today.

npm install @openagentry/cli What is this?
  • host
  • db
  • auth
  • llm
  • wiki
  • repo
  • storage
  • email
  • domain

02 Plain language

Most AI agents are
welded to one vendor.
This unwelds them.

Imagine your team's chatbot uses Claude. Tomorrow you want to try Gemini — for cost, for privacy, for a feature one provider has and the other doesn't. Right now, that means a developer rewrites the parts of the app that talk to the AI.

OpenAgentry separates what the app asks for from who answers. The app asks for "the LLM." The framework hands it whichever one you've configured. Swap providers without breaking anything that depends on them.

Same idea for the rest of the stack — database, file storage, email, hosting. Each is a category with several interchangeable providers behind it. Lock-in becomes a config decision, not a commitment baked into your code.

For developers

Each category is a small TypeScript interface in @openagentry/core. Each provider is an npm package whose default export satisfies it. See the contract →

For everyone else

The take-away: agents built on OpenAgentry can change AI providers, databases, or hosts after they ship — without a rewrite. That changes what kind of provider lock-in your team accepts up front.


03 The shape, in code

A category is a contract.
An adapter is an answer.

Contract · @openagentry/core

Each category is a small TypeScript interface. Methods are total — every failure throws a structured AgentryError with a stable code, a phase, and a suggested fix.

// @openagentry/core
export interface DatabaseAdapter {
  readonly category: 'db';
  readonly id: string;
  createInstance(opts): Promise<DatabaseInstance>;
  destroyInstance(i, confirm): Promise<void>;
  connectionString(i, env): Promise<string>;
  exportState(i): Promise<DatabaseStateBundle>;
  importState(b): Promise<DatabaseInstance>;
}

Answer · @openagentry/adapter-db-neon

An adapter is an npm package whose default export satisfies the contract. The CLI loads it via the package's manifest block and registers it. Swap providers without touching call sites.

// @openagentry/adapter-db-neon
import db from '@openagentry/adapter-db-neon';

await db.createInstance({
  name: 'app-prod',
  region: 'aws-us-east-1',
  engine: 'postgres',
});
// → Neon project, ready to receive branches

04 The catalog

All 9 categories.
All 13 concrete adapters. Today.

  1. H

    host

    2 adapters

    Application hosting. Deploy, rollback, env, domain attach.

  2. D

    db

    1 adapter

    Managed databases. Per-environment branching where supported.

  3. A

    auth

    1 adapter

    User authentication & session management.

  4. L

    llm

    3 adapters

    Language model providers. Generate, stream, list models.

  5. W

    wiki

    1 adapter

    Knowledge stores. Markdown pages with frontmatter.

  6. R

    repo

    1 adapter

    Source-control registrars. Create, delete, get repository.

  7. S

    storage

    2 adapters

    Object storage. Public + private buckets.

  8. E

    email

    1 adapter

    Transactional email transports.

  9. domain

    1 adapter

    Domain registration & DNS records.

  1. Reserved · No contract drafted yet:
  2. kv

  3. cron

  4. billing

  5. push

05 Failure modes

Every failure is structured.

When an agent recovers from its own mistakes, the error is the API. Every adapter throws an AgentryError with a stable code, a phase, a one-line suggested fix, and a docs URL — including the page you're on right now.

throw new AgentryError({
  code: 'E_NEON_AUTH',
  phase: 'init',
  message: 'Missing required env vars: NEON_API_KEY',
  context: { missing: ['NEON_API_KEY'] },
  suggestedFix:
    'Set NEON_API_KEY before using the default adapter, ' +
    'or call createNeonDatabaseAdapter({apiKey}) directly.',
  docs: 'https://openagentry.dev/errors/E_NEON_AUTH',
});
  1. i

    Codes are stable. Pattern E_<ADAPTER>_<KIND> — never renamed across minor versions.

  2. ii

    Suggested fixes are concrete. An LLM should be able to recover without asking.

  3. iii

    Context never leaks secrets. Missing vars are listed by name, never value.

  4. iv

    Every code resolves to a docs page. Browse the catalog.


06 Operating manual

Three commands.

  1. 01

    Install the CLI & the adapters you want.

    npm i @openagentry/cli @openagentry/adapter-llm-cli @openagentry/adapter-wiki-fs
  2. 02

    Initialise a workspace.

    npx agentry init @openagentry/adapter-llm-cli @openagentry/adapter-wiki-fs

    Creates .agentry/workspace.json. Pass --force to overwrite.

  3. 03

    Confirm what loaded.

    npx agentry capabilities
    Registered capabilities:
      llm:  llm-cli  (@openagentry/adapter-llm-cli)
      wiki: wiki-fs (@openagentry/adapter-wiki-fs)
    
    Reserved categories: kv, cron, billing, push.

From there, import { useAdapter } from '@openagentry/core' in any file. Walkthrough →