Skip to main content

Overview

This guide walks you through building a complete Next.js application with Satori memory, including:
  • Chat interface with memory
  • User authentication
  • Memory dashboard
  • API routes with proper error handling

Project Setup

1

Create a Next.js project

Choose these options:
  • TypeScript: Yes
  • ESLint: Yes
  • Tailwind CSS: Yes
  • App Router: Yes
2

Install dependencies

3

Set up environment variables

.env.local

Authentication Setup

Configure Clerk

middleware.ts

Root Layout

app/layout.tsx

Chat API Route

Create a memory-enabled chat endpoint:
app/api/chat/route.ts

Chat Page

Create an interactive chat interface:
app/chat/page.tsx

Memory Dashboard

Create a page to view and manage memories:
app/dashboard/page.tsx

Memory API Routes

Get All Memories

app/api/memories/route.ts

Search Memories

app/api/memories/search/route.ts

Delete Memory

app/api/memories/[id]/route.ts

Running the Application

1

Start the development server

2

Visit the application

Open http://localhost:3000 in your browser
3

Sign in

Create an account or sign in with Clerk
4

Start chatting

Try these prompts:
  • “Remember that I love TypeScript”
  • “My favorite color is blue”
  • “What do you know about me?”
5

View your memories

Click “View Memories” to see all stored memories

Next Steps

Deploy to Vercel

Deploy your application to production

Add More Features

Explore advanced examples

API Reference

Learn about all available endpoints

Troubleshooting

Fix common issues