Quickstart

Turn your Microsoft Agent Framework agent into an agent-native application in 10 minutes.

Start with your coding agent#

Use this prompt to connect your Microsoft Agent Framework agent to CopilotKit and verify a working conversation. Your coding agent will follow this guide in your project, or you can work through the manual steps below.

Prerequisites#

Before you begin, you'll need the following:

  • An OpenAI API key for the .NET starter
  • .NET 9.0 SDK or later
  • Node.js 20+
  • Your favorite package manager (npm, pnpm, yarn, or bun)

Getting started#

Set up CopilotKit Intelligence#

Sign in to managed Intelligence. Managed setup uses a server-side project API key and does not issue COPILOTKIT_LICENSE_TOKEN. You will connect the app after you create it below.

Choose your starting point#

You can either start fresh with our starter template or integrate CopilotKit into your existing Microsoft Agent Framework agent.

🎉 Start chatting!#

Your AI agent is now ready to use! Try asking it some questions:

Can you tell me a joke?
Can you help me understand AI?
What do you think about .NET?
Troubleshooting

Agent Connection Issues

  • If you see "I'm having trouble connecting to my tools", make sure:
    • The C# agent is running on port 8000
    • Your OpenAI API key is set via .NET user secrets
    • Both servers started successfully (check terminal output)

OpenAI API Key Issues

  • If the agent fails with "OPENAI_API_KEY not found":
    cd agent
    dotnet user-secrets set OPENAI_API_KEY "<your-openai-api-key>"

.NET SDK Issues

  • Verify .NET SDK is installed:
    dotnet --version  # Should be 9.0.x or higher
  • Restore packages manually if needed:
    cd agent
    dotnet restore
    dotnet run

Port Conflicts

  • If port 8000 is already in use, you can change it in:
    • agent/Properties/launchSettings.json - Update applicationUrl
    • src/app/api/copilotkit/route.ts - Update the remote endpoint URL

Open Inspector and confirm setup#

On localhost, click the Inspector button in the corner of the app.

  1. Open Agents, then Agent. Your agent is listed.
  2. Send a chat message. Open Agents, then AG-UI Events. Events are moving.
  3. Open Threads. The list is unlocked (Intelligence is on), or locked with Enable Intelligence (Intelligence is off).

More detail: Inspector.

What's next?#

Now that you have your basic agent setup, explore these advanced features: