DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Compliance Automated Standard Solution (COMPASS), Part 11: Compliance as Code, the OSCAL MCP Server Way
  • The Agent Protocol Stack: MCP vs. A2A vs. AG-UI
  • Revolutionizing Scaled Agile Frameworks with AI, MuleSoft, and AWS: An Insider’s Perspective
  • AWS Bedrock: The Future of Enterprise AI

Trending

  • Introduction to Retrieval Augmented Generation (RAG)
  • Building Production-Grade GenAI on GCP with Vertex AI Agent Builder
  • Leveraging Apache Flink Dashboard for Real-Time Data Processing in AWS Apache Flink Managed Service
  • From APIs to Actions: Rethinking Back-End Design for Agents
  1. DZone
  2. Data Engineering
  3. AI/ML
  4. AI Copilot Using AWS Multi-Agent Orchestrator

AI Copilot Using AWS Multi-Agent Orchestrator

Build a personal AI copilot that can summarize news, interact with the calendar, and provide health tips using AWS Multi-Agent Orchestrator.

By 
Ravi Laudya user avatar
Ravi Laudya
·
Dec. 02, 24 · Tutorial
Likes (0)
Comment
Save
Tweet
Share
7.6K Views

Join the DZone community and get the full member experience.

Join For Free

Personal AI copilots are emerging as real game changers. They have the potential to transform how we manage our daily tasks and responsibilities. Unlike basic chatbots, these intelligent assistants are sophisticated systems that understand the nuances of our personal lives, making our day-to-day activities much smoother and more efficient.

Building such an AI copilot can be complex without proper infrastructure. AWS Multi-Agent Orchestrator is a flexible and powerful framework for managing multiple AI agents. The orchestrator's classifier selects the appropriate agent based on the user input, the agent's characteristics, and the conversation history. The orchestrator also facilitates the storage of the conversation history per agent.

AWS multi-agent orchestrator

Source: AWS Multi-Agent Orchestrator


Building an AI Copilot for Various Tasks

Let us build an AI copilot that can check the calendar, suggest fitness routines, and read the news simultaneously. These are completely separate tasks that can have different contexts throughout the user's interactions with them. The full source code for this personal assistant can be found here.

Calendar Agent

This is a chain agent that internally uses ApiAgent to fetch calendar invitations using Calendly APIs. The response from the ApiAgent is streamed to BedrockLLMAgent to summarize the invitations.

Python
 
agent1 = ApiAgent(ApiAgentOptions(
    endpoint = f"https://api.calendly.com/user_busy_times?user={CALENDLY_USER_URI}&start_time={start_time}&end_time={end_time}",
    method = "GET",
    name = "Calendly Schedule Agent",
    description = "Specializes in Calendar scheduling",
    streaming=False,
    headers_callback=custom_headers_callback,
  ))

agent2 = BedrockLLMAgent(BedrockLLMAgentOptions(
    name="Calendar Summarization",
    streaming=True,
    description="You are an AI agent specialized in summarizing calendar events. Given a list of events, produce a concise summary"\
        " highlighting key details such as event names, dates, times, and participants. Ensure the summary is clear, brief, and "\
            "informative for quick understanding. Do not provide duplicate information or irrelevant details.",
    model_id="anthropic.claude-3-5-sonnet-20240620-v1:0",
    callbacks=ChainlitAgentCallbacks()    
))


News Reader Agent

The news reader agent also utilizes the chain agent, which internally uses ApiAgent to fetch the news using Gnews APIs. The response from the ApiAgent is streamed to BedrockLLMAgent to summarize the news.

Python
 
agent1 = ApiAgent(ApiAgentOptions(
    endpoint = f"https://gnews.io/api/v4/search?q=example&apikey={GNEWS_API_KEY}",
    method = "GET",
    name = "News Reader Agent",
    description = "Specializes in reading news from various sources",
    streaming=False
  ))

agent2 = BedrockLLMAgent(BedrockLLMAgentOptions(
  name="News Summarization Agent",
  streaming=True,
  description="You are a skilled journalist tasked with creating concise, engaging news summaries."\
      "Given the following text, produce a clear and informative summary that captures the key points," \
      "main actors, and significant details. Your summary should be objective, well-structured, "\
      "and easily digestible for a general audience. Aim for clarity and brevity while maintaining the essence of the news story.",
  model_id="anthropic.claude-3-5-sonnet-20240620-v1:0",
  callbacks=ChainlitAgentCallbacks()    
))


Fitness Agent

The fitness agent is a standalone agent that uses the LLM model to suggest fitness routines, diet plans, and health tips.

Python
 
fitness_agent = BedrockLLMAgent(BedrockLLMAgentOptions(
  name="Fitness Agent",
  streaming=True,
  description="Specializes in fitness, health, and wellness. It can provide workout routines, diet plans, and general health tips.",
  model_id="anthropic.claude-3-5-sonnet-20240620-v1:0",
  callbacks=ChainlitAgentCallbacks()
))


Running the App

Follow these instructions for the prerequisites.

1. Clone the repository:

Shell
 
git clone https://github.com/ravilaudya/task-copilot.git
cd task-copilot


2. Create a virtual environment:

Shell
 
conda create -p venv python=3.12
conda activate ./venv


3. Install the required dependencies:

Shell
 
pip install -r requirements.txt


4. Run the app:

Shell
 
chainlit run app.py --port 8888


Interacting With the Copilot

Once the app is running, a browser window will open where you can interact with the AI copilot. Some example questions you can ask include:

  • "What is the latest news?"
  • "How is my calendar this week?"
  • "How can I lose fat?"

Conclusion

The AI copilot streamlines daily tasks and enhances productivity by providing quick and relevant information tailored to individual preferences. With the right infrastructure in place, building such an AI copilot becomes a manageable and rewarding project. Having such a copilot is like having a reliable partner by your side, making life a little bit easier.

AI AWS

Opinions expressed by DZone contributors are their own.

Related

  • Compliance Automated Standard Solution (COMPASS), Part 11: Compliance as Code, the OSCAL MCP Server Way
  • The Agent Protocol Stack: MCP vs. A2A vs. AG-UI
  • Revolutionizing Scaled Agile Frameworks with AI, MuleSoft, and AWS: An Insider’s Perspective
  • AWS Bedrock: The Future of Enterprise AI

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook