

PotpieAI has launched Open-Source Custom AI Agents, enabling developers to build AI assistants that deeply understand their codebases. These agents leverage a Neo4j-based knowledge graph and CrewAI-powered RAG agents for intelligent, context-aware automation. Developers can create and manage agents via the Potpie dashboard or API, optimizing workflows with customizable AI assistance.
Building AI agents that truly understand your codebase has always been our main goal at Potpie. We believe AI should seamlessly integrate into your development workflow, automating tedious tasks and enhancing productivity without compromising flexibility.
AI agents are transforming the way developers automate tasks, analyze codebases, and enhance productivity. Instead of relying on generic LLM models, these agents can be tailored to specific workflows, making them more efficient, context-aware, and capable of handling complex engineering challenges.
Following this, we’re thrilled to announce Potpie’s Open-Source Custom AI Agents. This means you can dive into the code, tweak it to your needs, and contribute to making AI-powered development even better. Whether you’re automating code reviews, debugging sessions, or developing new features, developers get to utilize the full potential of custom AI Agents.
Potpie's Custom AI Agents are designed to analyze, adapt to, and enhance complex codebases just like an experienced developer. By leveraging in-depth code analysis, adaptive AI strategies, and context-aware enhancements, these agents go beyond basic linting tools to provide intelligent, and actionable fixes.
At the core of Potpie’s approach is a Neo4j-based knowledge graph that systematically maps out the entire codebase. This graph is constructed through a multi-stage processing pipeline, tracking:
This structured representation allows the AI agent to trace through the flow of the code and emulate a human developer's thought process, ensuring a deep contextual understanding of the project.
When a query is received, Potpie determines the best way to handle it through query classification. This Agent Supervisor is based on langgraph. If the AI model can answer using built-in knowledge and chat history, it responds immediately; otherwise, the query is sent to the RAG Agent for deeper analysis.
To ensure project-specific solutions, Potpie dynamically uses a specialized RAG Agent built using CrewAI. This agent plays a crucial role in querying the knowledge graph and refining the retrieved information.
Each created Agent consists of three basic parameters:
To navigate and query the knowledge graph, the agent utilizes LangChain-based tools specifically designed for extracting structured information efficiently. Rather than just identifying problems, Potpie’s AI agents generate concrete and actionable output.
The traditional method of building custom AI Agents involves specifying three parameters -
These three parameters work as the foundation of your AI agent, ensuring they are well-defined will significantly improve its performance.
At Potpie, we’ve reimagined how custom AI agents are built, making the process more intuitive and developer-friendly.
We’ve eliminated the hassle by allowing you to define everything in a single, detailed prompt. Simply describe:
Potpie intelligently analyzes your prompt and automatically generates a tailored configuration for your AI agent optimizing it for the specific task you want it to perform. It eliminates uncertainty and ensures your AI agent is precisely tuned to deliver accurate and efficient results right from the start.
To build custom AI Agent:
Checkout docs to learn more about custom AI Agents.
If you want to build custom AI agents using the API, we’ve got you covered! With the API, you get the flexibility to create and run custom AI agents tailored to your project’s unique requirements on the cloud or locally, on your own machine if you’re evaluationg the open source version!
The Potpie API lets you do much more than just create custom agents. You can:
- Start and manage conversations
- Send and receive messages
- Update or delete custom agents
… and so much more!
To set up the Potpie server locally. Follow the steps in our documentation to get it up and running on your device.
After successfully setting up the Potpie server locally, you can run following command to create custom AI Agent:
curl -X POST "http://localhost:8001/api/v1/custom-agents/agents/auto" \
-H "Content-Type: application/json" \
-d '{
"prompt": "prompt_text"
}'
Replace prompt_text with your desired prompt. As discussed earlier in this blog, keep the prompt brief and descriptive to ensure optimal results.
If the request is successful, you’ll receive a response like this:
{
"role": "<string>",
"goal": "<string>",
"backstory": "<string>",
"system_prompt": "<string>",
"id": "<string>",
"user_id": "<string>",
"tasks": [
{
"description": "<string>",
"tools": [
"<string>"
],
"expected_output": "<any>",
"id": 123
}
],
"deployment_url": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"deployment_status": "<string>"
}
This response contains all the details of the generated Custom AI Agent.
Once your custom AI agent is created, you can use it to interact with your codebase and perform various operations. To do this, Potpie provides a "Create Conversation and Message" API endpoint, allowing you to send a prompt to your AI agent and receive a response.
The endpoint is:
http://localhost:8001/api/v2/project/{project_id}/message
You can integrate this into your backend API as follows:
app.post("/create-conversation", async (req, res) => {
try {
const response = await axios.post(
`https://production-api.potpie.ai/api/v2/project/{project_id}/message`,
{
body: {
agent_id: "agent_id",
content:
“prompt_text",
},
},
{
body: {
"x-api-key": "api_key”
"Content-Type": "application/json",
},
}
);
With this setup, your custom AI agent can now process queries and assist you in interacting with your codebase efficiently.
With Potpie’s Custom AI Agents, developers get more than just automated linting, they get a developer-level AI assistant that understands their code, improves efficiency, and provides transparent, customizable solutions. With introducing Open-Source Custom AI Agents, Potpie enables developers to extend, refine, and contribute to the future of AI-driven code analysis.
Checkout our Quickstart guide and start building with Potpie: https://docs.potpie.ai/quickstart
Got stuck anywhere? Join our Discord Server - https://discord.gg/NxUQCcz6