FEATURE REQUEST: Implement a General-Purpose GitHub Query Tool
Is your feature request related to a problem?
- [x] Yes, it is related to a problem
Describe the feature you'd like
🌟 Feature Description
This feature introduces a new, advanced tool for the DevRel Agent: a General-Purpose GitHub Query Tool. Instead of using pre-defined functions, this tool understands a user's natural language question, generates the Python code needed to query the GitHub API, executes it, and returns the answer.
This allows it to handle a wide variety of questions like:
- "What repositories does sm0kxy contribute to?"
- "How many open issues are in the Devr.AI repository?"
🔍 Problem Statement
Creating a separate, hard-coded tool for every possible GitHub query is not scalable. A more flexible, intelligent solution is needed to handle a wide range of user questions without bloating the agent's toolkit.
🎯 Expected Outcome
The result is a single, versatile tool that acts as a natural language interface to the GitHub API. It will:
- Increase the agent's versatility to answer ad-hoc questions.
- Reduce the need to develop numerous, narrowly-focused tools.
- Empower users by letting them query GitHub using plain English.
📷 Screenshots and Design Ideas
The tool functions by translating a user's question into executable Python code.
- Trigger: The agent receives a query like, "How many repos does 'AOSSIE-Org' have?"
- Code Generation: The tool uses an LLM to translate the query into a Python script that calls the GitHub API.
- Secure Execution: The generated script is run in a secure, isolated sandbox environment to prevent any risk to the host system.
- Return Result: The output from the script's execution is captured.
- Final Answer: The agent takes the result and formats it into a human-readable response.
📋 Additional Context
- Security: The use of a sandboxed environment is a critical, built-in part of the tool to ensure all code execution is safe.
- Scope: Initially, the tool should be limited to read-only (
GET) operations for maximum safety.
Record
- [x] I agree to follow this project's Code of Conduct
- [x] I want to work on implementing this feature
Hi @smokeyScraper can I work on this issue?
Yep, you could start working on this @DhruvK278 .
It's a bit of a difficult issue ig, I too will be helping you out side by side on this. What I'm preferring is that instead of using predefined codes and workflow, the agent itself codes out what the user needs and runs in a Dockerized container, maybe? like the actual code running agent. So, yeah, this is entirely a subagent with the capability of writing code associated with GitHub on its own and running it. Model's internal knowledge will be decent enough for writing this code, but might fail as very much uncertain, so I'm preferring the agent to think in a way to perform a few concurrent web searches in order to get the latest codes from the web and align them as per the user's query.
What do you think of this @chandansgowda ? We can initially have a workflow-based system too, with only determining out what is needed and already having code for how it is needed, btw, but yeah, this is something more of a true subagent.
PS: realized this transitions like procedural vs declarative xD
Hi @smokeyScraper , I did some research and came a with an idea So, the user parse a query from dc. Web scraping - Agent will use google search api for scraping. Code generation - Using the search results as context, the agent (powered by the Gemini API and Langchain) will generate a Python script to perform the requested action. Sandboxed execution - the generated script will be executed inside a Judge0 container (this script will have access to github_token to make api calls) Return result- the output from the script will be captured and sent back to the user on dc as the final answer.
current workflow- User(query) -> Web scraping -> Code generation -> sandbox execution -> result on dc
this flow will also dynamically generate and execute python scripts to answer user queries as you mentioned above.
Please tell me what can i improve in this workflow so I could start to code it.
yeah, we want to align in this way only. Just for scraping/search we have DuckDuckGo as well Tavily, have you researched a bit on what we need for rest of components?
yes for now, sandbox env - piston api (not using judge0 cuz i got to know piston is better) code generation - gemini api web scrapping - as u mentioned duckduckgo and tavily orchestration - langchain for now i have researched on these components will do some more research and get back to you.
@smokeyScraper do we really need custom implementation and code generation here. we can use github's mcp server (its okay even if we provide the features that their mcp provides for now).. they'll add more tools anyways.
yes, using github's MCP server seems a better option. I'll go through its docs and update on the issue itself.
@smokeyScraper , Hey can you please assign me the issue , If it is still open
closed; implemented in #131