@melony/agents

Build intelligent agents with high-level abstractions.

Overview

The @melony/agents package provides the "Brain" pattern for defining agent behavior and includes standard HTTP handlers for easy integration with frameworks like Next.js.

npm install @melony/agents

Features

  • Agent Definition: Combine actions and a "brain" into a cohesive agent.
  • Brain Pattern: Pluggable logic for deciding which actions to take (e.g., using LLMs).
  • HTTP Handlers: createAgentHandler for automatic route handling.

Creating an Agent

import { defineAgent } from "@melony/agents";
import { myAction } from "./actions";
import { agentBrain } from "./brain";

export const agent = defineAgent({
  name: "MyAgent",
  actions: { myAction },
  brain: agentBrain,
});