Tulip Logo IconTulip
Getting Started

Getting Started

Install the AI package and wire the smallest useful agent-backed chat flow.

This section covers the minimum moving parts for using @tulip-systems/ai in an app.

At a high level, an integration has four layers:

  1. the tool base, tools and agents, defined in code on the server
  2. the services you need, each with its own tables: Agents runs agents and checks every tool call, Chat saves chats, Mcp serves the tools to MCP apps
  3. server procedures that start agents: a chat, a button, an event listener or a cron route
  4. client UI: the chat components, and tool renderers for custom cards

Prerequisites

  • React 19
  • AI SDK 7
  • a model provider such as OpenRouter, OpenAI, Anthropic, or Google
  • a server boundary for agent definitions and tool execution

Mental model

The package intentionally separates server and client concerns:

  • tools/server creates the tool base (toolBuilder) that canonical tools are defined with
  • agents/server defines agents (defineAgent) and runs them (Agents): runs, approvals and agent states
  • chat/server saves chats and streams the agent's response (Chat)
  • mcp/server serves the tools to MCP apps (Mcp)
  • chat/client renders composable chat UI, with a renderer for tools that need their own card
  • context/client tells the agent which page the user is on
  • types has the types server and client share

On this page