A quick start Node.js application that combines Claude's conversational AI capabilities with Zep's long-term memory storage to create an AI assistant that can remember and reference past interactions. Uses the command line as your user interface to interact with Claude.
- Long-term memory storage and retrieval using Zep
- Conversational AI powered by Claude 3.5 Sonnet
- Tools for managing memory operations:
- Adding new information to memory
- Searching memory for relevant information
- Retrieving specific facts and relationships
- Managing user-specific memory contexts
- Interactive CLI interface
- Node.js (version 14 or higher)
- Anthropic API key
- Zep API key
- Clone the repository
- Install dependencies:
npm install
- Create a
.env
file in the project root with your API keys:
ANTHROPIC_API_KEY=your_anthropic_api_key
ZEP_API_KEY=your_zep_api_key
Start the application:
npm start
This will launch an interactive CLI where you can chat with the AI assistant. Type 'exit' to quit the application. The app communicates every move in the CLI so you will see all the background activity on your screen. This is to help debug and also to give you an understanding of what is happening under the hood.
The application consists of a ClaudeZepAgent
class that:
- Initializes connections to both Claude and Zep APIs
- Manages a session-based conversation context
- Processes user input through Claude
- Executes memory-related operations using Zep
- Maintains conversation history and context
The agent uses several tools to interact with memory:
graph_add
: Stores new informationgraph_search
: Searches existing memoryget_edge
: Retrieves specific relationshipsget_node
: Retrieves specific entitiesget_user_edges
: Gets all user-related factsget_user_nodes
: Gets all user-related entitiesget_episodes
: Retrieves past conversations
@anthropic-ai/sdk
: Anthropic's Claude API client@getzep/zep-cloud
: Zep Cloud API clientdotenv
: Environment variable management
The application uses a constant user configuration for demonstration purposes. In a production environment, you would want to implement proper user management.
Current user configuration:
{
userId: "john.doe",
email: "[email protected]",
firstName: "John",
lastName: "Doe"
}
None
Feel free to use, fork, modify, and do anything you want. I'm here to help make AI easier to implement for all of us.