whatisgithub

What is companion-app?

a16z-infra/companion-app — explained in plain English

Analysis updated 2026-06-26

5,954TypeScriptAudience · developerComplexity · 3/5Setup · moderate

In one sentence

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.

Mindmap

mindmap
  root((repo))
    What it does
      AI chatbot with memory
      Custom personality files
      SMS and web chat
    Tech Stack
      Next.js
      Langchain.js
      OpenAI or Vicuna
      Pinecone or Supabase
    Use Cases
      Custom AI companions
      Memory chatbots
      Tutorial learning
    Audience
      Developers
      AI learners
    Setup
      Multiple API keys
      Clerk for auth
      Upstash for history
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Build a chatbot with a custom personality and backstory that remembers past conversations using a vector database.

USE CASE 2

Learn how AI chatbots with memory are built by running and modifying a working starter kit locally.

USE CASE 3

Add SMS chat to an AI companion so users can text it from their phone via Twilio.

USE CASE 4

Fork this project to create a fully custom AI companion app with your own character definitions and personality files.

What is it built with?

TypeScriptNext.jsLangchain.jsOpenAI APIPineconeUpstashClerkTwilio

How does it compare?

a16z-infra/companion-appelder-plinius/g0dm0d3googlechrome/rendertron
Stars5,9545,9565,951
LanguageTypeScriptTypeScriptTypeScript
Setup difficultymoderateeasymoderate
Complexity3/51/53/5
Audiencedeveloperresearcherdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 1h+

Requires API keys for multiple services including Clerk, OpenAI or Replicate, Pinecone or Supabase, and Upstash, Twilio is optional for SMS.

So what is it?

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.

Copy-paste prompts

Prompt 1
I cloned the a16z companion-app. How do I define a custom companion personality using the text file format and what fields does it need?
Prompt 2
Walk me through how the companion-app uses Upstash and Pinecone together to give the AI memory across multiple conversations.
Prompt 3
Help me configure all the required environment variables for the a16z companion-app: Clerk, OpenAI, Pinecone, and Upstash.
Prompt 4
How do I add SMS chat to my companion-app so users can text the AI using Twilio?
Prompt 5
I want to swap OpenAI for Vicuna via Replicate in the companion-app. What code changes do I need to make?

Frequently asked questions

What is companion-app?

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.

What language is companion-app written in?

Mainly TypeScript. The stack also includes TypeScript, Next.js, Langchain.js.

How hard is companion-app to set up?

Setup difficulty is rated moderate, with roughly 1h+ to a first successful run.

Who is companion-app for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.