potpie-ai / potpie
- Π²ΡΠΎΡΠ½ΠΈΠΊ, 11 ΡΠ΅Π²ΡΠ°Π»Ρ 2025β―Π³. Π² 00:00:02
Prompt-To-Agent : Create custom engineering agents for your codebase
App | Documentation | API Reference | Chat with π₯§ Repo
Potpie is an open-source platform that creates AI agents specialized in your codebase, enabling automated code analysis, testing, and development tasks. By building a comprehensive knowledge graph of your code, Potpie's agents can understand complex relationships and assist with everything from debugging to feature development.
Potpie offers a suite of specialized codebase agents for automating and optimizing key aspects of software development:
Potpie provides a set of tools that agents can use to interact with the knowledge graph and the underlying infrastructure:
Install Python 3.10
Prepare Your Environment
Create a .env
file based on the .env.template
Add the following required configurations:
isDevelopmentMode=enabled
ENV=development
OPENAI_API_KEY=<your-openai-key>
POSTGRES_SERVER=postgresql://postgres:mysecretpassword@localhost:5432/momentum
NEO4J_URI=bolt://127.0.0.1:7687
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=mysecretpassword
REDISHOST=127.0.0.1
REDISPORT=6379
BROKER_URL=redis://127.0.0.1:6379/0
CELERY_QUEUE_NAME=dev
defaultUsername=defaultuser
PROJECT_PATH=projects #repositories will be downloaded/cloned to this path on your system.
Create a Virtual Environment using Python 3.10:
python3.10 -m venv venv
source venv/bin/activate
alternatively, you can also use the virtualenv
library.
Install dependencies in your venv:
pip install -r requirements.txt
Start Potpie
chmod +x start.sh
./start.sh
Authentication Setup (Skip this step in development mode)
curl -X POST 'http://localhost:8001/api/v1/login' \
-H 'Content-Type: application/json' \
-d '{
"email": "your-email",
"password": "your-password"
}'
# Save the bearer token from the response for subsequent requests
Initialize Repository Parsing
# For development mode:
curl -X POST 'http://localhost:8001/api/v1/parse' \
-H 'Content-Type: application/json' \
-d '{
"repo_path": "path/to/local/repo",
"branch_name": "main"
}'
# For production mode:
curl -X POST 'http://localhost:8001/api/v1/parse' \
-H 'Content-Type: application/json' \
-d '{
"repo_name": "owner/repo-name",
"branch_name": "main"
}'
# Save the project_id from the response
Monitor Parsing Status
curl -X GET 'http://localhost:8001/api/v1/parsing-status/your-project-id'
# Wait until parsing is complete
View Available Agents
curl -X GET 'http://localhost:8001/api/v1/list-available-agents/?list_system_agents=true'
# Note down the agent_id you want to use
Create a Conversation
curl -X POST 'http://localhost:8001/api/v1/conversations/' \
-H 'Content-Type: application/json' \
-d '{
"user_id": "your_user_id",
"title": "My First Conversation",
"status": "active",
"project_ids": ["your-project-id"],
"agent_ids": ["chosen-agent-id"]
}'
# Save the conversation_id from the response
Start Interacting with Your Agent
curl -X POST 'http://localhost:8001/api/v1/conversations/your-conversation-id/message/' \
-H 'Content-Type: application/json' \
-d '{
"content": "Your question or request here"
}'
View Conversation History (Optional)
curl -X GET 'http://localhost:8001/api/v1/conversations/your-conversation-id/messages/?start=0&limit=10'
We tried to onboard ourselves with Potpie to the AgentOps codebase and it worked like a charm : Video here.
We used the Q&A agent to understand the underlying working of a feature of the CrewAI codebase that was not documented in official docs : Video here.
We fed an open issue from the Portkey-AI/Gateway project to this agent to generate a low level design for it: Video here.
Here we analyse a PR from the mem0ai/mem0 codebase and understand its blast radius : Video here.
Debugging: Get step-by-step debugging guidance based on stacktraces and codebase context.
Testing: Generate contextually aware unit and integration test plans and test code that understand your codebase's structure and purpose.
With Custom Agents, you can design personalized tools that handle repeatable tasks with precision. Key components include:
You can access Potpie Agents through an API key, enabling integration into CI/CD workflows and other automated processes. For detailed instructions, please refer to the Potpie API documentation.
Potpie is designed to be flexible and customizable. Here are key areas to personalize your own deployment:
Modify prompts in app/modules/intelligence/prompts/system_prompt_setup.py
Create new agents in app/modules/intelligence/agents/chat_agents
and app/modules/intelligence/agents/agentic_tools
Modify guidelines within each agent's prompt in the app/modules/intelligence/agents
directory
Edit or add tools in the app/modules/intelligence/tools
directory
We welcome contributions! To contribute:
git checkout -b feature-branch
)git commit -m 'Add new feature'
)git push origin feature-branch
)See Contributing Guide for more details.
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
Thanks for spending your time helping build Potpie. Keep rocking π₯