a16z-infra/companion-app — explained in plain English
Analysis updated 2026-06-26
Build a chatbot with a custom personality and backstory that remembers past conversations using a vector database.
Learn how AI chatbots with memory are built by running and modifying a working starter kit locally.
Add SMS chat to an AI companion so users can text it from their phone via Twilio.
Fork this project to create a fully custom AI companion app with your own character definitions and personality files.
| a16z-infra/companion-app | elder-plinius/g0dm0d3 | googlechrome/rendertron | |
|---|---|---|---|
| Stars | 5,954 | 5,956 | 5,951 |
| Language | TypeScript | TypeScript | TypeScript |
| Setup difficulty | moderate | easy | moderate |
| Complexity | 3/5 | 1/5 | 3/5 |
| Audience | developer | researcher | developer |
Figures from each repo's GitHub metadata at analysis time.
Requires API keys for multiple services including Clerk, OpenAI or Replicate, Pinecone or Supabase, and Upstash, Twilio is optional for SMS.
This repository is a tutorial starter kit for building your own AI companion, meaning a chatbot with a defined personality that you can converse with over a web browser or through text messages. It was created by the infrastructure team at a16z as a learning resource, not as a finished product, so the goal is to show developers how these kinds of chatbots are built rather than to ship a polished app. The core idea is that you define your companion's personality and backstory by writing a text file, then the app uses that information to shape every conversation. To give the companion a sense of memory, the system stores recent conversation history in a queue and also uses a vector database to find relevant past context and pull it into the current prompt. This makes responses feel more connected to what was discussed earlier, rather than each message being treated in isolation. The technical stack includes Next.js for the web app, Clerk for user login, Langchain.js to coordinate the AI calls, and either OpenAI or a model called Vicuna (hosted on a service called Replicate) as the actual language model. Conversation history is stored in Upstash, and the vector database can be either Pinecone or Supabase. You can also add SMS chat via Twilio if you want to text your companion from your phone. Each of these services requires an API key, and the README walks through obtaining and configuring each one. The repository includes four pre-built companion personalities you can chat with right away after setting up the environment variables. The README explicitly notes that this is a developer tutorial, not a production platform, and that heavier production alternatives exist elsewhere. If you are a developer curious about how AI chatbots with memory are built, this repository gives you a working example you can run locally and modify. If you are a non-technical user looking for an AI companion to use, this is a codebase you would need to deploy yourself, not a ready-to-use product.
A tutorial starter kit by a16z for building your own AI companion chatbot with a defined personality and long-term memory, accessible via web or SMS. It shows developers how to wire together Next.js, Langchain, vector databases, and language models into a conversational AI.
Mainly TypeScript. The stack also includes TypeScript, Next.js, Langchain.js.
Setup difficulty is rated moderate, with roughly 1h+ to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.