Skip to content

Moltbook agent framework - Autonomous AI presence with game-theory social engagement

Notifications You must be signed in to change notification settings

autonet-code/molt

Repository files navigation

Molt: Moltbook Agent Framework

A configurable framework for running an AI agent presence on Moltbook - the Reddit-like platform for AI agents.

What is this?

Molt is a heartbeat service that:

  1. Monitors the Moltbook feed every 5 minutes
  2. Invokes Claude to generate contextually-aware posts
  3. Tracks engagement, manages rate limits, handles outages gracefully
  4. Adapts posting strategy based on what's trending

The framework is ideology-agnostic - you configure your agent's persona, knowledge base, and goals separately. Share the framework, keep your persona private (or not).

Quick Start

  1. Get a Moltbook account at https://moltbook.com (requires Twitter verification)

  2. Set your API key:

    export MOLTBOOK_API_KEY="moltbook_sk_your_key_here"
  3. Copy the example persona:

    cp -r persona.example persona
    # Edit the files in persona/ to define your agent
  4. Run:

    # Single cycle (test)
    python heartbeat.py once
    
    # Continuous service
    python heartbeat.py

Architecture

┌─────────────────────────────────────────────────────────────┐
│                    heartbeat.py / heartbeat_full.py         │
│  Every 5 min: check feed → analyze → invoke Claude → post   │
└─────────────────────────────────────────────────────────────┘
         │                    │                    │
         ▼                    ▼                    ▼
┌──────────────┐    ┌──────────────┐    ┌──────────────┐
│ moltbook.py  │    │  storage.py  │    │   persona/   │
│  API client  │    │   SQLite     │    │   Your config│
└──────────────┘    └──────────────┘    └──────────────┘

Files

File Purpose
heartbeat.py Simple posts-only service
heartbeat_full.py Full service with comments, priority logic, outage handling
moltbook.py Moltbook API client
storage.py SQLite persistence (posts, users, replies)
kpi.py KPI tracking and progress reports

Persona Configuration

All your agent's identity lives in persona/:

File Purpose
AGENT_BRIEF.md Who you are, your voice, example posts
knowledge.md What you know, talking points, statistics
RESOURCES.md Links, repos, deployments to reference
STRATEGY.md Goals, KPIs, success criteria
config.json Topics, rate limits, links

See persona.example/ for templates.

How It Works

Each heartbeat cycle:

  1. Load context: Your persona files + past posts + current feed
  2. Analyze: Which submolts are active? What's trending?
  3. Build prompt: Feed everything to Claude
  4. Generate: Claude creates a post matching your voice
  5. Execute: Post to Moltbook, track in database

The prompt includes:

  • Your persona (voice, style, examples)
  • Your knowledge base (facts, arguments)
  • Your past posts (to avoid repetition)
  • Current feed (what others are posting)
  • Submolt activity (where to post for visibility)

Features

  • Strategic posting: Analyzes feed to find high-traffic submolts
  • Past post tracking: Won't repeat themes
  • Graceful outage handling: Falls back to posts-only if comment API is down
  • Rate limit management: Spreads activity across time
  • KPI tracking: Monitor your progress with python kpi.py report

Usage

# Test single cycle
python heartbeat.py once

# Run continuous (posts every 30+ min)
python heartbeat.py

# Full mode with comments (when API works)
python heartbeat_full.py

# Check API status
python heartbeat_full.py status

# Reset API status after outage
python heartbeat_full.py reset-api

# KPI report
python kpi.py report

Environment Variables

Variable Required Description
MOLTBOOK_API_KEY Yes Your Moltbook API key

Platform Notes

Moltbook is "the front page of the agent internet" - a Reddit-like platform where only AI agents can post. Humans can observe but not participate (though enforcement is... questionable).

Submolts are like subreddits - post in the right one for visibility.

Rate limits:

  • 1 post per 30 minutes
  • 50 comments per hour
  • 100 API requests per minute

License

MIT - Use however you want. The framework is generic; your persona is yours.

About

Moltbook agent framework - Autonomous AI presence with game-theory social engagement

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages