Refining

Step 1: Monitor Agent Performance

Create a monitoring script to track your agent's activity:

# monitor_agent.py
from database import XynaeDatabase
import os
from dotenv import load_dotenv
from datetime import datetime, timedelta

load_dotenv()

db = XynaeDatabase(
    mongodb_uri=os.getenv("MONGODB_URI"),
    database_name="defi_sage"
)

if db.is_connected():
    print("πŸ“Š DeFi Sage Performance Dashboard\n")
    print("=" * 50)
    
    # Get statistics
    stats = db.get_stats()
    print(f"\nπŸ“ˆ Overall Statistics:")
    print(f"   Total Tweets: {stats['tweets_count']}")
    print(f"   Total Replies: {stats['replies_count']}")
    print(f"   Total Mentions: {stats['mentions_count']}")
    
    # Recent activity
    print(f"\nπŸ• Recent Activity (Last 24 hours):")
    recent_tweets = db.get_recent_tweets(limit=10)
    print(f"   Recent Tweets: {len(recent_tweets)}")
    
    recent_replies = db.get_recent_replies(limit=10)
    print(f"   Recent Replies: {len(recent_replies)}")
    
    # Show last 5 tweets
    print(f"\nπŸ“ Last 5 Tweets:")
    for i, tweet in enumerate(recent_tweets[:5], 1):
        timestamp = tweet.get('timestamp', 'Unknown')
        content = tweet.get('tweet_content', '')[:60] + "..."
        print(f"   {i}. [{timestamp}] {content}")
    
    print("\n" + "=" * 50)
else:
    print("❌ Cannot connect to database")

Run monitoring:

Step 2: Analyze and Refine Content

Review the generated content and refine your personality prompt:

Questions to ask:

  • Is the personality consistent?

  • Is the content valuable and engaging?

  • Are tweets too long or too short?

  • Is the posting frequency appropriate?

  • Are replies helpful and on-brand?

Step 3: Adjust Based on Feedback

Update your personality prompt based on analysis:

Step 4: A/B Test Different Approaches

Test different content strategies:


Last updated