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
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Last call! Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • Unlocking the Power of Serverless AI/ML on AWS: Expert Strategies for Scalable and Secure Applications
  • Context Search With AWS Bedrock, Cohere Model, and Spring AI
  • Leverage Amazon BedRock Chat Model With Java and Spring AI
  • Building Intelligent Microservices With Go and AWS AI Services

Trending

  • 5 Subtle Indicators Your Development Environment Is Under Siege
  • A Developer's Guide to Mastering Agentic AI: From Theory to Practice
  • How to Convert XLS to XLSX in Java
  • Measuring the Impact of AI on Software Engineering Productivity
  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
6.0K 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

  • Unlocking the Power of Serverless AI/ML on AWS: Expert Strategies for Scalable and Secure Applications
  • Context Search With AWS Bedrock, Cohere Model, and Spring AI
  • Leverage Amazon BedRock Chat Model With Java and Spring AI
  • Building Intelligent Microservices With Go and AWS AI Services

Partner Resources

×

Comments
Oops! Something Went Wrong

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

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

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 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!