AI Tamago: Reviving Virtual Pets with Modern AI
Introduction
AI Tamago is a unique project that breathes life into the nostalgic virtual pet experience reminiscent of the beloved Tamagotchi toys from the late 90s. Infused with advanced AI capabilities, AI Tamago offers a local, large language model (LLM)-driven virtual pet with its own thoughts, feelings, and reactions. Now hosted on Fly.io, this digital pet leverages modern artificial intelligence to create an interactive experience like no other.
Features
AI Tamago stands out with its entirely local hosting strategy, meaning all processing and interactions happen right on your machine. This ensures data privacy and enhances performance by eliminating the need for cloud reliance. Users can view ascii animations that are generated using ChatGPT, adding to the charm by visually enriching the pet's responses and actions.
Technical Overview
AI Tamago's operation is underpinned by a robust tech stack, ensuring smooth functionality and an enriching user experience. Here's what goes into making AI Tamago work:
Local Mode
- Inference Engine: AI Tamago uses Ollama for processing inferences, with alternatives like OpenAI or Replicate for diversified LLM options.
- Game State Management: Inngest handles the game state, ensuring the virtual pet’s responses and behaviors are consistent and reliable.
- Database: Supabase pgvector offers a transactional and vector database solution, assisting in managing complex data interactions.
- Language Model Orchestration: Langchain.js is used for managing large language models, facilitating natural conversational interactions.
- App Logic: Built with Next.js, the app's core logic is robust and efficient.
- Embeddings and UI: Transformer.js and Magic Patterns enhance the app with advanced embeddings for understanding inputs and a sleek user interface, respectively.
Production Mode Additions
In production mode, the project extends its capabilities with additional layers:
- Authentication and User Management: Handled by Clerk, ensuring secure access and ease of management for multiple users.
- Hosting: Fly.io provides dependable hosting infrastructure.
- Rate Limiting: Upstash helps prevent system overload from excessive requests, maintaining operational integrity.
Getting Started
Prerequisites: Before diving in, ensure Docker is installed on your system for seamless deployment.
- Clone the Repository: Begin by forking the AI Tamago repository on GitHub and clone it onto your local machine.
- Dependencies and Setup: Navigate to your cloned repository, install necessary dependencies, and set up tools like Ollama and Supabase.
- Run Locally: Once set up, you can experience AI Tamago by running it locally using Node.js.
Deployment Guide
Deployment allows you to share AI Tamago’s enchantment beyond a local environment:
- Choose LLM for Production: Decide between ChatGPT, Ollama, or Replicate for scaling inferences.
- Branch Switching: Move to the
deploy
branch for all deployment essentials. - Database and Rate Limiting Setup: Link your project to Supabase Cloud and create an Upstash Redis instance for rate limiting.
- Deploy on Fly.io: Set up your fly.io account, configure your app, and launch it to make AI Tamago accessible anytime.
Conclusion
AI Tamago fuses the nostalgic charm of virtual pets with the advancements of modern AI, offering a refreshing blend of technology and entertainment. Whether you're rekindling your past love for virtual companions or introducing this novelty to the new generation, AI Tamago is sure to be a delightful journey down the virtual pet lane, now with a smarter companion that learns and evolves with you.