Rag.NET.Security.Audit.Sqlite 1.0.0

dotnet add package Rag.NET.Security.Audit.Sqlite --version 1.0.0
                    
NuGet\Install-Package Rag.NET.Security.Audit.Sqlite -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Rag.NET.Security.Audit.Sqlite" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Rag.NET.Security.Audit.Sqlite" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Rag.NET.Security.Audit.Sqlite" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Rag.NET.Security.Audit.Sqlite --version 1.0.0
                    
#r "nuget: Rag.NET.Security.Audit.Sqlite, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Rag.NET.Security.Audit.Sqlite@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Rag.NET.Security.Audit.Sqlite&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Rag.NET.Security.Audit.Sqlite&version=1.0.0
                    
Install as a Cake Tool

Rag.NET.Security.Audit.Sqlite

SQLite-backed audit logging for Rag.NET.Security: records retrieval and answer events to a local database file, with the audit behaviour and the answer-engine decorator wired in one call.

Install

dotnet add package Rag.NET.Security.Audit.Sqlite

Setup

using Rag.NET.DependencyInjection;
using Rag.NET.Security;

services.AddRagNet(rag => rag
    .UseSqliteAuditLog(o =>
    {
        o.DatabasePath = "rag-audit.db";
        o.LogQueryText = true;   // off by default
        o.LogAnswerText = true;  // off by default
    }));

LogQueryText and LogAnswerText are off by default: the audit record captures that a retrieval and an answer happened, with their correlation, without persisting the text unless you ask for it.

UseSqliteAuditLog must be called after AddRagNet — it adds a behaviour to the retrieval pipeline that AddRagNet registers. Calling it first throws InvalidOperationException naming the problem.

Registration order relative to the answer engines does not matter. The decorator is added to the answer-engine decoration seam rather than by registering IAnswerEngine, so rag.UseSqliteAuditLog().UseMapReduceAnswerEngine() and the reverse both audit every answer.

Why this is a separate package

SqliteAuditLog used to live in Rag.NET.Security, which meant Microsoft.Data.Sqlite and a native SQLitePCLRaw binary shipped to everyone using UseChunkSanitiser, UseRbac or UsePiiDetection — none of which load it (#339).

Migrating from 0.1.0

UseAuditLog() no longer exists. Two steps, and no using changes — the namespace is deliberately still Rag.NET.Security:

  1. Add a package reference to Rag.NET.Security.Audit.Sqlite.
  2. Rename UseAuditLog(…) to UseSqliteAuditLog(…).

Forgetting step 2 is a compile error, not a silent gap. The wiring that registers the audit behaviour and the answer decorator is internal to Rag.NET.Security and reachable only from a package that also supplies an IAuditLog, so "auditing configured, nothing recorded" cannot be expressed. An audit log that silently records nothing is worse than a build error.

Bringing your own log

IAuditLog lives in Rag.NET.Security. This package is one implementation of it; a different backing store would be a sibling package registering its own IAuditLog and composing the same internal wiring.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 79 9/15/2026