The .NET AI Architect Laboratory is a strategic blueprint for designing, orchestrating, and scaling model-agnostic AI ecosystems. This repository focuses on building robust architectural substrates where LLMs are treated as pluggable engines rather than hardcoded dependencies.
- Provider Agnosticism: Building a "Master Gateway" that can switch between Gemini, OpenAI, Anthropic, and Groq (Llama/Qwen) LLMs with zero breaking changes in the application core.
- Type Safety & Schema Enforcement: Enforcing strict data contracts (C# Classes) regardless of which model or provider executes the response.
- Abstraction-First: Mastering
Microsoft.Extensions.AIto decouple core systems from specific AI vendor APIs.
- Framework: .NET 10 (Minimal APIs Architecture)
- Frontend SPA: Angular 19 (Reactive Signals, Client-Side Rendering)
- UI Styling: Tailwind CSS v3 (Cyber-Dashboard Theme)
- AI Abstraction:
Microsoft.Extensions.AI(v10.5.0+ Standard Implementation) - Active SDKs: - Google.GenAI (v1.6.2 Reference Substrate)
- Microsoft.Extensions.AI.OpenAI (v10.5.0 Enterprise Bridge)
- Orchestration: Microsoft Semantic Kernel (v1.76.0+)
- Active Engines (Dual-Engine Topology): - Gemini 2.5 Flash (Vertex AI Integration Reference)
- Llama 3.3 70B & Llama 3.1 8B (Powered by Groq LPU Infrastructure for low-latency execution)
- Upcoming Engines: Claude 3.5 Sonnet, GPT-4o, Local LLMs (Ollama)
Focusing on the backend "Brain" and ensuring provider-independence.
- Enterprise Setup (Gemini): Connectivity via Google Vertex AI & IAM infrastructure.
- Secure Configuration: Decoupled environment management via structured
appsettings.json. - Structured Output: Universal JSON mapping to C# classes via native SDK schema enforcement (The "Type-Safe" core).
- Model Agnosticism: Full integration of
IChatClientabstraction to support external providers seamlessly. - API Gateway: A clean Minimal API acting as the central intelligence hub.
Making AI "do things", integrating low-latency providers, and visualizing the results.
- Orchestration: Native C# Plugin development via Semantic Kernel using type-safe execution.
- Prompt Templating: Decoupling architectural instructions from core code using Semantic Kernel template syntax (
{{$code}}). - Secure Sandbox: Hardening the
ProjectInspectorPluginagainst Path Traversal vulnerabilities using absolute workspace validation. - Architecture Dashboard: Integrated Angular 19 with Tailwind CSS v3 to visualize real-time model analysis in a siber-panel interface.
- Dynamic Localization: Multi-language review orchestration (e.g., Turkish, English) powered by query routing and Semantic Kernel prompt variables (
{{$language}}). - Cross-Origin Security: Configured explicit .NET CORS policies to securely bridge the Angular SPA and the Minimal API Gateway.
- Autonomous Function Calling: Transitioned from manual tool orchestration to fully autonomous, model-driven multi-tool execution using Semantic Kernel auto-invocation behaviors.
- Dynamic Provider Routing (Groq Integration): Developed a dynamic endpoint pipeline that detects
ModelIddata at runtime and seamlessly routes traffic between Vertex AI and Groq without mutating the runtime IoC container. - Deterministic JSON Enforcement: Mitigated small-model hallucination patterns (such as Llama 3.1 8B thought chains) by hardcoding native
ChatResponseFormat.Jsonparameters at the API level. - Request-Scoped Service Resolution: Resolved runtime IServiceProvider locking bugs by migrating keyed service resolution to
HttpContext.RequestServices, insulating scoped kernel state. - UI Sanity Filter (Token Bleeding Fix): Implemented an explicit client-side whitelist regex filter within Angular signals to scrub out accidental Cyrillic/Asian character leakages while fully maintaining native Turkish character parsing support.
Providing AI with secure access to corporate data using local cost-effective vector abstractions.
- External Dependency Rejection: Eliminated heavy and costly cloud-dependent vector databases. Built a high-performance, cost-effective local memory layer using raw SQLite.
- Provider-Agnostic Embedding Bridge: Developed a custom
GoogleEmbeddingGeneratorsarmallayฤฑcฤฑsฤฑ usingtext-embedding-004to convert text segments into 768-dimensional vectors seamlessly matching standardMicrosoft.Extensions.AIinterfaces. - Native Vector Math: Implemented a lightweight, zero-dependency Cosine Similarity mathematical formula directly in C# for lightning-fast semantic retrieval.
- Deterministic Deduplication Policy: Engineered an intelligent Base64 path-hashing system on the Angular side to enforce SQLite's
ON CONFLICT(Id) DO UPDATEconstraint, eliminating memory inflation. - Knowledge-Augmented Orchestration: Deeply integrated the vector retrieval pipeline into the Autonomous Agent gateway (
/api/architect/inspect-autonomous), allowing the agent to evaluate local context substrates before executing tools. - RAG Cyber Management Board: Visualized real-time vector ingestion and semantic searching directly on the frontend spa using Tailwind and reactive Angular Signals.
The transition from orchestrated workflows to autonomous agency.
- Custom MCP Servers: Building .NET-based Model Context Protocol servers to bridge LLMs with local tools (
ListProjectFiles,ReadCodeFile). - Agentic Workflows & Live Streaming: Architecting a multi-loop reasoning engine utilizing HTTP/SSE Text Streams connected to an Angular Signals UI.
- Stochastic Bracket Counter & UI Defenses: Integrated custom .NET bracket-balancing algorithms and language enforcement layers to tame small models (Llama 3.1 8B).
- Reactive Terminal Viewport: Developed a dark-cyber monochrome Live Execution Ledger in Angular with auto-scroll telemetry mapping.
Here is the production-ready cyber-dashboard interface visualizing an autonomous enterprise code inspection via the dual-engine substrate in Phase 2:
The dedicated multi-tab standalone workspace orchestrating high-dimensional knowledge sealing and keyword-less semantic matching:
Once both layers are running, toggle the Agent Mode on the cyber-dashboard to unlock multi-tool reasoning:
- Active AI Engine: Select your preferred engine from the dropdown (Gemini 2.5 Flash, Llama 3.1 8B, or Llama 3.3 70B). The system will dynamically route the request to the correct provider substrate.
- Target Folder Path: Provide the absolute path to your repository root (e.g.,
C:\Project\msuzen\dotnet-ai-lab). - Agent Objective: Input a high-level goal such as "Review our configuration and check for frontend access boundaries."
- Execution: Click Launch Autonomous Agent. The underlying engine will autonomously evaluate the local SQLite vector database to query matching code substrates, embed them as context, and chain file tools to generate a comprehensive enterprise report.
The system is configured for zero-friction distribution. The Angular UI is natively embedded inside the .NET Minimal API, running entirely on a single port.
git clone https://github.com/muratsuzen/dotnet-ai-lab.git
cd dotnet-ai-labConfigure your appsettings.json based on your requirements. The system supports independent provider initialization.
{
"AI": {
"Gemini": {
"ProjectId": "", //YOUR_GCP_PROJECT_ID
"Location": "us-central1",
"ModelId": "gemini-2.5-flash"
},
"Groq": {
"ApiKey": "", //gsk_YOUR_GROQ_API_KEY
"ModelId": "llama-3.3-70b-versatile"
}
}
}Important: If you only intend to use Groq, simply leave the Gemini:ProjectId field empty. The system will automatically enable "Null Mode" for embeddings to ensure stability. If using Gemini, ensure vertex-key.json is present in the backend root.
Compile the Angular frontend and inject it directly into the .NET wwwroot, then run the API Gateway:
# Step A: Compile Angular UI into backend wwwroot
cd src/frontend/ai-architect-ui
npm install
npm run build -- --configuration production
# Step B: Fire up the single-port orchestration pipeline
cd ../../backend/AI.Architect.Gateway
dotnet run --configuration ReleaseOpen your browser and navigate to http://localhost:5000.
Once you have configured your appsettings.json, you can launch the application directly from the release folder:
# Execute the application binary
dotnet AI.Architect.Gateway.dllThe system will initialize the integrated Angular UI and API Gateway. Open http://localhost:5000 to start your architectural inspection.

