Journey to Agentic AI, Part 3: External Services and Git Powers
Journey to Agentic AI, Starting from First Principles
By JV Roig
Quick Recap — Parts 1 and 2
In Part 1 (From Next-Token to Tool-Use: How to Give LLMs the Ability to Use Tools), we learned the fundamentals of enabling LLMs to interact with tools.
Then, in Part 2 (Giving Control of Our Computer to an LLM), we took this further by granting an LLM extensive access to our computer, effectively allowing it control over our local filesystem.
However, an LLM’s potential is not confined to the local environment. In this article, we’ll explore how to connect LLMs to external services, starting with GitHub, by equipping them with Git capabilities.
How Can LLMs Connect to External Services?
At their core, LLMs function as sophisticated next-token generators, which raises the question: Can they actually interact with external services?
The answer hinges on what we discussed in Part 1—LLMs, on their own, cannot execute actions, but they can be wrapped with programs to enable them to interact with tools and services.
LLMs can’t directly use tools, but we can wrap programs around them to facilitate tool use.
By leveraging this principle, we can build interfaces that allow LLMs to connect with external services like GitHub, enabling them to automate and manage repositories effectively.
Setting Up Git Access for an LLM
To enable an LLM to interact with GitHub, we need to provide it with proper authorization and a structured way to execute Git commands. Here’s how we can achieve this:
- Generate a Personal Access Token (PAT): This allows the LLM to authenticate with GitHub securely.
- Use Shell Commands: The LLM can be wrapped in a program that issues Git commands under controlled conditions.
- Define Repository Permissions: Restrict what actions the LLM can take, such as limiting repository modifications or enabling read-only access.
Potential Use Cases for Git-Powered LLMs
Equipping an LLM with Git capabilities unlocks a variety of automation tasks, including:
- Automated Code Reviews: An LLM can analyze code changes, suggest optimizations, and check for best practices.
- Issue Tracking and Management: The model can assist in triaging issues, assigning tasks, and summarizing bug reports.
- Pull Request Generation: Changes can be proposed programmatically, reducing manual intervention in minor updates.
- Continuous Integration Assistance: The LLM can monitor build pipelines and suggest fixes for failing workflows.
Challenges and Considerations
Despite its benefits, integrating an LLM with GitHub presents several challenges:
- Security Risks: Granting repository access could expose sensitive information if not handled correctly.
- Execution Control: Ensuring the LLM executes commands safely and without unintended modifications is crucial.
- API Rate Limits: GitHub enforces limits on API calls, requiring careful request management.
- Accuracy: LLM-generated commits or proposals may need human validation to prevent erroneous changes.
Conclusion
By extending an LLM’s capabilities to interact with GitHub, we empower it to automate various development tasks, making workflows more efficient. However, proper security measures and oversight are essential to prevent potential risks.
In upcoming parts of this series, we will explore additional external integrations and experiment with more advanced use cases to further the journey toward agentic AI.