Browse by type
AgentKit is a production-ready starter template for building AI agents with web search capabilities. It's designed to help developers quickly build AI chat applications with authentication, database persistence, and a beautiful UI—everything you need to launch fast.
git clone https://github.com/anayatkhan1/agentkit-starter.git
cd agentkit-starter
pnpm install
# or
npm install
# or
yarn install
Set up environment variables (see Environment Variables section below).
Set up the database:
# Generate Prisma client
pnpm prisma generate
# Run database migrations
pnpm prisma migrate dev
pnpm dev
# or
npm run dev
# or
yarn dev
Open http://localhost:3000 with your browser to see the result.
To run the project locally, you need to set up the following environment variables. Create a .env.local or .env file in the root directory of the project:
# Clerk Authentication
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key
CLERK_SECRET_KEY=your_clerk_secret_key
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up
NEXT_PUBLIC_CLERK_SIGN_IN_FORCE_REDIRECT_URL=/chat
NEXT_PUBLIC_CLERK_SIGN_UP_FORCE_REDIRECT_URL=/chat
# Database
DATABASE_URL=postgresql://user:password@localhost:5432/agentkit
# Anthropic AI
ANTHROPIC_API_KEY=your_anthropic_api_key
# Optional: choose a search provider (parallel or exa)
# Without this setting, an existing EXA_API_KEY selects Exa; otherwise Parallel is used.
# WEB_SEARCH_PROVIDER=parallel
# EXA_API_KEY=your_exa_api_key
# Optional: Production URL
NEXT_PUBLIC_APP_URL=http://localhost:3000
This project uses Prisma as the ORM with PostgreSQL. The database schema includes:
After setting up your DATABASE_URL, run:
# Generate Prisma client
pnpm prisma generate
# Create and apply migrations
pnpm prisma migrate dev
# (Optional) View your database in Prisma Studio
pnpm prisma studio
agentkit-starter/
├── src/
│ ├── agents/ # AI agent implementations
│ │ └── web-search-agent/ # Web search agent with tool integration
│ ├── app/ # Next.js app router
│ │ ├── api/ # API routes (chat, chats)
│ │ ├── chat/ # Chat pages
│ │ └── page.tsx # Landing page
│ ├── components/ # React components
│ │ ├── chat-ui/ # Chat interface components
│ │ ├── sections/ # Landing page sections
│ │ └── ui/ # shadcn/ui components
│ ├── lib/ # Utilities and configurations
│ │ ├── chat-store.ts # Chat persistence logic
│ │ ├── config.tsx # Site configuration
│ │ └── prisma.ts # Prisma client instance
│ └── tools/ # AI SDK tools
│ └── web-search/ # Web search toolset
├── prisma/ # Database schema and migrations
│ ├── schema.prisma # Prisma schema
│ └── migrations/ # Database migrations
└── public/ # Static assets
The chat interface includes a search toggle button. When enabled, the AI agent will use web search to find current information. When disabled, the agent responds using its training knowledge only.
Search uses Parallel Search MCP when no search provider or Exa key is configured. It connects to https://search.parallel.ai/mcp over Streamable HTTP and returns source URLs and excerpts to the agent and chat source cards. Anonymous search uses Fast mode and needs no Parallel account or API key. The free endpoint has usage limits and is intended for exploration and light use.
Existing installations with EXA_API_KEY continue to use Exa. Set WEB_SEARCH_PROVIDER=parallel to select Parallel explicitly, or WEB_SEARCH_PROVIDER=exa with EXA_API_KEY to select Exa. Provider errors are reported to the agent without switching providers. Parallel calls have a 30-second timeout and are cancelled when the chat request is aborted. Authentication and the search toggle still control access to search.
Run pnpm test:web-search (or npm run test:web-search) for deterministic provider and agent-loop tests. They use a scripted model and MCP responses without API keys or a database.
All conversations are automatically saved to PostgreSQL. Each chat is associated with a user ID (from Clerk), allowing for user-scoped chat history. Chats are loaded automatically when you navigate to a chat page.
You can customize the AI agent by:
src/agents/web-search-agent/prompt.tssrc/tools/ and integrate them in the agentsrc/agents/web-search-agent/agent.ts or src/app/api/chat/route.tsTo request a feature, open a GitHub issue.
Thank you for considering contributing to AgentKit! Please follow these guidelines to ensure smooth collaboration:
Fork the repository to your GitHub account.
Clone the forked repository to your local machine:
git clone https://github.com/your-username/agentkit-starter.git
cd agentkit-starter
git checkout -b feature/your-feature-name
Make your changes and ensure they adhere to the project's coding style and guidelines.
Test your changes thoroughly to avoid introducing bugs.
Commit your changes with clear and descriptive commit messages:
git commit -m 'feat: Add your descriptive commit message'
Note: Before committing changes, ensure you include one of these tags in your commit message: feat, fix, wip, patch, build.
git push origin feature/your-feature-name
Open a pull request against the main branch of the original repository.
Provide a clear and concise description of your changes in the pull request, along with any relevant information.
Ensure your pull request passes all checks and tests before requesting a review.
This project uses Biome for linting and formatting. Before committing, run:
pnpm lint
pnpm format
This project is licensed under the MIT License. See the LICENSE file for details.
Built with ❤️ by Anayat Khan
browse all types & interfaces →
$ claude mcp add agentkit-starter \
-- python -m otcore.mcp_server <graph>