
Deploy your own AI chatbot using Letta to create agents that can learn over time.
Note
You must have a Letta server running to use this template. Follow this quickstart guide to run your local Letta server.
-
- Formerly known as MemGPT, Letta is an open-source framework designed for building stateful LLM applications. Our chatbot webapp template showcases powerful core features of Letta.
-
Static defined agent state
- Define your agent state in the
default-agents.json
file. This file contains the initial state of your agents, including the LLM model, user profile, agent persona, and other configurations.
- Define your agent state in the
-
Cookie-based sessions
- Includes an implementation of cookie-based sessions to emulate users.
- Can be disabled by setting
USE_COOKIE_BASED_AUTHENTICATION=false
to view all your agents from the ADE. - Different chat histories for different browsers. Tracks anonymous users across requests without requiring authentication.
-
- The Letta TypeScript library provides convenient access to the Letta API.
-
- We leverage Next.js for its server-side rendering (SSR) and other performance optimizations, ensuring a fast and seamless user experience.
-
- React provides a component-based architecture, enabling us to build interactive and dynamic UIs with reusable elements.
-
- TypeScript enhances our codebase with static typing, improved maintainability, and better developer tooling, reducing potential runtime errors.
-
- Shadcn UI, built on Tailwind CSS, offers a collection of modern, accessible UI components, ensuring a cohesive and polished design.
-
- React Markdown allows us to render Markdown content seamlessly, making it easier to display formatted text within our application.
Follow the quickstart guide to run your local Letta server.
You can run your own Letta server using Letta Desktop or Docker.
By default, the Letta server will run on http://localhost:8283
.
1️⃣ Clone the repository and install dependencies:
# Clone the repository
git clone [email protected]:letta-ai/letta-chatbot-template.git
# Navigate to the project directory
cd letta-chatbot-template
# Install dependencies
npm install
# Set environment variables
cp .env.template .env
2️⃣ Update the .env
file with your Letta server URL
3️⃣ Update the default agents in the default-agents.json
file
4️⃣ Run the app
npm run dev
Environment variables can be controlled by setting them in your .env
file or by setting them in your deployment environment.
LETTA_ACCESS_TOKEN
- Your Letta access token, if not using cloud this is usually optiona.LETTA_SERVER_URL
- The URL of your Letta server. Default ishttp://localhost:8283
.NEXT_PUBLIC_CREATE_AGENTS_FROM_UI
- If set totrue
will show a+
button in the sidebar to create new agents from thedefault-agents.json
file. Default istrue
.USE_COOKIE_BASED_AUTHENTICATION
- If set totrue
will use cookie-based sessions to emulate users. Default istrue
.
Once the app is running, open your web browser and navigate to http://localhost:3000.
👾 TBA. Stayed tuned! Follow us on Discord for updates.