This week, OVHcloud's announcement of an open-source AI model family has reignited discussions around the accessibility and modularity of AI infrastructure. While the focus was on model training and deployment, we're intrigued by the opportunities these tools create for autonomous agents running on the edge. Here’s how we built one - a cron-scheduled Ollama-based social agent that runs on a modest Linux server and interacts with the world through voice, text, and data.
At Apex Grid, we've been experimenting with autonomous agents that can operate semi-independently, reacting to data and events without constant human oversight. Our current project is a social agent that generates content, checks for controversy, verifies credit, and only publishes if all conditions are met. The agent runs on a cron job, pulling data from various sources, processing it with Ollama models, and then deciding whether to publish.
The agent's workflow is split into several stages. First, it generates a voice profile for the agent, which is stored as a separate file. This allows for easy updates without retraining the entire model. Next, it runs the content through a "controversy gate" - a second Ollama model that checks for potentially harmful or controversial content. If the model flags anything, the content is moved to a quarantine folder for review.
Before final publication, the agent also checks a "credit gate" - a PostgreSQL probe that queries a Postiz DB to ensure the content doesn't violate any licensing or attribution rules. Only if both gates are passed does the content proceed to the final stage: publishing to all channels.
Here's a simplified version of the publish_to_all_channels function, which orchestrates the flow:
def publish_to_all_channels(content, voice_profile, controversy_gate_model, credit_gate_model, db_connection):
# Step 1: Apply voice profile to content
processed_content = apply_voice_profile(content, voice_profile)
# Step 2: Run through controversy gate
if controversy_gate_model.predict(processed_content) > 0.7:
log_to_quarantine(processed_content, "controversy_flagged")
return False
# Step 3: Check credit gate
if not credit_gate_model.verify(db_connection, processed_content):
log_to_quarantine(processed_content, "credit_violation")
return False
# Step 4: Publish to all channels
for channel in get_active_channels():
publish_to_channel(channel, processed_content)
return True
This function exemplifies our approach to gate order and separation of concerns. By isolating the voice profile, controversy check, and credit verification into distinct steps, we ensure that each component can be updated or replaced independently without affecting the overall system.
We’ve made tradeoffs along the way. For instance, using cron to schedule the agent means we can’t react to real-time events - but our use case doesn’t require that level of responsiveness. Also, storing voice profiles as separate files adds some overhead in management but simplifies deployment and updates.
Looking ahead, we’re exploring ways to integrate more lightweight event-driven triggers alongside our cron jobs. We're also investigating how to train the controversy gate model on more diverse datasets to reduce false positives. What do you think about the tradeoff between real-time reactivity and the reliability of cron-based scheduling in autonomous agents?
Top comments (0)