NetCoreKevin: An Open-Source .NET Enterprise AI Knowledge Base Agent Architecture in Practice

NetCoreKevin is an open-source .NET enterprise SaaS architecture with integrated AI knowledge base agent capabilities.
NetCoreKevin is a .NET-based enterprise SaaS project with front-end/back-end separation and deep AI agent integration. It features Vue3 + .NET architecture, IdentityServer4 SSO, single-database multi-tenant isolation, CAP distributed transactions, RabbitMQ, and SignalR real-time communication. On the AI side, it leverages Semantic Kernel for RAG-based knowledge base retrieval-augmented generation, supports MCP protocol, Agent skills system, multi-model integration, and local offline deployment—suitable for enterprise SaaS platforms, AI knowledge base Q&A, and intelligent customer service scenarios.
Project Overview
NetCoreKevin is a modern SaaS enterprise-grade front-end/back-end separated architecture project built on .NET, with integrated AI knowledge base agent capabilities. The project has earned 451 Stars and 104 Forks on GitHub, is developed in C#, and covers a complete technology stack from foundational architecture to AI agents.
The core value of this project lies in the fact that it's not just a simple scaffold—it deeply integrates current mainstream enterprise development practices with AI capabilities, providing developers with a reference architecture that can be directly used in production environments.

Architecture Design Highlights
Front-End/Back-End Separation and Identity Authentication
The project uses Vue3 for the front end and .NET for the back end, with single sign-on implemented via IdentityServer4 (IDS4). IdentityServer4 is an open-source identity authentication framework based on the OpenID Connect and OAuth 2.0 protocols, designed specifically for the .NET ecosystem. OpenID Connect is an identity layer protocol built on top of OAuth 2.0 that allows clients to verify user identity through an authorization server and obtain basic user information in a standardized way. The core value of Single Sign-On (SSO) is that users only need to log in once to access all trusted application systems—this is particularly critical in microservices architectures and enterprise environments with multiple subsystems. IDS4 supports multiple authorization modes, including authorization code flow, client credentials flow, implicit flow, and others, meeting authentication needs ranging from front-end SPA applications to service-to-service communication.
This architectural design ensures independent deployment and iteration capabilities for both front and back ends, while guaranteeing secure access across multiple systems through a unified identity authentication service. The well-designed authorization and authentication system enables reliable data isolation and permission control for different tenants in multi-tenant SaaS scenarios.
Multi-Tenancy and Distributed Capabilities
The project adopts a "single database, multi-tenant" data isolation approach, ensuring data security while reducing operational complexity. Multi-tenancy is one of the core design decisions in SaaS architecture. The industry primarily uses three data isolation approaches: independent databases (one database per tenant), shared database with independent schemas (each tenant uses separate table structures within the same database), and shared database with shared schema (all tenants share the same tables, distinguished by a TenantId field). NetCoreKevin's "single database, multi-tenant" approach falls into the third category, with advantages of lowest operational cost and highest resource utilization—ideal for scenarios with many tenants but relatively small data volumes per tenant. Implementation typically leverages EF Core's Global Query Filters to automatically add tenant conditions to all queries, ensuring reliable data isolation. The challenge with this approach is the need to strictly prevent cross-tenant data leakage, and performance for other tenants may be affected when a particular tenant's data volume surges.
Combined with distributed architecture design, the project supports:
- Multiple caching strategies: Flexible caching layer design to meet performance requirements of different business scenarios
- CAP integration events: Achieving eventual consistency in distributed transactions based on the CAP framework. CAP is a .NET-based distributed transaction solution library created by Chinese developer Yang Xiaodong (Savorboard). In microservices architecture, cross-service data consistency is a classic challenge—traditional Two-Phase Commit (2PC) solutions have high performance overhead and poor availability. The CAP framework adopts a "local message table + message queue" eventual consistency approach: it writes both business data and event messages within a local database transaction, then reliably delivers events to downstream services via message queues. If message delivery fails, CAP has built-in automatic retry and compensation mechanisms. This pattern is also known as the Outbox Pattern, one of the industry-recognized best practices for distributed transactions.
- RabbitMQ message queue: Supporting asynchronous decoupling and traffic peak shaving
- SignalR real-time communication: Supporting push notifications and similar scenarios
Modularity and Engineering Practices
The project has given thorough consideration to engineering practices:
- IOC modular injection: Achieving loose coupling between modules through dependency injection
- Domain event-driven design: Following DDD principles, decoupling business logic through domain events. Domain-Driven Design is a software design methodology proposed by Eric Evans in 2003, with the core idea of using the complexity of the business domain as the driving force for software design. DDD divides systems into multiple Bounded Contexts, each internally organized through tactical patterns such as Aggregate Roots, Entities, and Value Objects. Domain Events are a key mechanism for communication between bounded contexts in DDD—when an aggregate completes a business-meaningful operation, it publishes a domain event, and other modules interested in that event can respond asynchronously. For example, an "Order Created" event can trigger inventory deduction, notification sending, and other subsequent processes. This event-driven approach eliminates direct dependencies between modules, significantly improving system maintainability and extensibility. In .NET, the MediatR library is a common choice for implementing in-process domain event publish/subscribe.
- Automatic task scheduling: Built-in scheduled task scheduling capability
- API multi-version management: Ensuring backward compatibility of interfaces
- Unit test coverage: Guaranteeing code quality and refactoring confidence
- Structured logging system: Facilitating troubleshooting and system monitoring
Deep Integration of AI Agent Capabilities
Semantic Kernel and RAG (Retrieval-Augmented Generation)
The project integrates Microsoft's Semantic Kernel framework, one of the most mature AI orchestration frameworks in the .NET ecosystem. Semantic Kernel (SK) is an open-source AI orchestration framework released by Microsoft in 2023, positioned as the "operating system kernel" for Large Language Model (LLM) applications. Its core design philosophy is to unify AI capabilities (such as text generation and embedding vector computation) with traditional programming capabilities (such as API calls and database queries) into a single orchestration layer. SK's architecture is built around several core concepts: the Kernel coordinates all components; Plugins encapsulate reusable functional units; the Planner uses LLMs to automatically decompose complex tasks and orchestrate execution steps; and Memory provides vector storage and semantic retrieval capabilities. Compared to Python ecosystem competitors like LangChain, Semantic Kernel's advantages lie in deep integration with the .NET ecosystem, strong type safety, and enterprise-grade reliability design. Microsoft's own Copilot product line also extensively uses SK's design principles.
Through RAG (Retrieval-Augmented Generation) technology, the project implements the core capabilities of an AI knowledge base. RAG is a technical paradigm proposed by Facebook AI Research in 2020, designed to address two core pain points of large language models: knowledge staleness (training data has a cutoff date) and hallucination (generating content that seems plausible but is actually incorrect). The RAG workflow consists of three stages:
- Knowledge base construction (indexing stage): Splitting enterprise documents, FAQs, and other unstructured data into semantically complete text chunks, converting them into high-dimensional vectors through embedding models (such as OpenAI text-embedding-ada-002), and storing them in vector databases (such as Milvus, Qdrant, or Pinecone)
- Semantic intelligent retrieval (retrieval stage): Vectorizing user queries and finding the most relevant text chunks in vector space through algorithms like cosine similarity or inner product, rather than simple keyword matching
- Augmented answer generation (generation stage): Combining retrieved text chunks as context with the user's question to construct a prompt, which is then fed to an LLM to generate accurate and evidence-based answers
RAG effectiveness largely depends on document chunking strategy, embedding model quality, and retrieval algorithm precision. In practical engineering, additional optimization strategies need to be considered, including hybrid retrieval (combining keyword retrieval and vector retrieval), reranking, and context window management.
Agent Framework
The project implements a complete Agent Framework, supporting:
- Skills system: Pluggable skill modules that extend the agent's capability boundaries
- MCP protocol service: Supporting the Model Context Protocol for standardized integration with external tools and data sources. MCP (Model Context Protocol) is an open protocol standard released by Anthropic in late 2024, designed to solve interoperability issues between AI models and external tools and data sources. Before MCP, every AI application needed custom integration code for different tools and data sources, resulting in massive duplication and ecosystem fragmentation. MCP defines a standardized communication protocol with three core primitives: Tool (tool invocation), Resource (resource access), and Prompt (prompt templates). Through MCP, AI agents can connect to various external services in a unified manner—much like a browser accessing web pages—whether for database queries, file system operations, or third-party API calls. MCP uses a client-server architecture, supports both stdio and HTTP+SSE transport methods, and has been adopted by mainstream AI tools including Claude Desktop, Cursor, and VS Code, becoming the de facto standard for the AI Agent ecosystem.
- AI web search: Agents can retrieve internet information in real-time, breaking through knowledge cutoff date limitations
- Local offline AI model invocation: Supporting private deployment scenarios to meet data security and compliance requirements
Flexible Multi-Model Integration
The project's AI capabilities are not dependent on a single model provider and support local offline model invocation—particularly important for enterprise scenarios with strict data security requirements. Local offline model deployment typically uses inference frameworks such as Ollama, llama.cpp, or vLLM, capable of running open-source large models like Llama, Qwen, and Mistral. This approach ensures all data processing occurs within the enterprise intranet with no risk of sensitive information leakage, while also avoiding dependency on external API services and guaranteeing system availability in network-isolated environments. Developers can choose between cloud APIs or locally deployed models based on actual needs, flexibly balancing cost and performance.
Use Case Analysis
This project is particularly suited for the following scenarios:
- Enterprise SaaS platform development: Comprehensive multi-tenancy, permissions, and distributed capabilities ready out of the box
- AI knowledge base Q&A systems: RAG-based intelligent Q&A, applicable to internal knowledge management
- Intelligent customer service platform construction: Rapid implementation leveraging the Agent framework and Skills system
- Advanced .NET technology stack learning: Covers mainstream technical practices in the .NET ecosystem, suitable as a learning reference
Summary
The NetCoreKevin project demonstrates the powerful potential of the .NET ecosystem in the AI era. It organically combines the stability and reliability of traditional enterprise architecture with the flexibility and intelligence of AI agents, providing .NET developers with a complete reference for building AI-empowered enterprise applications from scratch.
For teams exploring how to integrate AI capabilities into existing .NET technology stacks, this project is undoubtedly a high-quality open-source resource worth in-depth study. Whether in terms of architectural design philosophy or AI integration approaches, it offers valuable insights for real-world project implementation.
Related articles
Product ReviewsThe Programmer's Desk Setup Guide: Building a Workspace That Feels Like Home
Discover how programmers build productive, comfortable workspaces. From multi-monitor setups to ergonomic design, explore the desk philosophy that drives focus and flow.
Product ReviewsQoder vs Cursor Real-World Comparison: Which $20/Month AI IDE Is Better?
Hands-on comparison of Qoder vs Cursor AI IDEs: Agent autonomy, human interaction count, and architecture decisions. Qoder needed only 2 interactions vs Cursor's 8.
Product ReviewsCursor Cloud Agent Demo: Eliminating Bottlenecks Across the Entire Software Development Lifecycle
Deep analysis of Cursor's Cloud Agent demo showing how cloud VMs, automated test artifacts, and a full-chain control plane systematically eliminate human bottlenecks across the software development lifecycle.