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: 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.
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
$ claude mcp add agentkit-starter \
-- python -m otcore.mcp_server <graph>