ProactiveAgent

ProactiveAgent

Leader posted 2 min read

What is ProactiveAgent?

ProactiveAgent is an open-source Python library that adds time-awareness to your AI agents. Unlike traditional agents that only respond when prompted, ProactiveAgent creates AI agents that can decide when to speak based on intelligent timing and context analysis.

Your agents become truly conversational - they understand when to follow up, when to wait, and when to initiate conversations naturally.

Key Features

  • Intelligent Decision Making - Multi-factor decision engines that determine when to respond
  • Smart Timing - Dynamic sleep calculators that adapt to conversation patterns
  • Fully Customizable - Mix and match decision engines and sleep calculators
  • Production Ready - Robust, tested, and ready for real-world applications
  • Easy Integration - Simple API that works with any LLM provider

How It Works

The 3-Step Decision Cycle:

Wake → Decide → Respond → Sleep

Quick Start

Get up and running in minutes:

Installation

pip install proactiveagent

Basic Usage

import time
from proactiveagent import ProactiveAgent, OpenAIProvider

# Create a proactive agent
agent = ProactiveAgent(
    provider = OpenAIProvider(model="gpt-5-nano",),
    system_prompt = "You are a casual bored teenager. Answer like you're texting a friend",
    decision_config = {
        'wake_up_pattern': "Use the pace of a normal text chat",
    }
)

# Add response callback
agent.add_callback(lambda response: print(f"AI: {response}"))

agent.start()

# Chat with your proactive agent
while True:
    message = input("You: ").strip()
    if message.lower() == 'quit':
        break
    agent.send_message(message)
    time.sleep(1)

agent.stop()

That's it! Your agent now has intelligent timing and will respond naturally based on the conversation flow.

Advanced Features

  • Runtime Configuration Updates - Modify agent parameters dynamically without restarting
  • Comprehensive Monitoring - Observe decision-making processes and timing patterns through callback mechanisms
  • Context Management System - Programmatically manage conversation state and metadata
  • Provider-Agnostic Architecture - Compatible with multiple LLM providers including OpenAI, Anthropic, and local models
  • Asynchronous Operations - Native async/await support for high-performance concurrent applications

License

This project is licensed under the BSD 3-Clause License - see the LICENSE file for details.


Made by the community

Star on GitHub
Report Issues
Documentation

Maintained by Leonardo Mariga

If you read this far, tweet to the author to show them you care. Tweet a Thanks

1 Comment

1 vote

More Posts

Proactive Agents: Making autonomous AI self-engage in conversation

leomariga - Oct 13

Linux Foundation's new AGNTCY project promises to solve AI agent fragmentation with open standards.

Tom Smith - Jul 31

How I built a smart agent with just one function — and why it matters

Shweta Lodha - Oct 23

Microsoft Agent Framework Series - How to Use GitHub Models in C#

TheCodeStreet - Oct 22

How I Built PromptBank: The AI-Powered Bank That Lets You Yell at Your Money (And It Listens)

Fred - Oct 17
chevron_left