FragolaFragolaAI Agentic SDK

Get Started

Start building with Fragola in minutes

Installation

Fragola requires Node.js 18+.

npm install @fragola-ai/agentic-sdk-core
bun add @fragola-ai/agentic-sdk-core
pnpm add @fragola-ai/agentic-sdk-core
yarn add @fragola-ai/agentic-sdk-core

Quickstart

Create a simple agent that responds to user messages.

Initialize the Client

First, import Fragola and create a client instance. You'll need an OpenAI API key.

import { Fragola } from "@fragola-ai/agentic-sdk-core";

const fragola = new Fragola({
  apiKey: process.env.OPENAI_API_KEY, // Ensure this is set in your environment
  model: "gpt-4o-mini"
});

Create an Agent

Define your agent with a name, description, and instructions.

const agent = fragola.agent({
  name: "QuickstartAgent",
  description: "My first Fragola agent",
  instructions: "You are a helpful and concise assistant."
});

Send a Message

Send a message to the agent and await the response. The state contains the updated conversation history.

const state = await agent.userMessage({
  content: "Hello! What can you do?"
});

// The state.messages array contains the full conversation history
// using native OpenAI types: OpenAI.ChatCompletionMessageParam[]
console.log(state.messages);

Next Steps

Now that you have a basic agent running, dive deeper into Fragola's features:

  • Core Concepts: Learn about Agents, Tools, and Events.
  • Guides: detailed walkthroughs for specific tasks.