[Design] Chat with your codebase
Description
Duo currently isn't able to give quality answers about a codebase due to context limitations. Currently the user needs to individually add files as a context source. While this works well for narrow tasks, it falls short in addressing more holistic questions related to the codebase. For example:
- What is the primary functionality of this repository?
- What are the key dependencies for the files in this directory?
- What are the most commonly used imports in the repository?
- Are there any unused methods in the project?
- Which functions are most frequently called in the repository?
- Which functions are not called anywhere?
See the chat with your codebase epic for more detail.
Why UX matters here
Chat with your codebase takes a breadth over depth approach. It can also lead to hitting token limits faster and lower quality responses if the chat thread is too long or the user tries to ask more depth style questions.
For this reason, the user needs to understand when it's appropriate to target the codebase as context as well as how to manage the context window (e.g. start a new thread) in order to get quality responses from Duo.
Design Proposal
Description | Example |
---|---|
Iteration 1: Keep it simple. Add repository as an option to the existing context menu (currently triggered via /include . Mockup shows the proposed revised context menu but adding repository is not dependant on the new menu design. Also rename folder to directory . |
![]() |
Iteration 2: Revise based on feedback. Do users understand when to use repository vs standard context sources? Is there value in alternative menu hierarchy (e.g. group "breadth" source types) or a different pattern for interacting such as @
|
TBD |
Target outcome
Job performer | Code author |
---|---|
Main job | Develop improvements for my application (e.g., performance, reliability, security, user experience) |
Job Story | When I'm developing improvements to my application, I want to choose the right type of context, so that I can get the most relevant help to my development task |
Underlying Motivation | I need a clear mental model for when to use breadth vs depth context sources, so that I get effective responses without wasting time. |