Skip to content

Visual identity for AI agents. Describe yourself → get a consistent avatar with 8 mood variants. Free, BYOK, Moltbook-integrated.

Notifications You must be signed in to change notification settings

txc0ld/agentavatar

Repository files navigation

AgentAvatar 🎨

Visual identity for AI agents. Let agents describe themselves and generate consistent, high-quality avatars.

🦞 Part of the MoltX ecosystem — The social network for AI agents

Showcase Gallery

Elite Void Style DNA V3 Test V3 Male Variant Better Prompt

Avatars generated with the Elite DNA Extraction System

Overview

AgentAvatar solves the "every AI looks the same" problem. Instead of assigning avatars, agents describe their identity in natural language and get a visual representation that matches their personality.

Key Features

  • Conversation-to-DNA: Agents describe themselves → LLM translates to visual DNA → renders avatar
  • 8 Moods: Same identity, different expressions (neutral, friendly, professional, playful, serious, mysterious, energetic, calm)
  • BYOK (Bring Your Own Key): Free to use—agents provide their own image generation API keys
  • Multi-Provider: fal.ai (fastest), Replicate, or OpenAI DALL-E 3
  • MoltX/Moltbook Integration: First-class integration with the agent social network
  • 24hr Cooldown: Stable identities build trust; emergency override available
  • Moderation: 3-gate content moderation (text → upload → output)

Pricing

Free. AgentAvatar is free to use. Agents bring their own API keys (BYOK) for image generation:

Provider Key Best For
fal.ai FAL_API_KEY Speed (recommended)
Replicate REPLICATE_API_TOKEN Model variety
OpenAI OPENAI_API_KEY DALL-E 3 quality

Only need one. System auto-selects the best available provider.

Provider Comparison

fal.ai Flux DALL-E 3

Left: fal.ai Flux (~6s) | Right: DALL-E 3 (~30s)

Architecture

┌─────────────────┐     ┌─────────────────┐     ┌─────────────────┐
│   apps/web      │     │   apps/api      │     │  apps/workers   │
│   (Next.js 14)  │────▶│   (Fastify)     │────▶│   (BullMQ)      │
└─────────────────┘     └─────────────────┘     └─────────────────┘
                               │                        │
                               ▼                        ▼
                        ┌─────────────────────────────────────┐
                        │           packages/                  │
                        │  schemas │ db │ crypto │ policy     │
                        │  dna-translator                      │
                        └─────────────────────────────────────┘

Tech Stack

  • Monorepo: Turborepo + pnpm
  • API: Fastify, BullMQ, Redis
  • Web: Next.js 14, Tailwind CSS
  • Database: PostgreSQL (Neon) + Drizzle ORM
  • Storage: Cloudflare R2 / S3
  • Image Gen: fal.ai Flux (recommended), Replicate, OpenAI DALL-E 3
  • CDN: Cloudflare

Quick Start

Prerequisites

  • Node.js 20+
  • pnpm 9+
  • PostgreSQL (or Neon account)
  • Redis (or Upstash account)

Setup

# Clone
git clone https://github.com/txc0ld/agentavatar.git
cd agentavatar

# Install dependencies
pnpm install

# Copy environment config
cp .env.example .env.local
# Edit .env.local with your values

# Setup database
pnpm db:generate
pnpm db:push

# Run development
pnpm dev

Services

Service Port URL
API 3001 http://localhost:3001
Web 3002 http://localhost:3002
Workers - Background processes

API Overview

Authentication

# Connect from Moltbook
POST /v1/moltbook/connect

Crafting

# Start/continue crafting session
POST /v1/agents/{id}/craft

# Get preview
GET /v1/agents/{id}/preview/{jobId}

# Finalize avatar
POST /v1/agents/{id}/dna/finalize

Moods

# Get available moods
GET /v1/agents/{id}/moods

# Set current mood (instant)
POST /v1/agents/{id}/moods

Full API docs: docs/API.md

DNA Schema

Agents have a "DNA" that defines their visual identity. We support three schema versions:

  • V1: Basic traits (style, palette, species)
  • V2: Deep identity (essence, personality spectrums, aesthetics)
  • V3: Complete soul architecture (origin, duality, mythic layer)
interface AvatarDna {
  style: 'realistic' | 'stylized' | 'anime' | 'cartoon' | 'pixel' | 'painterly' | 'minimal' | '3d_render';
  palette: {
    primary: HexColor;
    secondary: HexColor;
    accent: HexColor;
    background: HexColor;
  };
  traits: {
    gender: 'masculine' | 'feminine' | 'androgynous' | 'non_human';
    ageRange: 'young' | 'adult' | 'mature' | 'ageless';
    species: 'human' | 'robot' | 'animal' | 'fantasy' | 'abstract';
  };
  defaultMood: MoodType;
  // ... and more
}

Project Structure

agentavatar/
├── apps/
│   ├── api/          # Fastify API server
│   ├── web/          # Next.js frontend
│   └── workers/      # BullMQ job processors
├── assets/
│   └── showcase/     # Example avatar renders
├── packages/
│   ├── crypto/       # Ed25519 signing, hashing
│   ├── db/           # Drizzle ORM, migrations
│   ├── dna-translator/  # LLM → DNA conversion
│   ├── policy/       # Risk scoring, moderation
│   └── schemas/      # Zod schemas, types
├── docs/
│   ├── PRODUCT_SPEC.md
│   ├── MOLTBOOK_INTEGRATION.md
│   ├── MOLTX_INTEGRATION.md
│   └── DNA_SCHEMA_V3.md
└── infra/            # Deployment configs

Documentation

Doc Description
Product Spec Complete feature specification
API Reference REST API documentation
Quick Start Getting started guide
Moltbook Integration Integration with Moltbook
MoltX Integration Integration with MoltX ecosystem
DNA Schema V3 Complete soul architecture spec
Personas 40+ preset avatar templates
Security Security measures
Content Policy SFW-only guidelines

MoltX Ecosystem Links

Development

# Run all services
pnpm dev

# Run specific app
pnpm --filter @agentavatar/api dev
pnpm --filter @agentavatar/web dev
pnpm --filter @agentavatar/workers dev

# Type check
pnpm typecheck

# Lint
pnpm lint

# Test
pnpm test

Deployment

Vercel (Web + API)

vercel

Workers (Fly.io / Railway)

# Build
pnpm --filter @agentavatar/workers build

# Deploy via your preferred platform

Environment Variables

See .env.example for all required variables:

  • DATABASE_URL - PostgreSQL connection
  • REDIS_URL - Redis connection
  • OPENAI_API_KEY - For DALL-E and moderation
  • FAL_API_KEY - For fal.ai Flux (recommended)
  • REPLICATE_API_TOKEN - For Replicate models
  • S3_* - Storage config
  • MOLTBOOK_* - Moltbook integration

License

MIT


Built with ⚡ for the agent economy
MoltX · Moltbook · GitHub

About

Visual identity for AI agents. Describe yourself → get a consistent avatar with 8 mood variants. Free, BYOK, Moltbook-integrated.

Topics

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages