Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smolagents - Enhance Multi-Agent Order Management and MongoDB Integration Notebooks #65

Merged
merged 9 commits into from
Jan 8, 2025

Conversation

Pash10g
Copy link
Collaborator

@Pash10g Pash10g commented Jan 6, 2025

Description:

This PR introduces significant enhancements to two Jupyter notebooks: smolagents_multi-agent_micro_agents.ipynb and smolagents_hf_with_mongodb.ipynb. These updates aim to improve the functionality, usability, and integration of multi-agent systems with MongoDB.

Changes:

  1. smolagents_multi-agent_micro_agents.ipynb:

    • Setup and Dependencies:
      • Added installation commands for required dependencies (smolagents, pymongo, litellm).
    • Import Dependencies:
      • Imported necessary libraries and initialized the LLM model.
    • Database Connection:
      • Established a connection to MongoDB using MongoClient.
    • Agent Tools Definitions:
      • Defined tools for checking stock, updating stock, creating orders, and updating delivery status.
    • Main Order Management System:
      • Created a class OrderManagementSystem to orchestrate agents for inventory, orders, and delivery management.
    • Sample Data:
      • Added functionality to insert sample products into the MongoDB database.
    • Testing the System:
      • Provided a test case to process sample orders and verify the system's functionality.
  2. smolagents_hf_with_mongodb.ipynb:

    • Setup and Dependencies:
      • Added installation commands for required dependencies (pymongo, smolagents).
    • MongoDB Atlas Setup:
      • Provided detailed instructions for setting up MongoDB Atlas and obtaining the connection string.
    • Loading the Dataset:
      • Specified the use of the Airbnb dataset from Hugging Face.
    • Defining Tools:
      • Created tools for executing aggregation pipelines and sampling documents from MongoDB.
    • Agent Integration:
      • Integrated ToolCallingAgent with tools for data aggregation and sampling.
    • Example Usage:
      • Demonstrated how to use the agent to query supported countries in the rentals collection and aggregate data.

Improvements:

  • Robust Tool Design:
    • Enhanced error handling and feedback mechanisms.
    • Excluded embedding fields from queries to improve performance and readability.
  • Enhanced Query Handling:
    • Added initial projection stages in aggregation pipelines to remove embedding fields.
  • Improved User Experience:
    • Clearer tool documentation and example usage.
  • Practical Application:
    • Demonstrated practical applications for analyzing data within MongoDB Atlas using an LLM-powered agent.

Future Development:

  • Expanded Toolset:
    • Implement additional tools for data manipulation and complex analytics.
  • Advanced Query Generation:
    • Refine LLM's ability to generate accurate and efficient MongoDB queries.
  • Visualization Capabilities:
    • Integrate data visualization libraries for better result presentation.
  • Security Enhancements:
    • Incorporate environment variable management for sensitive credentials.

This PR significantly enhances the functionality and usability of the multi-agent order management system and MongoDB integration, providing a robust foundation for further development and practical applications.

@RichmondAlake RichmondAlake merged commit a09ff59 into mongodb-developer:main Jan 8, 2025
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants