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
)