# Examples

> Small, complete projects that use Alexein. Clone one, add your key, and run it.

Every example is a small project of its own in [github.com/Alexein-AI/examples](https://github.com/Alexein-AI/examples).
Each folder has a README, a `.env.example` and one command to run it. You need an API key from the Console's
**[API keys](https://app.alexein.ai/console/keys)**, and most examples also need an OpenAI key.

```bash title="Terminal"
git clone https://github.com/Alexein-AI/examples.git
cd examples/quickstart/python
cp .env.example .env    # then add your key
uv run --env-file .env main.py
```

## Start here

- [Quickstart](https://github.com/Alexein-AI/examples/tree/main/quickstart): Add, search and forget for one app user, in Python and TypeScript.
- [Next.js chat](https://github.com/Alexein-AI/examples/tree/main/nextjs-chat): A chat app where each user has their own memory, with the sources of each answer shown under it.
- [Terminal chat](https://github.com/Alexein-AI/examples/tree/main/python-chat-cli): The chat loop in about a hundred lines of Python: search before each reply, save each turn after it.
- [Memory as tools](https://github.com/Alexein-AI/examples/tree/main/openai-tools): The model decides when to search and what to save, with plain OpenAI function calling.

## Agent frameworks

- [LangGraph](https://github.com/Alexein-AI/examples/tree/main/langgraph): A graph that recalls before the model and remembers after it, in Python and TypeScript.
- [OpenAI Agents SDK](https://github.com/Alexein-AI/examples/tree/main/openai-agents): An agent that knows what the user said in earlier runs, in Python and TypeScript.
- [CrewAI](https://github.com/Alexein-AI/examples/tree/main/crewai): A crew whose memory is the user's, kept in Alexein.
- [LiveKit](https://github.com/Alexein-AI/examples/tree/main/livekit-voice): A voice agent that remembers what the caller said in earlier calls.
- [n8n](https://github.com/Alexein-AI/examples/tree/main/n8n-workflow): A workflow to import, with an AI Agent that has long-term memory.
- [Your own agent over MCP](https://github.com/Alexein-AI/examples/tree/main/mcp-own-agent): An agent you built, connected to your own memory with a personal key.

## Building an app

- [Python backend](https://github.com/Alexein-AI/examples/tree/main/python-backend): A Flask app where each signed-in user gets a memory of their own: chat, see what is kept, and erase it.
- [Documents Q&A](https://github.com/Alexein-AI/examples/tree/main/documents-qa): Add a folder of notes and documents, then ask questions and get answers with citations.
- [Facts over time](https://github.com/Alexein-AI/examples/tree/main/facts-over-time): Values that change, their history, a correction, and something that expires.
- [Webhook receiver](https://github.com/Alexein-AI/examples/tree/main/webhook-receiver): Verify each signed event and handle retries, in Python and Node.
- [Erasure requests](https://github.com/Alexein-AI/examples/tree/main/erasure-request): Look, forget, and keep the receipt, or erase a user whole.
- [Migrate from Mem0](https://github.com/Alexein-AI/examples/tree/main/migrate-from-mem0): Import a Mem0 export, one app user for each Mem0 user, and check it.
