Implement natural language querying and modification for database - #1585
Open
roshanpanda666 wants to merge 1 commit into
Open
Implement natural language querying and modification for database#1585roshanpanda666 wants to merge 1 commit into
roshanpanda666 wants to merge 1 commit into
Conversation
…d make changes in it
|
what a fascinating idea wish mongodb had something like that inbuilt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Title: Community Contribution: Agentic Natural Language Database Query (MongoDB)
Description:
What does this PR do?
This PR introduces a new community contribution: TalkToDB, an interactive notebook that demonstrates how to transition from a naive code-generation script to a fully autonomous, secure Agentic workflow for querying databases in natural language.
Key Features & Learnings:
MongoDB Integration: Demonstrates how to securely connect an agent to a MongoDB cluster.
Security First: Highlights the severe security risks of using exec() on LLM-generated code and provides a safer alternative.
Agentic Tool Calling: Implements a strict, tool-based architecture utilizing the Principle of Least Privilege. The agent is given specific Python functions for CRUD operations.
The ReAct Loop: Showcases the agent's ability to reason through multi-step problems (e.g., retrieving an array of ObjectIDs and autonomously deciding to make a secondary tool call to convert those IDs into human-readable names).
Files Added:
2_openai/community_contributions/ai_based_database_query/talktodb.ipynb
How to test:
Provide a TOURDB_URI and GROQ_API_KEY in the .env file.
Run through the notebook cells.
Observe the agent dynamically translating natural language (e.g., "what are the names of sunil's followers?") into multi-step tool calls.