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
<PackageReference Include="Sylin.Koan.Data.AI" Version="0.8.0" />
<PackageVersion Include="Sylin.Koan.Data.AI" Version="0.8.0" />
<PackageReference Include="Sylin.Koan.Data.AI" />
paket add Sylin.Koan.Data.AI --version 0.8.0
#r "nuget: Sylin.Koan.Data.AI, 0.8.0"
#:package Sylin.Koan.Data.AI@0.8.0
#addin nuget:?package=Sylin.Koan.Data.AI&version=0.8.0
#tool nuget:?package=Sylin.Koan.Data.AI&version=0.8.0
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.Vectorfor raw vector storage,Koan.AIfor the chat/embed facade
| Product | Versions 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. |
-
net10.0
- Sylin.Koan.AI (>= 0.8.0)
- Sylin.Koan.AI.Contracts (>= 0.8.0)
- Sylin.Koan.Core (>= 0.8.0)
- Sylin.Koan.Data.Abstractions (>= 0.8.0)
- Sylin.Koan.Data.Core (>= 0.8.0)
- Sylin.Koan.Data.Vector (>= 0.8.0)
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 |
See release notes: https://github.com/sylin-labs/Koan-framework/releases