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:
- the tool base, tools and agents, defined in code on the server
- the services you need, each with its own tables:
Agentsruns agents and checks every tool call,Chatsaves chats,Mcpserves the tools to MCP apps - server procedures that start agents: a chat, a button, an event listener or a cron route
- client UI: the chat components, and tool renderers for custom cards
Recommended path
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/servercreates the tool base (toolBuilder) that canonical tools are defined withagents/serverdefines agents (defineAgent) and runs them (Agents): runs, approvals and agent stateschat/serversaves chats and streams the agent's response (Chat)mcp/serverserves the tools to MCP apps (Mcp)chat/clientrenders composable chat UI, with a renderer for tools that need their own cardcontext/clienttells the agent which page the user is ontypeshas the types server and client share