💡 drcode

"Respondents spend 35% of their time managing code, including code maintenance (19%), testing (12%) and responding to security issues (4%)" - TheNewStack. We probably all have done some code review at some point, such as adding comments or creating unit tests, but this process, is quite time-consuming. This is where our product comes into play: drcode– Double your productivity in increasing codebase readability and accuracy.

drcode automatically improves codebase quality by using the strength of LLMs and vector databases, speeding up code review and raising output by utilizing Anthropic's Claude 2. Our program first searches through a GitHub repository and scrapes all your code files, and compiles it all along with context provided by searching through the full coding language documentation. It then generates up-to-date and accurate information based on this context, and opens a pull request in your repo with all the changes.

🛠️ How we built it

drcode workflow

drcode first downloads all the documentation of a certain language, and passes it to Claude to summarize the information into something parseable. We then pass it along to LangChain JS to split up the text recursively and create Documents, which then get passed to TransformersJS, a sentence transformer that creates embeddings for the documentation. Finally, we store these embeddings and the text into a vector database, LanceDB.

The codebase is first scraped off of GitHub, then combined with context by querying LanceDB for the most similar pieces of documentation. All of this data is put into a carefully crafted prompt to input into Claude once again, to output an XML file of all the changes it wants to commit. A pull request is opened, and the bot is ready to serve the next repo.

🔮 What's next

As of now, drcode only supports Python files and would be slow for larger repos, but in the future, we plan to fix all of these problems and expand its capabilities to address more code quality issues, such as performance optimizations and security checks. We also plan to include Retrieval Augmented Generation for other imported modules to have a larger context window.

🌟 With drcode, you can revolutionize your codebase productivity, paving the way for more efficient and error-free code collaboration in the community.

Built With

  • claude
  • lancedb
  • langchain
  • sentence-transformers
Share this project:

Updates