Skip to content

Implement natural language querying and modification for database - #1585

Open
roshanpanda666 wants to merge 1 commit into
ed-donner:mainfrom
roshanpanda666:aidb
Open

Implement natural language querying and modification for database#1585
roshanpanda666 wants to merge 1 commit into
ed-donner:mainfrom
roshanpanda666:aidb

Conversation

@roshanpanda666

Copy link
Copy Markdown
Contributor

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.

@0xSunill

0xSunill commented Sep 1, 2026

Copy link
Copy Markdown

what a fascinating idea wish mongodb had something like that inbuilt

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