As a developer, I always feel lazy when it comes to creating engaging and well-structured README files for my projects. And I’m pretty sure many of you can relate. Writing a good README is tedious but essential. I won’t dive into why—because we all know it matters.
So, I built an AI Agent called "Readme Generator" to handle this tedious task for me. This AI Agent analyzes your entire codebase, deeply understands how each entity (functions, files, modules, packages, etc.) works, and generates a well-structured README file in markdown format.
I used Potpie to build this AI Agent.
Checkout our Github Repo and give us a star⭐
App | Documentation | API Reference | Chat with 🥧 Repo
Prompt-To-Agent: Create custom engineering agents for your code
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.
📚 Table of Contents
- 🥧 Why Potpie?
- 🤖 Our Prebuilt Agents
- 🛠️ Tooling
- 🚀 Getting Started
- 💡 Use Cases
- 🛠️ Custom Agents
- 🗝️ Accessing Agents via API Key
- 🎨 Make Potpie Your Own
- 🤝 Contributing
- 📜 License
- 💪 Contributors
🥧 Why Potpie?
- 🧠 Deep Code Understanding: Built-in knowledge graph captures relationships between code components
- 🤖 Pre-built & Custom Agents: Ready-to-use agents for common tasks + build your own
- 🔄 Seamless Integration: Works with your existing development workflow
- 📈 Flexible: Handles codebases of…
I simply provided a descriptive prompt to Potpie, specifying what I wanted the AI Agent to do, the steps it should follow, the desired outcomes, and other necessary details. In response, Potpie generated a tailored agent for me.
The prompt I used:
I want an AI Agent that understands the entire codebase to generate a
high-quality, engaging README in MDX format. It should:Understand the Project Structure
- Identify key files and folders.
- Determine dependencies and configurations from package.json, requirements.txt, Dockerfiles, etc.
- Analyze framework and library usage.
Analyze Code Functionality
- Parse source code to understand the core logic.
- Detect entry points, API endpoints, and key functions/classes.
Generate an Engaging README
- Write a compelling introduction summarizing the project’s purpose.
- Provide clear installation and setup instructions.
- Explain the folder structure with descriptions.
- Highlight key features and usage examples.
- Include contribution guidelines and licensing details.
- Format everything in MDX for rich content, including code snippets, callouts, and interactive components.
MDX Formatting & Styling
- Use MDX syntax for better readability and interactivity.
- Automatically generate tables, collapsible sections, and syntax highlighted code blocks.
Based upon this provided descriptive prompt, Potpie generated prompts to define the System Input, Role, Task Description, and Expected Output that works as a foundation for our README Generator Agent.
Here’s how this Agent works:
Contextual Code Understanding - The AI Agent first constructs a Neo4j-based knowledge graph of the entire codebase, representing key components as nodes and relationships. This allows the agent to capture dependencies, function calls, data flow, and architectural patterns, enabling deep context awareness rather than just keyword matching
Dynamic Agent Creation with CrewAI - When a user gives a prompt, the AI dynamically creates a Retrieval-Augmented Generation (RAG) Agent. CrewAI is used to create that RAG Agent
Query Processing - The RAG Agent interacts with the knowledge graph, retrieving relevant context. This ensures precise, code-aware responses rather than generic LLM-generated text.
Generating Response - Finally, the generated response is stored in the History Manager for processing of future prompts and then the response is displayed as final output.
This architecture ensures that the AI Agent doesn’t just perform surface-level analysis—it understands the structure, logic, and intent behind the code while maintaining an evolving context across multiple interactions.
The generated README contains all the essential sections that every README should have -
- Title
- Table of Contents
- Introduction
- Key Features
- Installation Guide
- Usage
- API
- Environment Variables
- Contribution Guide
- Support & Contact
Furthermore, the AI Agent is smart enough to add or remove the sections based upon the whole working and structure of the provided codebase.
With this AI Agent, your codebase finally gets the README it deserves—without you having to write a single line of it.
Here's an Output:
Top comments (7)
Well-written article, Ayush!
Nice Ayush!
This AI Agent is super handy
This is exactly what I wanted for my coding projects
This looks super cool. Can you share this AI Agent so I can try it
Will try to create a similar AI Agent using Potpie
This AI Agent is super handy for a person likes me who avoids writing README