A full-stack agentic AI application for understanding and navigating codebases, built with .NET 8 and React/TypeScript.
- RAG Pipeline: Semantic code search using Azure Cosmos DB vector search
- Local LLM Support: Runs with Ollama (qwen2.5-coder) for local development
- Grounding: Source citations with file:line references
- Streaming Responses: Real-time streaming chat interface
- CI/CD: GitHub Actions pipeline for build and test
┌─────────────────┐ ┌─────────────────────────────────────────┐
│ React Frontend │────▶│ .NET 8 Web API │
│ (TypeScript) │ │ ┌─────────────────────────────────┐ │
└─────────────────┘ │ │ Agent Orchestrator │ │
│ │ (ReAct Loop with Tool Calls) │ │
│ └──────────────┬──────────────────┘ │
│ │ │
│ ┌──────────────┴──────────────────┐ │
│ │ Tools │ │
│ │ • Code Search • File Read │ │
│ │ • Explain Code • Find References │ │
│ └──────────────┬──────────────────┘ │
│ │ │
│ ┌──────────────┴──────────────────┐ │
│ │ RAG Pipeline │ │
│ │ • Document Chunker │ │
│ │ • Embedding Service │ │
│ │ • Vector Search Service │ │
│ └─────────────────────────────────┘ │
└───────────────────┬─────────────────────┘
│
┌───────────────────┴───────────────────┐
│ │
┌─────────┴─────────┐ ┌─────────────┴─────────┐
│ Azure Cosmos DB │ │ Azure OpenAI │
│ (Vector Search) │ │ (GPT-4 + Embeddings) │
└───────────────────┘ └───────────────────────┘
- .NET 8 Web API
- Azure.AI.OpenAI SDK
- Microsoft.Azure.Cosmos SDK
- Microsoft Semantic Kernel (optional)
- React 18 + TypeScript
- Vite
- TailwindCSS
- React Query
- Azure Bicep
- Docker Compose (local development)
- .NET 8 SDK
- Node.js 20+
- Docker (for local Cosmos DB emulator)
- Azure CLI (for deployment)
- Azure subscription with OpenAI access
-
Clone the repository
git clone <repository-url> cd azure-ai-code-agent
-
Configure environment
Update
src/CodeAgent.Api/appsettings.jsonwith your Azure OpenAI credentials:{ "AzureOpenAI": { "Endpoint": "https://your-resource.openai.azure.com/", "ApiKey": "your-api-key", "ChatDeployment": "gpt-4", "EmbeddingDeployment": "text-embedding-ada-002" } } -
Start local services with Docker Compose
docker-compose up -d cosmosdb
-
Run the API
cd src/CodeAgent.Api dotnet run -
Run the frontend
cd src/code-agent-ui npm install npm run dev -
Open the application
- Frontend: http://localhost:5173
- API Swagger: http://localhost:5000/swagger
Use the API to index a code repository:
curl -X POST http://localhost:5000/api/ingestion/repositories \
-H "Content-Type: application/json" \
-d '{
"path": "/path/to/your/repository",
"name": "My Project",
"description": "Description of the project"
}'-
Login to Azure
az login
-
Deploy infrastructure
cd infra ./deploy.sh -
Deploy the API
cd src/CodeAgent.Api dotnet publish -c Release az webapp deploy --resource-group codeagent-rg \ --name <app-service-name> \ --src-path bin/Release/net8.0/publish
azure-ai-code-agent/
├── src/
│ ├── CodeAgent.Api/ # .NET 8 Web API
│ │ ├── Controllers/ # API endpoints
│ │ ├── Services/
│ │ │ ├── Agent/ # Agentic AI components
│ │ │ │ ├── Tools/ # Agent tools
│ │ │ │ └── AgentOrchestrator.cs
│ │ │ ├── Rag/ # RAG pipeline
│ │ │ └── Grounding/ # Citation service
│ │ ├── Models/ # Data models
│ │ └── Infrastructure/ # Azure clients
│ │
│ └── code-agent-ui/ # React/TypeScript Frontend
│ └── src/
│ ├── components/ # UI components
│ ├── hooks/ # Custom hooks
│ └── services/ # API client
│
├── infra/ # Azure Bicep templates
│ ├── main.bicep
│ └── modules/
│
├── tests/ # Test projects
├── docker-compose.yml
└── README.md
POST /api/agent/chat- Send a message and get a responsePOST /api/agent/chat/stream- Send a message with streaming responseGET /api/agent/conversations/{id}- Get conversation historyDELETE /api/agent/conversations/{id}- Clear conversation
GET /api/ingestion/repositories- List indexed repositoriesPOST /api/ingestion/repositories- Index a new repositoryGET /api/ingestion/repositories/{id}- Get repository detailsDELETE /api/ingestion/repositories/{id}- Delete repository index
cd tests/CodeAgent.Api.Tests
dotnet test| Variable | Description |
|---|---|
AzureOpenAI__Endpoint |
Azure OpenAI endpoint URL |
AzureOpenAI__ApiKey |
Azure OpenAI API key |
AzureOpenAI__ChatDeployment |
GPT-4 deployment name |
AzureOpenAI__EmbeddingDeployment |
Embedding model deployment name |
CosmosDb__ConnectionString |
Cosmos DB connection string |
CosmosDb__DatabaseName |
Database name (default: CodeAgentDb) |
Frontend__Url |
Frontend URL for CORS |
MIT




