Inspiration
As developers we often drown in tutorials and articles, yet it is surprisingly hard to get clear, personalised advice on our own code. Junior colleagues kept asking for guidance and reviews, and we realised how much time we spend on repetitive feedback. We imagined an AI mentor that could sit beside us, analyse our work and gently point us toward better patterns and practices.
What it does
VibeCode AI Mentor is a companion that reads your repository, finds similar examples in a curated knowledge base and turns those insights into actionable recommendations. It indexes functions and classes, stores them as vectors in TiDB Cloud and uses a large language model to generate a human‑readable summary. The mentor explains why a pattern is appropriate, suggests concrete changes (even showing diff patches) and links to learning resources. It can be run from the command line today, and we plan to integrate it directly into pull requests.
How we built it
We kept the implementation simple and functional. A Python script walks through your project, cleans and chunks code, and calls OpenAI’s embedding API to create vectors. Those vectors are uploaded to TiDB Cloud where we built a vector index. For the recommendation engine we use LangChain to chain several LLM calls: one to summarise the context and problem, another to produce best‑practice advice, and a final call to draft a patch. Each step is its own function, making the flow easy to follow and extend. A handful of bash scripts wrap these functions into a CLI.
Challenges
The toughest part was chunking real‑world code in a way that preserved meaning without hitting token limits. Getting vector search results that were actually helpful took some tuning of TiDB’s similarity metrics. We also iterated on prompt design to avoid hallucinations and to get crisp, actionable suggestions.
Accomplishments
We delivered a working prototype that can analyse a Python repository and return useful, understandable advice in seconds. The system is open‑source, modular and ready for others to build on. Seeing our tool flag a real bug in a demo repo and propose a fix was immensely satisfying!
What we learned
Building multi‑step agentic workflows taught us the value of small, composable functions. We deepened our knowledge of vector databases, retrieval‑augmented generation and prompt engineering. We also experienced first‑hand how important it is to provide clear explanations when introducing AI into someone’s development workflow.
What’s next
We want to add support for more languages and frameworks, plug the mentor into GitHub Actions for automated reviews and build a simple web UI. Most of all, we’re excited to open the knowledge base to the community so that everyone can contribute patterns and share wisdom.
Built With
- faiss
- langchain
- openai
- python
- tidb-cloud
Log in or sign up for Devpost to join the conversation.