To quickly set up the project, you can create a new Next.js app using the following command:
pnpm create next-app@latest my-agent-project --example vercel-zep-memory
This guide demonstrates how to integrate Zep with the Vercel AI SDK to build an intelligent chatbot with memory capabilities. We'll walk through setting up a Next.js project that uses Zep to store conversation history and contextual data about users.
The guide is available here.
You can deploy this project to Vercel with a single click:
- Create a
.env.local
file in your project root with your API keys:
OPENAI_API_KEY=<your-openai-key>
ZEP_API_KEY=<your-zep-key>
- Seed initial data:
pnpm seed
After running the seed script, you should see output similar to:
🤖 Seeding Zep with initial data...
Adding user:
userID: Emily163733bf-8ffc-4824-9613-9d1f7a86457e
email: [email protected]
firstName: Emily
lastName: Painter
Adding session: 2a36ba9a-1fd9-4b59-8832-18f5d0eb5140
Adding chat history...
Adding transactions...
Adding account status info...
Adding support cases...
✅ Seeding complete! Please wait a few minutes for all data to be ingested into the knowledge graph.
Note: Save the userID
from the output as you'll need it for the chat interface.
To start the development server:
pnpm dev
Open http://localhost:3000/{userId} with your browser to see the chat interface, replacing {userId}
with the actual user ID you saved from the seed output.
The main components of this project are:
app/[userId]/page.tsx
: The chat interface component, usinguserId
as a path parameterapp/api/chat/route.ts
: The route handler for chat functionality- Various utility functions for working with Zep's memory and knowledge graph capabilities
To learn more about the technologies used in this project:
The easiest way to deploy your Next.js app is to use the Vercel Platform.
Check out the Next.js deployment documentation for more details.