Replaces the ContextProvider class with DocumentContextProviderService, moving vector search logic into its own file. Updates dependency injection and all usages to reference the new service. The service uses embeddings and Entity Framework for vector-based text search, returning relevant document chunks. Removes unused usings and references to ContextProvider.
Refactored the embedding workflow to introduce ExtractChunksExecutor, responsible for content decoding and chunk extraction before embedding generation. Registered ExtractChunksExecutor and GenerateEmbeddingExecutor as singletons, and StoreEmbeddingExecutor as scoped in DI. Updated workflow to sequence ExtractChunksExecutor → GenerateEmbeddingExecutor → StoreEmbeddingExecutor. Modified GenerateEmbeddingExecutor to accept ExtractChunksResponse. Updated ChatClientAgentOptions usage to use object initializers for clarity. Added ExtractChunksExecutor.cs.
The binary file SqlDatabaseVectorSearch.mp4 was deleted from the codebase to reduce repository size and remove unnecessary assets. No code functionality is affected by this change.
Enhanced the project README by adding badges for .NET 10, Minimal API, and Blazor support to the project title. This highlights the technologies and features supported by the project for better visibility and clarity.
Updated <HeadOutlet> and <Routes> to use the named parameter 'prerender: false' with InteractiveServerRenderMode, improving code clarity and consistency with named parameter usage.
Moved message scrolling logic to OnAfterRenderAsync to ensure DOM updates before scrolling, using Task.Yield() after StateHasChanged. Removed redundant EnsureMessageIsVisibleAsync calls. Cleaned up Error.razor by removing unused usings and the rendermode directive.
Removed the custom TraceHttpClientHandler and switched OpenAIClient initialization to use the default HTTP transport. Cleaned up unused using directives. Updated SqlDatabaseVectorSearch_WebApp.png with a new version.
Updated sidebar CSS to use a blue and neutral color palette, added vertical gradient backgrounds and box-shadows, and enhanced navigation item styles with rounded corners, transitions, and bold active states. Adjusted icon colors and updated comments for new color inheritance approach.
Refactored the output token usage details to show reasoning tokens as an indented HTML line using a <span> with Bootstrap classes for indentation and smaller text, instead of a parenthetical note. Updated logic to use ReasoningTokenCount.HasValue for improved clarity.
Refactored HTML generation by introducing a sections array for easier extension and maintainability. Updated FormatTokenUsageDetails to require non-null UsageDetails and display reasoning tokens as a detail within output tokens, improving clarity and reducing redundancy. Only non-null sections are rendered, simplifying the logic.
Refactored the copy button to use per-message state, displaying a checkmark icon and "Copied!" tooltip when a message is copied. Simplified state management, removed unused references, and updated the Reset method to clear copied state. Enhanced Ask.razor.css to minimize button chrome and improve interactive states for a cleaner UI.
- Tooltip and file input now use `UploadDocument` properties for supported types and max size.
- File input's `accept` attribute set from `UploadDocument.AcceptedFileTypes`.
- Added `<ValidationMessage>` for file input errors.
- Stream size limit uses `UploadDocument.MaxFileSize`.
- Introduced `GetDocumentId()` for parsing document IDs.
- Simplified LINQ in `DeleteSelectedDocuments`.
- `UploadDocument` implements `IValidatableObject` for:
- GUID format validation.
- Supported extension checks.
- File size enforcement.
- Centralized constants for extensions, types, and max size in `UploadDocument`.
The file upload form in Documents.razor is now wrapped in a <fieldset> that disables all controls while uploading, using a new isUploading flag to manage state and UI updates. The upload button's loading state is also handled. In Program.cs, the citation template was revised to require supporting excerpts of about 20-30 words instead of 15-20 words.
Replaced the chat progress bar in Ask.razor with a modern animated "typing indicator" using three bouncing dots. Updated Ask.razor.css to remove old progress bar styles and add new keyframes and accessibility improvements for the typing dots. This enhances user experience by clearly signaling when the assistant is responding.
The chat UI progress bar was visually updated: height increased to 6px, background made more transparent, and corners fully rounded. The indeterminate bar now uses a gradient with a moving highlight animation, which is slower for users with reduced motion preferences. Animation duration and style were refined for improved accessibility and aesthetics.
Updated documentation and UI to clarify support for both Azure SQL Database and SQL Server 2025+ for native VECTOR type storage and search. Improved README with accurate prerequisites, setup instructions, and detailed ModelId usage guidance. Clarified streaming response availability in both Blazor and API. Fixed typos and improved wording in UI messages. Enhanced code comments for clarity and accuracy, including ModelId guidance in appsettings.json.
Update icon choices and colors across the Blazor app for improved visual clarity and consistency. Use explicit InteractiveServerRenderMode in App.razor. Replace sidebar, header, and navigation icons with filled or colorized variants in MainLayout.razor. Update Ask.razor and Documents.razor with more descriptive icons. Enhance reconnect modal messaging and button visibility. Adjust app.css for individual sidebar icon colors and brand icon styling. Remove EFCore.SqlServer.VectorSearch from the home page feature list to focus on Agent Framework. These changes improve UI feedback, accessibility, and maintainability.
Replaced AddSqlServer with AddDbContext for ApplicationDbContext, enabling dynamic provider selection based on the connection string. Now uses UseAzureSql for Azure SQL targets and UseSqlServer with retry logic otherwise. Configured all queries to use NoTracking for improved performance.
Consolidate embedding request logic into a new EmbeddingRequest record with static factory methods for IFormFile and stream input. Remove FormFileToEmbeddingRequestExecutor and FormFileEmbeddingRequest, updating all usages and dependency injection accordingly. Clean up related code in Program.cs, VectorSearchService, and _Imports.razor. Enhance XML documentation for EmbeddingRequest to clarify intent and usage.
Updated README.md and Home.razor to document migration from Semantic Kernel to Microsoft Agent Framework, detailing new orchestration, document import, question reformulation, and RAG agent workflows. Revised API and streaming response examples to use Server-Sent Events (SSE) with event names Start, Delta, and End. Refactored AskEndpoints.cs to use .NET 8 ServerSentEvents API and yield SseItem<Response> with correct event names. Updated Ask.razor, Documents.razor, and VectorSearchService.cs to use StreamState.Delta instead of Append, and replaced StateHasChanged() with await InvokeAsync(StateHasChanged) for async UI updates. Removed MaxInputTokens and MaxOutputTokens from AppSettings.cs and appsettings.json.
The instructions for formatting the sources section at the end of answers were revised for clarity and precision. Instead of multiple separate citation rules, the new guidance requires using a provided template, with the sources and page labels localized to the user's language. The updated rules specify omitting the page label and number if not available, and explicitly prohibit headings or links in the sources section. The formatting example was also updated to match these changes.
Updated the "Sources" section header and changed the source list from bullets to a numbered format (e.g., "[1] SourceName"). Each source now includes its excerpt and a separator line ("---"). Removed the "### Excerpts" section and extra blank lines, consolidating sources and excerpts for improved clarity.
Clarifies citation formatting: the sources label must be localized and in standard-size italic text (not a heading or bold). Citations now require the source name in bold, followed by the localized page label and page number if available, then a colon and 15-20 italicized words from the excerpt. Source names are not links, and only actually used, non-duplicate sources are included. Example formats are updated accordingly.
- Inject IServiceScopeFactory in Documents.razor for better DI and async scope creation.
- Update citation formatting in Program.cs: sources now appear as a localized, numbered Markdown list with block quotes.
- Use a helper for consistent source/page formatting in TextSearchProviderOptions.
- Simplify RawRepresentation in VectorSearchService to just the page number.
- Added a new Response constructor overload for simpler instantiation with conversationId, streamState, and optional tokenUsageResponse.
- Updated AddAIAgent registrations for "ReformulationAgent" and "RagAgent" to set Id to the lower-cased key.
- Modified VectorSearchService to use the new Response constructor, omitting now-optional parameters.
- Enhanced ContextProvider: TextSearchResult now includes a RawRepresentation property with chunk metadata (Id, DocumentId, PageNumber, IndexOnPage, Content).
Replaced `IServiceProvider` with `IServiceScopeFactory` for async scope creation, updated injected services and usages, switched namespace import from `System.Text.RegularExpressions` to `Microsoft.Extensions.AI`, and simplified the `FormatTokenUsageDetails` method signature to use the unqualified `UsageDetails` type.
- Enabled additional C# code style suggestions in .editorconfig.
- Removed citation rendering and extraction from Ask.razor.
- Deleted Citation, ChatResponse, and TokenUsage models and references.
- Updated TokenUsageResponse to use UsageDetails from Microsoft.Extensions.AI.
- Refactored Response model: removed citations, added ConversationId, and adopted new token usage structure.
- Updated HybridCacheSessionStoreService with new cache key format and DeleteSessionAsync method.
- Refactored VectorSearchService to remove AppSettings dependency, update method signatures, and use UsageDetails for token tracking.
- Updated NuGet package references in SqlDatabaseVectorSearch.csproj.
Replaced SemanticKernel with Microsoft.Agents.AI and agent-based abstractions for chat and RAG workflows. Removed ChatService in favor of AIAgent instances for question reformulation and answering. Added agent registration/configuration in Program.cs, new RagResponse record, and ContextProvider for context search. Introduced HybridCacheSessionStoreService for session persistence. Switched to direct OpenAIClient usage with request tracing. Reduced max relevant context chunks to 30. Removed SemanticKernel from project references and suppressed MEAI001 warning. Refactored code for improved style and DI alignment.
Replaces the direct import logic with a workflow using Microsoft.Agents.AI.Workflows. Adds executors for file conversion, embedding generation, and storage. Updates dependency injection, API endpoint, and UI to use the new workflow. Replaces ImportDocumentResponse with StoreEmbeddingResponse. Adds required NuGet packages.
Refactored PlainTextChunker to add input validation, null checks, and argument validation in public methods. Renamed SplitMarkDownLines to SplitMarkdownLines for consistency and updated all references. Centralized line ending normalization and token count validation into dedicated methods. Enhanced error handling with clearer messages and exception types. Simplified paragraph merging logic and ensured GetDefaultTokenCount returns at least 1 for non-empty input. Updated MarkdownTextChunker to use the corrected method name.
Removed Microsoft.SemanticKernel dependencies in favor of Microsoft.Agents.AI.OpenAI for embedding and chat services. Updated DI registrations in Program.cs to use OpenAIClient. Reimplemented text chunking with a new PlainTextChunker class, updating DefaultTextChunker and MarkdownTextChunker accordingly. Updated .csproj to add new package references and suppress related analyzer warnings.
Updated several NuGet package references in SqlDatabaseVectorSearch.csproj to their latest versions, including EntityFrameworkCore.Exceptions.SqlServer, Microsoft.AspNetCore.OpenApi, Microsoft.EntityFrameworkCore.SqlServer, Microsoft.EntityFrameworkCore.Tools, Microsoft.Extensions.Caching.Hybrid, Microsoft.Extensions.Http.Resilience, Microsoft.SemanticKernel, Swashbuckle.AspNetCore.SwaggerUI, and TinyHelpers.AspNetCore. No other changes were made.
Updated package references in SqlDatabaseVectorSearch.csproj:
- Microsoft.AspNetCore.OpenApi to 10.0.7
- Microsoft.EntityFrameworkCore.SqlServer to 10.0.7
- Microsoft.EntityFrameworkCore.Tools to 10.0.7
- Microsoft.SemanticKernel to 1.76.0
Clarified ConfigureAwait(false) usage in copilot-instructions.md for library vs ASP.NET Core scenarios. Upgraded multiple NuGet dependencies in SqlDatabaseVectorSearch.csproj to their latest versions for improved compatibility and features.
Upgraded several NuGet packages in SqlDatabaseVectorSearch.csproj, including Microsoft.AspNetCore.OpenApi, EntityFrameworkCore.SqlServer/Tools, Microsoft.Extensions.Caching.Hybrid, Microsoft.Extensions.Http.Resilience, Microsoft.SemanticKernel, Swashbuckle.AspNetCore.SwaggerUI, and TinyHelpers.AspNetCore to their latest patch releases. No other code or configuration changes were made.
Upgraded the Microsoft.SemanticKernel NuGet package in SqlDatabaseVectorSearch.csproj from version 1.69.0 to 1.70.0 to incorporate the latest features and improvements.
Updated several NuGet packages in SqlDatabaseVectorSearch.csproj:
- Microsoft.AspNetCore.OpenApi, Microsoft.EntityFrameworkCore.SqlServer, and Tools to 10.0.2
- Microsoft.Extensions.Caching.Hybrid and Http.Resilience to 10.2.0
- Microsoft.SemanticKernel to 1.69.0
- MimeMapping to 3.2.0
- TinyHelpers.AspNetCore to 4.1.15
- Add null check for Document in DocxContentDecoder to prevent exceptions.
- Set DocumentChunk.Id to auto-generate in ApplicationDbContext.
- Order vector search results by cosine similarity for relevance.
- Order document chunks by cosine vector distance for better relevance in VectorSearchService; limit results to MaxRelevantChunks.
- Update multiple NuGet dependencies to latest versions for improved stability and features.
Updated the following NuGet package dependencies in the
`SqlDatabaseVectorSearch.csproj` file:
- `FluentValidation.DependencyInjectionExtensions` updated
from version `12.1.0` to `12.1.1` to incorporate potential
bug fixes and improvements.
- `Microsoft.SemanticKernel` updated from version `1.67.1`
to `1.68.0` to include enhancements and new functionality.
These updates aim to improve stability, performance, and
compatibility of the project.
Reduced `.card-body` height in `Ask.razor.css` for screens with a minimum width of 768px. Updated `Blazor.Bootstrap` package in `SqlDatabaseVectorSearch.csproj` from version 3.4.0 to 3.5.0.
Added screenshots for the Web App and Web API to README for better visualization of the application. Updated the .NET SDK prerequisite from version 9 to version 10. Fixed a minor formatting issue in the description of Semantic Kernel and EFCore.SqlServer.VectorSearch.
Renamed `CreateQuestionAsync` to `CreateReformulateQuestionAsync` for clearer intent. Updated `CreateChatAsync` to include a new `ChatSystemPrompt` property in `AzureOpenAIPromptExecutionSettings` and modified `ChatHistory` initialization to simplify setup. Removed redundant `prompt` string construction and added user messages directly to `ChatHistory`.
Updated `VectorSearchService` to use the renamed `CreateReformulateQuestionAsync` method for consistency. These changes improve code clarity, maintainability, and functionality.
Updated `ProductVersion` in `ApplicationDbContextModelSnapshot.cs`
to target the stable release version `10.0.0`.
Added `TinyHelpers.AspNetCore.OpenApi` to `Program.cs` and
enabled OpenAPI options by uncommenting `RemoveServerList`
and `AddDefaultProblemDetailsResponse`. These changes improve
API documentation and error handling.
Updated the copilot-instructions.md file to reflect the use of the latest version of C#, changing the reference from "C# 13" to "C# 14". This ensures the guidelines remain up-to-date with the latest language features.
Enhanced support for SQL Server's `SqlVector<float>` for embeddings, replacing `float[]` to improve vector search compatibility. Added a reconnect modal for better handling of server disconnections, including UI, styles, and JavaScript logic.
Upgraded to .NET 10.0 and EF Core 10.0, updated dependencies, and improved token counting logic for embeddings. Updated documentation and configuration files to reflect these changes. Migrated database schema to support `SqlVector<float>`.