File size: 2,459 Bytes
368277b
 
da3a984
368277b
 
 
 
 
 
 
 
 
 
 
 
 
 
da3a984
 
 
368277b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9685fdc
368277b
 
 
b58981e
 
 
368277b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# src/agents/manager_agent.py

from smolagents import CodeAgent, InferenceClientModel
from dotenv import load_dotenv
import os

# Import tools directly - simpler approach following smolagents best practices
from src.agents.web_agents import web_agent
from src.agents.gmail_agent import gmail_agent
from src.agents.bookmarks_agent import bookmarks_agent
from src.agents.categoriser_agent import categoriser_agent

load_dotenv()

# Create a single focused agent instead of complex multi-agent system
# This follows the smolagents principle: "The best agentic systems are the simplest"
manager_agent = CodeAgent(
    model=InferenceClientModel(
        provider="nebius",
        token=os.environ["HF_TOKEN"],
    ),
    managed_agents=[web_agent, gmail_agent, bookmarks_agent, categoriser_agent],
    name="digital_assistant",
    tools=[],
    description=(
        "I'm a comprehensive digital assistant that helps you with multiple tasks:\n\n"
        "📧 **Email Management:**\n"
        "• Get recent emails from trusted senders (habib.adoum01@gmail.com and news@alphasignal.ai)\n"
        "• Search emails by keywords\n"
        "• Read full email content\n\n"
        "🔍 **Web Search:**\n"
        "• Perform web searches to find current information\n"
        "• Research topics and gather up-to-date data\n\n"
        "🔖 **Chrome Bookmarks Management:**\n"
        "• Search and filter AI resources bookmarks\n"
        "• Get bookmark statistics and information\n"
        "• Filter bookmarks by domain\n"
        "• Cache and manage Chrome bookmarks data\n\n"
        "🏷️ **AI News Categorization:**\n"
        "• Categorize AI bookmarks into 10 predefined categories\n"
        "• Get categorization statistics and insights\n"
        "• Search bookmarks by category\n"
        "• Manually recategorize bookmarks when needed\n\n"
        "I combine these capabilities to help you with research, information gathering, and digital organization tasks."
    ),
    max_steps=10,  # Reduced to prevent token overflow
    additional_authorized_imports=["json"],
    # Add planning to help with complex queries
    planning_interval=3,  # Plan every 3 steps to maintain focus
    # Reduce verbosity - disable streaming outputs and minimize console display
    stream_outputs=False,  # Disable live streaming of thoughts to terminal
    max_print_outputs_length=500,  # Limit output length to reduce terminal noise
)