A2UI Launched: Full CopilotKit support at launch!

A2UI Launched: CopilotKit has partnered with Google to deliver full support in both CopilotKit and AG-UI!

Check it out
LogoLogo
  • Overview
  • Integrations
  • API Reference
  • Copilot Cloud
Slanted end borderSlanted end border
Slanted start borderSlanted start border
Select integration...

Please select an integration to view the sidebar content.

Connecting Your Data

Backend Data

Learn how to connect your data to CopilotKit.

Backend Readable State

CopilotKit allows you to define actions on the backend that can be called by your Copilot. Behind the scenes, this is securely binding the action as a tool to your LLM of choice.

When you ask the LLM to retrieve the data, it will do so by securely calling the backend action.

For more information about backend actions, see the Backend Action guides.

/api/copilotkit/route.ts
const runtime = new CopilotRuntime({
  actions: ({properties, url}) => {
    // You can use the input parameters to the actions generator to expose different backend actions to the Copilot at different times: 
    // `url` is the current URL on the frontend application.
    // `properties` contains custom properties you can pass from the frontend application.
    
    return [
      {
        name: "fetchNameForUserId",
        description: "Fetches user name from the database for a given ID.",
        parameters: [
          {
            name: "userId",
            type: "string",
            description: "The ID of the user to fetch data for.",
            required: true,
          },
        ],
        handler: async ({userId}: {userId: string}) => {
          // do something with the userId
          // return the user data
          const simulateDatabaseCall = async (userId: string) => { return { name: "Darth Doe" } }
          return await simulateDatabaseCall(userId)
        },
      },
    ]
  }
});

Knowledge Bases (Enterprise)

Additional plug-and-play integrations with knowledge bases are available via our enterprise plan.

Please reach out to enable it.

PREV
Frontend Data
Slanted end borderSlanted end border
Slanted start borderSlanted start border
NEXT
Authenticated Actions

On this page

Backend Readable State
Knowledge Bases (Enterprise)