Sylin.Koan.Data.AI 0.8.0

dotnet add package Sylin.Koan.Data.AI --version 0.8.0
                    
NuGet\Install-Package Sylin.Koan.Data.AI -Version 0.8.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="Sylin.Koan.Data.AI" Version="0.8.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Sylin.Koan.Data.AI" Version="0.8.0" />
                    
Directory.Packages.props
<PackageReference Include="Sylin.Koan.Data.AI" />
                    
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 Sylin.Koan.Data.AI --version 0.8.0
                    
#r "nuget: Sylin.Koan.Data.AI, 0.8.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 Sylin.Koan.Data.AI@0.8.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=Sylin.Koan.Data.AI&version=0.8.0
                    
Install as a Cake Addin
#tool nuget:?package=Sylin.Koan.Data.AI&version=0.8.0
                    
Install as a Cake Tool

Koan.Data.AI

Data-layer AI integration for Koan: embeddings lifecycle, media analysis, and semantic search — all driven by convention, with attribute opt-in for automatic processing.

  • Target framework: net10.0
  • License: Apache-2.0
  • Version: 0.6.3

Install

dotnet add package Sylin.Koan.Data.AI

Core Principle

Convention over configuration. On-demand operations (embed a string, search semantically) work with zero attributes. Attributes are only needed to opt into automatic processing on entity save.


Embeddings

On-demand semantic search (no attributes required)

// Embed and search without any attribute decoration
var results = await Entity.SemanticSearch<Article>("machine learning basics", limit: 10);
var similar  = await someArticle.FindSimilar(limit: 5);

Auto-embed on save (opt-in with [Embedding])

public class Article : Entity<Article>
{
    public string Title   { get; set; } = "";
    public string Content { get; set; } = "";

    [EmbeddingIgnore]  // Exclude from embedding text
    public string InternalNotes { get; set; } = "";
}

// article.Save() → embedding computed and stored automatically

EmbeddingPolicy — control text composition

Value Behaviour
AllStrings Embed all string properties (default)
AllPublic Embed all public properties
FullJson Serialize the whole entity to JSON
Explicit Only embed properties you mark

Async embedding queue

Large or slow-to-embed entities use EmbedJob<TEntity> for background processing:

// Queue for async embedding rather than blocking the request
await EmbedJob<Article>.QueueAsync(article.Id);

// Job status
EmbedJobStatus: Pending | Processing | Completed | Failed | FailedPermanent

Media Analysis

MediaAnalysisAttribute opts an entity into automatic analysis when media files are associated with it (images, audio, video). The attribute is a lifecycle opt-in — on-demand operations work without it.

[MediaAnalysis(MediaAnalysis.Describe | MediaAnalysis.Ocr)]
public class DocumentScan : Entity<DocumentScan>
{
    public string FileUrl       { get; set; } = "";
    public string Description   { get; set; } = "";  // Populated by Describe
    public string ExtractedText { get; set; } = "";  // Populated by Ocr
}

MediaAnalysis flags

Flag What it does
Describe Generate a natural-language description of the image
Ocr Extract text from the image
Transcribe Transcribe speech from audio/video
Classify Classify content into categories
Extract Extract structured data fields

MediaAnalysisMetadata.Resolve<T>()

// Returns null if no [MediaAnalysis] attribute — no attribute = no auto-analysis
var meta = MediaAnalysisMetadata.Resolve<DocumentScan>();
if (meta is not null)
{
    // meta.Modes, meta.DescriptionProperty, meta.OcrTextProperty, etc.
}

Reference

  • ADR: docs/decisions/AI-0021-category-driven-ai-with-convention-defaults.md
  • Guide: docs/guides/ai-integration.md
  • Sample: samples/S18.Prism/ (real-world media analysis usage)
  • Related: Koan.Data.Vector for raw vector storage, Koan.AI for the chat/embed facade
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 (1)

Showing the top 1 NuGet packages that depend on Sylin.Koan.Data.AI:

Package Downloads
Sylin.Koan.Rag

Koan RAG module: entity-native corpora, agentic retrieval, emergent concept graphs, contextual chunking.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.8.0 100 5/16/2026