Brought to your by Mark.

LlamaIndex is a simple, flexible framework for building agentic generative AI applications that allow large language models to work with your data in any format.

Installation

npm i llamaindex

Example

import { agent, multiAgent } from "llamaindex";
import { openai } from "@llamaindex/openai";

const analyseAgent = agent({
  name: "AnalyseAgent",
  llm: openai({ model: "gpt-4o" }),
  tools: [analyseTools],
});
const reporterAgent = agent({
  name: "ReporterAgent",
  llm: openai({ model: "gpt-4o" }),
  tools: [reporterTools],
  canHandoffTo: [analyseAgent],
});

const agents = multiAgent({
  agents: [analyseAgent, reporterAgent],
  rootAgent: reporterAgent,
});

const response = await agents.run(`Analyse the given data:
${data}`);