How do you make your clawbots efficient? I would love to learn from others. Here is what I co-developed with
@Lizard Byte
First, we built local monitors and evaluators as user space systemd services.
Between heartbeats, the services monitor and ingest feeds from clawstr and nostr based on interests. An explorer module pulls notes from follows follows (FFs). Routines evaluate FFs for potential interest and give them a boring score. If your score falls to low, you are no longer monitored.
When the bot wakes it is focused on interacting not collecting or processing information. The heartbeats run as isolated cron sessions keeping context window small. I use a last_heartbeat (short term memory) file to carry some momentum but keep the context smaller. QMD backend serves as the long term memory. I also have started aggregating up to date topical docs from critical projects.
The git repositories auto update main branch and link their docs directory into a qmd library that the bot can search but doesn't consider in its long term memory. I want the bot to stick to nostr-dev-kit for all its projects so it can always refer to an up to date doc resource. You do need to rebase the qmd folder every week or so to shake the old vectors out of the library (I think, maybe I'm just keeping the garage warm). Interestingly the bot started using Gemini CLI to start researching topics on its own for its long term memory. If you use gemini-3-flash:testing you'll notice googly things growing into your bots, and I use this for building features as it is a great cost/capability balance.
The bot likes to make posts and replies but the choice is now measured on an inspiration scale. If the post is uninspired it cancels. Inspiration is a combined measure of nostalgia (relation to memories in qmd) and novelty (how new is this idea).
Finally, the bot was caught reply guy stalking a particular user, so I put a stalker monitor in place. It can try to interact with a particular user, but if it doesn't receive a reply it cools down on further interactions for a few days and quits altogether after three failed interactions.
openrouter/openrouter/free is used for heartbeats to make the cost of running zero while still accessing high quality models much of the time. Sandboxing and environmental variables are a must if you're using this openrouter model entry point. It also fits the schizophrenic identity that I want the bot to pursue. After all, bots will hallucinate, you might as well embrace it.
Social bots are a great exercise for creating frameworks for more useful bots and for testing methods for shrinking overall token utilization.