A Unity-based desktop pet game where a virtual cat powered by local LLMs (via Ollama) develops its own personality, remembers conversations, and reacts with contextual emotions and behaviors.
Screenshots coming soon
This isn't a chatbot with a cat skin. The cat has:
- Memory — Remembers past conversations and builds context over time
- Mood & State — Hunger, trust level, and emotional state affect responses
- Trust Tiers — The cat warms up to you gradually (stranger → acquaintance → friend)
- Autonomous Behavior — Monologues, idle actions, and reactions without user input
- 100% Local AI — No cloud APIs, no data leaves your machine
- Local LLM integration via Ollama (supports Gemma, Qwen, Aya, and custom LoRA models)
- Structured Control System — AI outputs JSON control signals that drive behavior, not just text
- Sentiment Analysis — Parses emotional tone to adjust cat state
- Memory Manager — Summarizes and retains conversation history across sessions
- Prompt Engineering — Dynamic prompt builder that injects state, memory, and personality
- Hunger system with food bowl interaction
- Trust tier progression (affects response style and available interactions)
- Day/night cycle awareness
- Idle monologues and autonomous behavior planning
- Benchmark Runner — Measures response quality with cat-likeness scoring
- Training Data Generator — Auto-generates fine-tuning datasets from interactions
- LoRA Training Pipeline — Full workflow from data → Unsloth training → GGUF conversion → deployment
┌─────────────────────────────────────────────┐
│ Unity (Game) │
│ │
│ ChatUI ──→ InputHandler ──→ PromptBuilder │
│ │ │
│ CatStateManager ◄── ControlBuilder │ │
│ │ ▲ │ │
│ CatMemoryManager │ ▼ │
│ │ ResponseProcessor │
│ ▼ ▲ │
│ InteractionLogger OllamaAPIManager │
│ │ │
└─────────────────────────────┼───────────────┘
│
┌─────────▼─────────┐
│ Ollama Server │
│ (Local LLM) │
└───────────────────┘
| Script | Role |
|---|---|
PromptBuilder.cs |
Assembles system prompt with state, memory, personality |
OllamaAPIManager.cs |
HTTP client for Ollama API |
ResponseProcessor.cs |
Parses JSON control signals from LLM output |
CatStateManager.cs |
Manages hunger, trust, mood |
CatMemoryManager.cs |
Conversation memory with summarization |
BehaviorPlan.cs |
Autonomous behavior planning |
SentimentAnalyzer.cs |
Emotional tone detection |
MonologueManager.cs |
Idle speech / thought bubbles |
- Unity 2022.3+ (LTS)
- Ollama installed and running
- A compatible model pulled (e.g.,
ollama pull gemma2:2b)
git clone https://github.com/sjsr-0401/CatTalk2D.git- Open project in Unity
- Start Ollama:
ollama serve - Pull a model:
ollama pull gemma2:2b - Press Play in Unity Editor
See docs/TECHNICAL_JOURNEY.md for the full fine-tuning pipeline:
- Generate training data from interactions
- Fine-tune with Unsloth
- Convert to GGUF
- Deploy via Ollama
CatTalk2D/
├── Assets/_Project/
│ └── Scripts/
│ ├── AI/ # LLM integration, prompts, response parsing
│ ├── Cat/ # State, behavior, movement, interaction
│ ├── Memory/ # Conversation history & summarization
│ ├── UI/ # Chat interface, bubbles, food bowl
│ └── Dev/ # Benchmark, training data tools
├── docs/
│ ├── ARCHITECTURE.md # Full system architecture
│ ├── TECHNICAL_JOURNEY.md # Development log & decisions
│ └── GGUF_QUANTIZATION.md # Model conversion guide
├── LoraData/ # Fine-tuning datasets
└── training_data.jsonl # Generated training samples
- No cloud dependency — Privacy-first design, all AI runs locally
- Structured output — LLM generates JSON control signals, not free-form text, ensuring deterministic game behavior
- Memory architecture — Rolling summary + recent context window for coherent long conversations
- Modular AI backend — Swap models without changing game code (Gemma → Qwen → custom LoRA)
- Built-in evaluation — Cat-likeness scoring benchmarks for comparing model performance
MIT License
Built by Kim Seongjine — Exploring the intersection of game development and local AI.