v0.0.2-alpha.2 is now available

The TypeScript Framework
for AI Applications

Build production-grade AI apps with a complete toolkit: Runtime Engine, Agent Patterns, Server-Driven UI, and full React integration.

Core
Runtime
Agents
Client
React

Modular Architecture

Melony is organized as a monorepo with focused packages that work together seamlessly.

@melony/core

Core types, utilities, event definitions, and protocol specifications.

npm install @melony/core

@melony/runtime

Action execution engine, async generators, and approval flow management.

npm install @melony/runtime

@melony/agents

High-level agent abstractions, brain patterns, and HTTP handlers.

npm install @melony/agents

@melony/client

Framework-agnostic client for connecting to Melony runtimes.

npm install @melony/client

@melony/react

React components, hooks, and Server-Driven UI renderer.

npm install @melony/react

Everything You Need

A complete toolkit for building the next generation of AI applications.

Runtime Engine

Execute actions as async generators with automatic chaining.

Agent Pattern

High-level agent abstraction with brain pattern and HTTP handlers.

Server-Driven UI

Render UI components directly from server events.

Type Safe

Full TypeScript support with Zod validation for all actions.

Framework Agnostic

Core packages work with any JavaScript framework.

Human-in-the-Loop

Built-in approval flows for actions requiring confirmation.

React Integration

Ready-to-use React components and hooks.

Quick Start

1Install Packages

npm install @melony/react @melony/runtime @melony/agents @melony/client

2Define Actions

// lib/actions.ts
import { defineAction } from "@melony/runtime";
import z from "zod";

export const getWeather = defineAction({
  name: "getWeather",
  paramsSchema: z.object({ city: z.string() }),
  execute: async function* (params) {
    const weather = await fetch(`/api/weather?city=${params.city}`);
    const data = await weather.json();
    yield {
      type: "text",
      data: { content: `Weather in ${params.city}: ${data.temp}°F` },
    };
  },
});

3Create Agent

// app/api/chat/route.ts
import { defineAgent, createAgentHandler } from "@melony/agents";
import { getWeather } from "@/lib/actions";
import { agentBrain } from "@/lib/agent-brain";

const agent = defineAgent({
  name: "Assistant",
  actions: { getWeather },
  brain: agentBrain,
});

export const POST = createAgentHandler(agent);

4Use in React

// app/page.tsx
"use client";
import { MelonyStoreProvider, Chat } from "@melony/react";

export default function Home() {
  return (
    <MelonyStoreProvider api="/api/chat">
      <Chat />
    </MelonyStoreProvider>
  );
}

Ready to build intelligent apps?

Join the community of developers building the next generation of AI applications with Melony.