An 100% local, LLM-generated and LLM-driven virtual pet with thoughts, feelings and feedback. Revive your fond memories of Tamagotchi!
All ascii animations are generated using chatgpt (included prompts in the repo).
Have questions? Join AI Stack devs and find me in #ai-tamago channel.
Demo 🪄
ai-tamago-demo.mov
- 🦙 Inference: Ollama, with options to use OpenAI or Replicate
- 🔔 Game state: Inngest
- 💻 Transactional & vector database: Supabase pgvector
- 🧠 LLM Orchestration: Langchain.js
- 🖼️ App logic: Next.js
- 🧮 Embeddings generation: Transformer.js and all-MiniLM-L6-v2
- 🖌️ UI: Vercel v0
Fork the repo to your Github account, then run the following command to clone the repo:
git clone git@github.com:[YOUR_GITHUB_ACCOUNT_NAME]/AI-tamago.git
cd ai-tamago
npm run dev
All client side tamagotchi code is in Tamagotchi.tsx
Instructions are here.
- Install Supabase CLI
brew install supabase/tap/supabase
- Start Supabase
Make sure you are under /ai-tamago
directory and run:
supabase start
Tips: To run migrations or reset database -- seed.sql and migrations will run
supabase db reset
Note: The secrets here are for your local supabase instance
cp .env.local.example .env.local
Then get SUPABASE_PRIVATE_KEY
by running
supabase status
Copy service_role key
and save it as SUPABASE_PRIVATE_KEY
in .env.local
npx inngest-cli@latest dev
Make sure your app is up and running -- Inngest functions (which are used to drive game state) should register automatically.
Now you are ready to test out the app locally! To do this, simply run npm run dev
under the project root and visit http://localhost:3000
.
Now you have played with the AI tamago locally -- it's time to deploy it somewhere more permanent so you can access it anytime!
While I'm still writing up a detailed deployment guide, here are the resources you can refer to for deploying different parts of the app: