dev-tools 5 min read

RunMesh – OpenAI-First TypeScript Framework for AI Agents

RunMesh is a batteries-included TypeScript framework for building production AI agents with multi-provider support, streaming, memory, and observability baked in.

By
Share: X in
RunMesh framework product thumbnail

TL;DR

TL;DR: RunMesh is a TypeScript-first AI agent framework with first-class support for OpenAI, Anthropic, and 200+ OpenRouter models, offering tools, streaming, memory, and observability in a single coherent package.

Source and Accuracy Notes

⚠️ This section is MANDATORY. All links must be verified from actual source, not guessed.

What Is RunMesh?

Building AI agents in TypeScript today means stitching together multiple libraries, wrangling inconsistent provider SDKs, and writing significant boilerplate for every project. RunMesh positions itself as “the Angular of Gen AI Applications” — a batteries-included framework that standardizes the agent-building experience.

The README puts it directly:

RunMesh is the first comprehensive, batteries-included framework for building Gen AI applications.

Core Packages

The framework is split into three focused packages:

  • @runmesh/agent — core agent abstraction with tool calling, streaming, and memory
  • @runmesh/core — provider configuration for OpenRouter, OpenAI, and Anthropic
  • @runmesh/toolsToolRegistry with Zod schema validation for registered tools

Setup Workflow

Prerequisites

  • Node.js 18 or later
  • An API key from OpenAI, Anthropic, or OpenRouter (OpenRouter recommended for model flexibility)

Step 1: Install

npm install @runmesh/agent @runmesh/core @runmesh/tools zod

Or with pnpm:

pnpm add @runmesh/agent @runmesh/core @runmesh/tools zod

Step 2: Configure a Provider

import { createOpenRouterConfig, createFromProvider } from "@runmesh/core";

// Use 200+ models via OpenRouter (Claude, GPT, Gemini, Llama, and more)
const client = createFromProvider(
  createOpenRouterConfig(
    process.env.OPENROUTER_API_KEY!,
    "claude-3.5-sonnet" // or "gpt-4o", "gemini-pro", etc.
  )
);

OpenRouter is the recommended provider because it gives access to models from multiple vendors through a single API key and consistent interface.

Step 3: Register a Tool

import { tool, ToolRegistry } from "@runmesh/tools";
import { z } from "zod";

const tools = new ToolRegistry();
tools.register(
  tool({
    name: "get_weather",
    description: "Get current weather for a city",
    schema: z.object({
      city: z.string().describe("City name")
    }),
    handler: async ({ city }) => {
      // Call your weather API here
      return { city, temp: 72, condition: "sunny" };
    }
  })
);

Step 4: Create and Run an Agent

import { createAgent } from "@runmesh/agent";

const agent = createAgent({
  client,
  tools,
});

const response = await agent.run("What is the weather in San Francisco?");
console.log(response);

Key Features

Multi-Provider Support

RunMesh is provider-agnostic at the core level. The createFromProvider pattern lets you swap OpenAI for Anthropic or OpenRouter without changing agent logic. OpenRouter specifically offers 200+ models including Claude 3.5 Sonnet, GPT-4o, Gemini Pro, and open-source models like Llama 3.

Streaming

Agents support streaming responses out of the box. This is critical for UX in chat interfaces where you want tokens to appear as they are generated rather than waiting for a complete response.

Structured Outputs with Zod

Every tool schema is validated with Zod. The schema field on a tool definition enforces input shapes at runtime, and Zod also powers structured outputs from language models when they return tool call arguments.

Framework Agnostic

The core packages work in any Node.js environment. Framework-specific integrations exist for React (hooks) and Vue (composables, upcoming), with the agent core itself staying runtime-agnostic. You can drop it into Next.js, Express, Hono, or Cloudflare Workers.

Observability

The framework includes built-in logging and error handling hooks. The README mentions observability as a first-class feature, making it easier to trace agent reasoning steps and debug unexpected behavior in production.

Practical Evaluation Checklist

  • [ ] Installed @runmesh/agent and confirmed no TypeScript errors
  • [ ] Configured OpenRouter with a valid API key
  • [ ] Registered a custom tool with a Zod schema
  • [ ] Ran an agent prompt end-to-end and received a response
  • [ ] Tested streaming mode if building a chat UI
  • [ ] Verified tool argument validation rejects malformed inputs

FAQ

Q: Does RunMesh support local models? A: Via OpenRouter, yes — models like Llama 3, Mistral, and Gemma are available through OpenRouter’s API. For fully air-gapped setups, direct Ollama integration is not yet documented but the provider abstraction makes it理论上 possible.

Q: How does it compare to Vercel AI SDK or LangChain.js? A: Vercel AI SDK focuses narrowly on streaming UI patterns in Next.js. LangChain.js is provider-agnostic but ships with significant boilerplate and a steeper learning curve. RunMesh positions itself between them — more structured than LangChain, more agent-centric than Vercel AI.

Q: What is the BSL 1.1 license? A: Business Source License 1.1 allows free use for development and production use, but becomes fully open-source (Permissive) after a period of years. This is not the same as MIT or Apache 2.0 — evaluate it against your commercial requirements before shipping.

Q: Is it production-ready? A: The README shows 27 passing tests in CI. As a young project (launched late 2025), the community and real-world production track record are still growing. Check the GitHub Issues and Discord for stability reports before betting on it for critical systems.

Conclusion

RunMesh is a coherent TypeScript framework that addresses the fragmented DX of building AI agents today. Its multi-provider core, Zod-validated tool system, and streaming support make it a practical choice for teams building agentic applications who want structure without the lock-in of a hosted platform.

If you want to explore an alternative to stitching LangChain + an API provider + custom streaming code, RunMesh is worth a weekend evaluation. Start with the quick-start on the project page and build one tool end-to-end before committing.