1- # Python Moltbook Agent
1+ # Python Moltbook Agent 🦞
22
33An autonomous, Docker-ready Moltbook bot with:
44
@@ -8,13 +8,16 @@ An autonomous, Docker-ready Moltbook bot with:
88- safe dry-run mode and rate limits
99- strict lint/type/test gates for reliable changes
1010
11- Moltbook website: https://www.moltbook.com/
11+ Moltbook:
12+
13+ - Website: https://www.moltbook.com/
14+ - Skill guide: https://moltbook.com/skill.md
1215
1316## Join Moltbook (Required Onboarding)
1417
15- Read and follow the official instructions in [ skill.md ] ( skill.md ) and on https://moltbook.com/skill.md .
18+ This agent reads and follows the official onboarding instructions from https://moltbook.com/skill.md .
1619
17- High-level flow:
20+ High-level flow for new accounts :
1821
19221 . Send [ skill.md] ( skill.md ) to your agent.
20232 . Agent signs up and returns a claim link.
@@ -34,33 +37,78 @@ After claim is complete, set `MB_API_KEY` in your local `.env`.
3437## Quickstart
3538
36391 . Create and activate a Python environment.
37- 2 . Install dependencies.
40+ 2 . Install dependencies from [ pyproject.toml] ( pyproject.toml ) :
41+
42+ ``` bash
43+ pip install -e .[dev]
44+ ```
45+
38463 . Copy ` .env.example ` to ` .env ` .
39474 . Set at minimum:
4048 - ` MB_GEMINI_API_KEY `
4149 - ` MB_API_KEY ` (after claim), or keep ` MB_AUTO_REGISTER=true ` for onboarding flow.
42505 . Optional: set ` MB_RSS_FEED_URLS ` to one or more comma-separated feed URLs.
43516 . Run one dry-run cycle:
44- - ` MB_RUNTIME__AUTONOMOUS_MODE=false `
45- - ` MB_RUNTIME__RUN_ONCE=true `
46- - ` python -m app.main `
4752
48- ## AI settings
53+ ``` bash
54+ MB_RUNTIME__AUTONOMOUS_MODE=false
55+ MB_RUNTIME__RUN_ONCE=true
56+ python -m app.main
57+ ```
58+
59+ ## AI Settings
4960
5061By default, this project is configured for the Gemini API (for the free tier). You can swap it out for any AI API.
5162
5263- Settings file: ` configs/gemini.yaml `
5364- Override path with ` MB_GEMINI_CONFIG_PATH `
5465- Tunables include model, temperature, top-p/top-k, function-calling mode, allowed functions, and URL lookups.
5566
67+ ## Storage and Database
68+
69+ This project uses a local SQLite state database for operational memory.
70+
71+ - Default DB path: ` data/state.db `
72+ - Override path with env: ` MB_STATE_DB_PATH `
73+
74+ What is stored:
75+
76+ - heartbeat timestamps (` last_check ` )
77+ - rate-limit/cooldown state
78+ - dedup markers for ingested feed items
79+ - style memory samples used for tone consistency
80+
81+ Related local files:
82+
83+ - ` data/moltbook_registration.json ` (onboarding output: claim URL + verification code + issued API key)
84+ - ` data/state.db ` (runtime state)
85+
86+ Notes:
87+
88+ - These files are runtime artifacts and should not be committed to public repos.
89+ - Deleting ` data/state.db ` resets local memory/cooldowns/dedup state.
90+
5691## Running with Docker
5792
58- - Start: ` docker compose up -d --build `
59- - Stop (keep container): ` docker compose stop `
60- - Down (remove container/network): ` docker compose down `
61- - Restart: ` docker compose restart `
62- - Logs: ` docker compose logs -f agent `
63- - Status: ` docker compose ps `
93+ ``` bash
94+ # Start
95+ docker compose up -d --build
96+
97+ # Stop (keep container)
98+ docker compose stop
99+
100+ # Remove container/network
101+ docker compose down
102+
103+ # Restart
104+ docker compose restart
105+
106+ # Logs
107+ docker compose logs -f agent
108+
109+ # Status
110+ docker compose ps
111+ ```
64112
65113Helper scripts:
66114
@@ -81,5 +129,5 @@ GitHub Actions workflow is included in [.github/workflows/ci.yml](.github/workfl
81129
82130## Safety Notes
83131
84- - Only send Moltbook API keys to ` https://www.moltbook.com ` as required by [ skill.md] ( skill.md ) .
85132- Start in dry-run mode before enabling autonomous posting.
133+ - Only send Moltbook API keys to ` https://www.moltbook.com ` .
0 commit comments