Skip to content

kr8tiv-ai/Kin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

131 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KIN by KR8TIV

We Build You A Friend

Bags Hackathon 2026 $4M Developer Fund

Built on Bags Next.js 15 TypeScript Solana Fastify Three.js Tests License


AI companions powered by frontier models. Each KIN has its own brain, persistent memory, voice, and personality — owned as an NFT on Solana. 57 unique 3D characters across 6 bloodlines.

Website | Hackathon | Apply | Organization


What is KIN?

KIN is a consumer AI companion platform where users adopt, chat with, and grow alongside personalized AI friends. Each companion is a unique NFT with its own frontier AI brain, persistent intelligent memory, voice capabilities, and skills that transfer with NFT ownership.

No crypto knowledge needed — just pick a friend and start talking.

The collection spans 6 bloodlines with 57 individually crafted 3D characters, each generated from original 2D artwork using AI-powered 3D synthesis. Every character ships as a production-ready GLB model rendered in real-time via Three.js/WebGL.


Why KIN Wins

Multi-Brain ArchitectureEach companion runs on a different frontier AI model — GPT-5.4, Claude Opus 4.6, Gemini 3.1 Pro, Grok 4.20, Kimi K2.5, GLM-4.6
Soul AuthoringUsers shape personality via trait sliders — warmth, humor, formality, curiosity — with drift detection that keeps the AI on-character
Skill PortabilitySkills accrue to companions and transfer with NFT sales — the new owner inherits everything the companion learned
Local-First PrivacyOllama integration means conversations can stay on-device. Cloud is opt-in, not required
57 Unique 3D CharactersAI-generated from original artwork, rendered in real-time WebGL with interactive rotation
Companion Abilities6 domain-specific skills powered by local models — code gen, social content, data analysis, architecture review, creative writing, habit coaching
Privacy-First TrainingOpt-in conversation curation, QLoRA fine-tuning pipeline, custom Ollama models per companion
Multi-PlatformWeb dashboard, Telegram bot, Discord bot, WhatsApp — same AI, same memory, everywhere

The Six Bloodlines

BloodlineSpeciesAI BrainSpecialization#
CipherCode KrakenOpenAI GPT-5.4Web design, frontend, creative tech10
MischiefGlitch PupGoogle Gemini 3.1 ProFamily, personal branding, social10
VortexTeal DragonAnthropic Claude Opus 4.6Content strategy, brand voice, analytics10
ForgeCyber UnicornxAI Grok 4.20Code review, debugging, architecture10
AetherFrost ApeMoonshot Kimi K2.5Creative writing, storytelling, prose10
CatalystCosmic BlobZ.ai GLM-4.6Financial literacy, habits, life optimization7

Free tier uses Groq Qwen 3 32B for all companions (500K tokens/day, $0 cost).


Live Demo Flow

 1.  Visit meetyourkin.com
 2.  Sign up (Google, Email, Solana wallet, X, or Telegram)
 3.  Onboarding: normie-first 3-step flow (welcome -> preferences -> ready)
 4.  First message auto-generated from your companion's personality
 5.  Chat with your KIN — personality matches your soul editor settings
 5.  Soul Editor: adjust traits -> watch the AI's tone shift in real-time
 6.  Skills Marketplace: install calculator, weather, web search, more
 7.  Collection: view all 6 companions in 3D WebGL with interactive rotation
 8.  Mint: pay SOL -> companion NFT appears in your wallet
 9.  Progress: earn XP, unlock badges, maintain streaks
10.  Share: tweet your KIN's stats for viral growth

Architecture

                    +-------------------+
                    |   Next.js 15 Web  |  React 19, Three.js, Tailwind 4
                    |   25+ pages, 68+  |  Framer Motion animations
                    |   components       |
                    +--------+----------+
                             |
                    +--------v----------+
                    |   Fastify 5 API   |  28+ route files, JWT auth
                    |   55+ endpoints   |  Rate limiting, CORS
                    +--------+----------+
                             |
              +--------------+--------------+
              |              |              |
     +--------v---+  +------v------+  +----v--------+
     | SQLite DB   |  |  Inference  |  | Solana/NFT  |
     | 20+ tables  |  |  Engine     |  | Metaplex    |
     | Seeds, FTS  |  |             |  | Candy Mach. |
     +-------------+  +------+------+  +-------------+
                             |
           +-----------------+-----------------+
           |        |        |        |        |
        +--v--+  +--v--+  +--v--+  +--v--+  +--v--+
        |Groq |  |Open |  |Anth |  |Goog |  |xAI  |  + Moonshot, Z.ai
        |FREE |  |AI   |  |ropic|  |le   |  |     |
        +-----+  +-----+  +-----+  +-----+  +-----+
           |
     +-----v------+
     | Ollama     |  Local-first, on-device
     | (optional) |  Privacy mode
     +------------+

Two-Brain Inference

Every conversation runs through a two-brain architecture:

  1. Primary Brain — Fast, cost-efficient model (Groq free tier or local Ollama) handles most messages
  2. Supervisor Brain — Frontier model (GPT-5.4, Claude, Gemini, etc.) activates for complex queries via keyword-triggered escalation
  3. Privacy Contract — PII is redacted before any cloud call. Local mode keeps everything on-device.

Soul Drift Detection

The Soul Editor lets users set personality traits. A SHA-256 hash of the soul config creates a "soul fingerprint" — if the AI's behavior drifts from the configured personality, the system detects it and recalibrates.

Training Pipeline (Fine-Tuning)

Each companion can be fine-tuned on its own conversation history:

Step Description
Curation Admin UI at /dashboard/training to review, approve, and filter conversation data
Privacy Gate Only opted-in conversations are eligible. PII is stripped before export
JSONL Export Instruction-following format compatible with any fine-tuning framework
QLoRA Training Unsloth-powered 4-bit quantized training on consumer GPUs (16GB VRAM)
Ollama Deploy Auto-generates Modelfiles and deploys to Ollama for immediate local inference

Companion Abilities

Companion Ability Triggers
Cipher Code Generation generate code, write function, review code
Mischief Social Content create post, social media, brand content
Vortex Data Analysis analyze data, market research, trend
Forge Architecture Review architecture, system design, code review
Aether Creative Writing write story, creative writing, worldbuild
Catalyst Habit Coaching habit, goal setting, routine, accountability

Privacy Controls

Two-option privacy toggle during onboarding and in settings:

  • Standard Mode — Conversations may be used for companion improvement (opt-in training data)
  • Maximum Privacy — All inference stays local via Ollama. No data leaves the device.

Tech Stack

Layer Technology Details
Frontend Next.js 15 + React 19 25+ pages, SSR, App Router
Styling Tailwind CSS 4 Dark theme, responsive
3D Three.js + React Three Fiber Real-time WebGL rendering
Animations Framer Motion Page transitions, micro-interactions
Backend Fastify 5 55+ endpoints, JWT auth, rate limiting
Database better-sqlite3 20+ tables, FTS, seeds
Bots grammy / discord.js / Baileys Telegram, Discord, WhatsApp
Local LLM Ollama SDK On-device inference
Cloud LLM OpenAI + Anthropic + Google + xAI Multi-provider routing
Blockchain Solana Web3.js + Metaplex Umi NFT minting, ownership
Testing Vitest 200+ tests
Containers Docker + Compose GHCR pull-based deploy
Language TypeScript 5.7 Strict mode, zero errors

Repository Structure

Kin/
+-- api/                          # Fastify API server
|   +-- server.ts                 # Main server, DB init, 28 route files
|   +-- lib/                      # Archive builder, export/import, solana mint
|   +-- middleware/                # Rate limiting, auth, token gating
|   +-- routes/                   # Auth, chat, soul, skills, NFT, training, referral, eval...
|
+-- web/                          # Next.js 15 frontend
|   +-- src/
|       +-- app/                  # 25+ pages (dashboard, chat, collection, soul editor, refer...)
|       +-- components/           # 68+ components (3D viewer, chat, auth, fleet, migration...)
|       +-- hooks/                # useAuth, useChat, useCompanions, useSoul, useReferral...
|       +-- lib/                  # API client, types, utilities
|
+-- inference/                    # Multi-provider AI engine
|   +-- providers/                # 7 LLM providers
|   +-- supervisor.ts             # Two-brain escalation
|   +-- soul-drift.ts             # Personality drift detection
|   +-- distill/                  # Knowledge distillation pipeline
|   +-- eval/                     # Evaluation framework (benchmarks, scoring, comparison)
|   +-- memory/supermemory.ts     # Semantic memory client
|   +-- companion-prompts.ts      # 6 distinct system prompts
|   +-- fallback-handler.ts       # Local -> Cloud fallback chain
|   +-- training-curation.ts      # Privacy-aware data curation
|   +-- advantage-detector.ts     # Local model advantage detection
|
+-- training/                     # Model fine-tuning pipeline
|   +-- train-companion.ts        # Full training orchestration
|   +-- retrain-loop.ts           # Continuous retraining loop
|   +-- fine-tune.py              # Unsloth QLoRA (4-bit quantization)
|   +-- modelfile-generator.ts    # Ollama Modelfile generation
|
+-- fleet/                        # Fleet management system
|   +-- credit-db.ts              # Credit tracking database
|   +-- credit-routes.ts          # Credit API routes
|   +-- frontier-proxy.ts         # Frontier model proxy
|   +-- tunnel-manager.ts         # Secure tunnel management
|   +-- wake-proxy.ts             # Wake-on-demand proxy
|
+-- bot/                          # Multi-platform bots
|   +-- telegram-bot.ts           # Telegram (grammy) - 16 commands
|   +-- discord-bot.ts            # Discord bot
|   +-- whatsapp-bot.ts           # WhatsApp bot (Baileys)
|   +-- skills/                   # Companion ability system
|
+-- voice/                        # Voice pipeline (Whisper STT + Piper TTS)
+-- solana/                       # NFT minting, ownership verification
+-- db/                           # SQLite schema (20+ tables)
+-- runtime/                      # Health monitoring, watchdog, recovery
+-- scripts/                      # Setup, deployment, cloud deploy utilities
|
+-- assets/                       # NFT metadata + creature images
|   +-- creatures/                # 27 creature portrait JPGs
|   +-- eggs/                     # 5 Genesis egg JPGs
|   +-- kin-metadata/             # 6 companion JSON metadata files
|
+-- 3d-assets/                    # Full 3D character collection (171 files)
|   +-- Aether - Frost Ape/       # 10 variations (GLB + OBJ + JPG)
|   +-- Catalyst - Cosmic Blob/   # 7 variations
|   +-- Cipher - Code Kraken/     # 10 variations
|   +-- Forge - Cyber Unicorn/    # 10 variations
|   +-- Mischief - Glitch Pup/    # 10 variations
|   +-- Vortex - Teal Dragon/     # 10 variations
|
+-- docker-compose.yml            # Pull-based deploy (GHCR)
+-- Dockerfile                    # Production build
+-- vitest.config.ts              # Test config
+-- tsconfig.json                 # TypeScript strict mode
+-- package.json                  # Root dependencies

3D Asset Pipeline

Original 2D Artwork  -->  Tripo3D AI  -->  GLB + OBJ + JPG
   (hand-designed)       (3D synthesis)    (171 production files)
Format Use Case
GLB Web rendering (Three.js), game engines (Unity/Unreal/Godot), AR/VR (WebXR)
OBJ 3D editing in Blender, Maya, ZBrush, Cinema 4D
JPG Source artwork / canonical visual reference

Total: 57 characters x 3 formats = 171 production-ready 3D assets


Database Schema

20+ tables powering the full platform:

Table Purpose
users Multi-auth accounts (email, Google, Solana wallet, X, Telegram)
companions 6 Genesis companions with metadata
user_companions Ownership mapping + NFT mint addresses
conversations / messages Chat history with token tracking
memories Per-user per-companion memories with embeddings
companion_souls Soul editor configs + drift scores
companion_skills Skill accrual, leveling, portability
companion_snapshots IPFS-ready personality snapshots for NFT transfer
nft_ownership / nft_transfers NFT tracking + skill transfer log
skills / user_skills 10 seeded skills, install/toggle tracking
subscriptions Billing tiers (Free / Hatchling / Elder / Hero)
referrals Referral codes + reward tracking
progress XP, streaks, badges, levels
support_tickets / support_chats AI-powered support system

API Endpoints (55+)

Route Group Key Endpoints
Auth POST /auth/email/register, /email/login, /google, /solana, /telegram, /x/authorize, /x/callback
Chat POST /kin/chat, GET /kin/status
Conversations GET /conversations, POST /conversations, GET /conversations/:id/messages
Soul GET /soul/:companionId, PUT /soul/:companionId, POST /soul/:companionId/calibrate
Skills GET /skills, POST /skills/install, PUT /skills/toggle, POST /skills/request
NFT GET /nft/owned, POST /nft/verify
Progress GET /progress, POST /progress/streak
Referral GET /referral/code, POST /referral/redeem, GET /referral/stats
Eval POST /eval/run, GET /eval/results, GET /eval/compare
Distill POST /distill/start, GET /distill/status
Retrain POST /retrain/start, GET /retrain/status
Advantage GET /advantage/detect, POST /advantage/benchmark
Training GET /training/conversations, POST /training/curate, POST /training/export
Support POST /support/chat, GET /support/tickets
Health GET /health, GET /live, POST /heartbeat

Bags Hackathon Integration

Categories

  • AI Agents — 6 AI companions with distinct frontier model brains
  • Fee Sharing — Revenue from NFT mints + skill marketplace shared with $KR8TIV holders
  • Bags API — Token-gated features, price feeds, holder verification

$KR8TIV Token

KIN is powered by the $KR8TIV token on Solana via Bags.fm. The token drives the entire kr8tiv-ai ecosystem. Hold $KR8TIV to unlock premium companions, access frontier AI models, and earn fee-sharing revenue from the platform.

60 Genesis NFTs

Tier Count Mint Price Perks
Egg 20 2.5 SOL Base companion access
Hatchling 20 5.3 SOL + Frontier model access
Elder 20 8.3 SOL + All companions + priority skills

Quick Start

Prerequisites

  • Node.js >= 20.0.0
  • npm or pnpm
  • (Optional) Ollama for local LLM
  • (Optional) Docker for containerized deployment

1. Clone & Install

git clone https://github.com/kr8tiv-ai/Kin.git
cd Kin
npm install
npm install --prefix web

2. Run the Adaptive Installer

# Unix/macOS/WSL
./deploy-easy.sh --dry-run   # preview
./deploy-easy.sh             # run

# Windows
deploy-easy.bat --dry-run
deploy-easy.bat

The installer is deterministic and resumable — environment checks, dependency setup, and first-run configuration. Safe local fixes run automatically; external actions require explicit confirmation.

3. Open the Dashboard

Service URL Port
Web Frontend http://localhost:3001 3001
API Server http://localhost:3002 3002

Manual Development

npx tsx api/server.ts          # API server (Fastify + SQLite)
npm run dev --prefix web       # Web frontend (Next.js 15)

Docker Deployment

docker compose pull && docker compose up -d

Pin to a specific build:

GHCR_OWNER=kr8tiv-ai KIN_IMAGE_TAG=sha-<short_sha> docker compose up -d

Testing

npm test          # 200+ tests (Vitest)
npm run typecheck # Zero TypeScript errors
npm run build     # Production build verification

Deployment

Recommended Stack (~$5/month for MVP)

Component Solution Cost
API + Web Hetzner CX22 (2 vCPU, 4GB) $5/mo
LLM Groq free tier (500K tokens/day) $0
RPC Helius free tier (100K credits/day) $0
Domain meetyourkin.com $0
SSL Let's Encrypt $0

GHCR Runtime Images

The publish workflow pushes three runtime images to GHCR on every main push:

Service Image
API ghcr.io/kr8tiv-ai/kin-api:latest
Web ghcr.io/kr8tiv-ai/kin-web:latest
Inference ghcr.io/kr8tiv-ai/kin-inference:latest

All images support commit-pinned tags: sha-<7 hex chars>

One-Click Cloud Deploy

  • Railwayrailway.toml + guide
  • Renderrender.yaml + guide
  • Fly.iofly.toml + guide
  • Coolifydocker-compose.coolify.yml + guide

All providers consume GHCR runtime refs and must prove readiness via GET /health.


The kr8tiv-ai Ecosystem

Project Description
KIN AI companion platform (this repo)
PinkBrain Router Bags.fm fee-funded OpenRouter API credits for 300+ AI models
PinkBrain LP Auto-compounding Meteora DAMM v2 liquidity from Bags.fm fees
Runtime Truth Contracts Schema-first runtime contracts for multi-agent governance
Mission Control AI agent governance and evaluation dashboard
Jarvis Persistent context engine — 81+ active Solana trading strategies

All projects are powered by $KR8TIV on Solana through Bags.fm fee-sharing infrastructure.


Project Stats

  Files         200+       API Endpoints    55+
  Tests         200+       3D Assets        171
  Components    68+        DB Tables        20+
  Pages         25+        LLM Providers    7
  Bot Commands  16+        Bloodlines       6

Contributing

See CONTRIBUTING.md for setup, code conventions, and PR guidelines. For architectural patterns and agent contribution rules, see AGENTS.md.

Organization: kr8tiv-ai — Issues and PRs welcome.


Links

Website meetyourkin.com
Hackathon bags.fm/hackathon
Apply bags.fm/apply
Bags API dev.bags.fm
Organization github.com/kr8tiv-ai
Builder github.com/Matt-Aurora-Ventures

License

MIT License. See LICENSE for details.

3D character assets are proprietary to the KIN project. All rights reserved.


"We Build You A Friend."

Built by Matt Haynes / kr8tiv-ai

About

AI companion platform — adopt, chat with, and build relationships with personalized AI friends as Solana NFTs. Multi-brain, multi-platform, open-source.

Topics

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors