AI-powered code Q&A system. Ask questions about your codebase and get intelligent answers using large language models (LLMs) with an agentic tool-calling loop.
- Agentic Q&A: An AI agent uses tools (grep, read file, list directory, glob search) to explore your codebase and answer questions autonomously
- Multiple LLM Providers: Supports OpenAI and Azure OpenAI—add more via configuration
- Streaming Progress: Real-time SSE streaming shows tool calls as they happen
- Dark Theme UI: Web interface with syntax highlighting, Markdown rendering, and Mermaid diagram support
- .NET 10.0 SDK
- LLM API access (OpenAI or Azure OpenAI)
-
Clone the repository and navigate to the project folder:
cd AnswerCode -
Configure LLM providers in
appsettings.json(see Configuration below). -
Run the application:
dotnet run
-
Open a browser to http://localhost:5000 (or https://localhost:5001).
-
Enter your project path (e.g.
project-codeor an absolute path), choose a model provider, and ask a question about your code.
LLM providers are configured under the LLM section in appsettings.json:
{
"LLM": {
"DefaultProvider": "OpenAI",
"Providers": {
"OpenAI": {
"Endpoint": "https://your-endpoint.openai.com",
"ApiKey": "your-api-key",
"Model": "gpt-4o",
"DisplayName": "GPT-4o"
},
"AzureOpenAI": {
"Endpoint": "https://your-resource.cognitiveservices.azure.com/",
"ApiKey": "your-api-key",
"DeploymentName": "gpt-4o",
"DisplayName": "Azure GPT-4o"
}
}
}
}- OpenAI (and other OpenAI-compatible endpoints): Use
Endpoint,ApiKey,Model, and optionallyDisplayName. - AzureOpenAI: Use
Endpoint,ApiKey,DeploymentName, and optionallyDisplayName.
Use appsettings.Local.json for local secrets and overrides. This file is gitignored and will override values from appsettings.json when present. Copy the structure from appsettings.json and fill in your API keys.
The agent uses these tools to explore your codebase:
| Tool | Description |
|---|---|
list_directory |
List files and subdirectories in a path |
grep_search |
Search file contents by pattern (regex) |
glob_search |
Find files by name pattern (e.g. *.cs) |
read_file |
Read file contents (with optional line range) |
AnswerCode/
├── Controllers/ # API controllers
├── Models/ # DTOs and configuration models
├── Services/
│ ├── Providers/ # LLM providers (OpenAI, AzureOpenAI)
│ └── Tools/ # Agent tools (grep, read_file, etc.)
├── wwwroot/ # Static frontend (index.html)
├── appsettings.json # Main configuration
└── appsettings.Local.json # Local overrides (gitignored)
See repository for license details.