CodebaseChat: A GPT for any GitHub Repo in 30 seconds

What started as a tool for the Context.ai engineering team became an open-source utility we're now excited to be sharing.

CodebaseChat: A GPT for any GitHub Repo in 30 seconds

We’ve been heads down building Context.ai’s analytics platform. When OpenAI released GPTs earlier this month, we built one to answer questions about our growing codebase.

It worked so well that we decided to open source the utility for everyone to use at CodebaseChat.com.

What is a GPT?

About a year after ChatGPT took the world by storm, OpenAI released GPTs, custom versions of ChatGPT that anyone can make. You can create a GPT that only responds in rhymes, or a bot to help you plan recipes, or anything else you can think of.

When building a GPT, you can upload files that augment the LLM’s knowledge. This way, your AI assistant can access information that may not exist in its original training data.

So what happens when you give a GPT knowledge about your codebase? You get a personalized assistant to answer questions about anything from your high-level system design to the nuance of individual functions.

How to use CodebaseChat

Building a GPT with CodebaseChat takes just 30 seconds:

  1. Submit any GitHub repo’s URL to CodebaseChat.com
  2. CodebaseChat will send you a repo.md file
  3. Upload that file to OpenAI’s GPT editor
  4. Use your chatbot to answer questions about the codebase!

Part of the nuance in making an effective GPT is giving it clear instructions about what to do. Here are the instructions for the GPT we made for our own codebase at Context.ai:

"You are a code assistant for the Git repo of Context AI. Context AI is a startup that is building product analytics software for natural language interfaces where users are interacting with LLMs. The product ingests transcripts of its customers, then provides analytics about those interactions, such as topics, sentiment analysis, languages spoken and more. The contents of the codebase are stored in repo.md, with the contents of each file under a new Markdown header."

You can modify these instructions as a starting point and continue to tweak it for the best results.

Note that ChatGPT Plus is required to build or use a GPT. If you don’t have a subscription, you can still use the OpenAI Assistants Playground and similarly upload the repo.md file to create your own chatbot.

Check out the source code

If you want to dig deeper into how we built CodebaseChat, our GitHub repository is fully open source. And if you have any ideas about improving the project, we welcome contributions! Just make a pull request and we’ll take a look.

Here’s where it gets meta: We used CodebaseChat to make a GPT to answer questions about the CodebaseChat repo. Give it a try here.

What about analytics?

One of the limitations of making a GPT is that builders have no visibility into how their users are interacting with the chatbot. Improving your users’ experience is total guesswork.

As an alternative, we encourage you to take a look at the Assistants API for using the same technology in an interface you own end to end.

When you have full control over the chat experience, it’s easy to integrate with Context.ai to serve all your analytics needs. Understand the full picture of what your users are saying and what your AI is saying back. That way, you can identify what’s working and what you need to change.

To learn more about Context.ai, reach out for a demo today.

Read more