Explore Your Codebase¶
In this tutorial, you'll use the Ask agent to get cited answers grounded in your actual source code, with exact file paths and line numbers.
Prerequisites¶
- Potpie CLI installed and set up (Quickstart)
- A repository registered as a source (
potpie source add repo .)
Steps¶
1. Ask your question¶
Type a natural language question about the codebase. Ask handles flow tracing and dependency mapping automatically.
Or use the web UI / agent harness chat interface to ask interactively.
2. Review the response¶
Potpie returns an answer with:
- File paths relative to the repository root
- Line references where relevant
- Structured headers and code snippets
Note
When a question involves a third-party library, Potpie retrieves external documentation via web search automatically.
3. Follow up¶
Follow-up questions within the same session retain full context. Start broad and narrow down:
> "What does the auth middleware do?"
> "Which routes use it?"
> "What happens if the token is expired?"
Example questions¶
- "How does the payment processing flow work end-to-end?"
- "Where is the user model defined and what are its relationships?"
- "What would break if I changed the database schema for orders?"
- "How is error handling done across the API layer?"
What's happening under the hood¶
Ask classifies your question by type (what, how, where, or why), then:
- Searches the knowledge graph via vector similarity
- Traverses structural relationships for connected context
- Reads source files directly when needed
- Assembles a cited answer grounded in real code
Next steps¶
- Build a Feature — use the Build agent to generate code
- Debug an Issue — trace bugs to their root cause