Skip to content

[dotnet-ai] MEAI embeddings #228

Description

@luisquintanilla

Parent Issue

Part of the dotnet-ai plugin proposal: #225

Summary

Add the meai-embeddings skill to the dotnet-ai plugin.

This skill guides developers through generating text embeddings in .NET using Microsoft.Extensions.AI's IEmbeddingGenerator<string, Embedding<float>> abstraction. Embeddings are the foundation for semantic similarity, vector search, RAG, clustering by meaning, and document deduplication.

What This Skill Covers

  • IEmbeddingGenerator setup with any provider (OpenAI, Azure OpenAI, Ollama, etc.)
  • Single and batch embedding generationGenerateAsync() for one input, GenerateAsync(IEnumerable) for batches
  • Dimension selection — choosing embedding dimensions based on the model and use case
  • CachingUseDistributedCache() middleware to avoid redundant embedding calls
  • Normalization — when and why to normalize embedding vectors
  • Integration points — how embeddings feed into vector storage (vector-data-search) and RAG pipelines (rag-pipeline)

What This Skill Does NOT Cover

  • Extracting features from structured/tabular data (use mlnet)
  • Storing or searching vectors (use vector-data-search)
  • End-to-end RAG pipelines (use rag-pipeline)
  • Chat/text generation (use meai-chat-integration)

Files

plugins/dotnet-ai/skills/meai-embeddings/SKILL.md
tests/dotnet-ai/meai-embeddings/eval.yaml

Eval Scenarios

  1. Generate embeddings for semantic search — prompt asks to generate embeddings for a collection of documents; expects IEmbeddingGenerator with batch processing and dimension selection

Key Packages

  • Microsoft.Extensions.AI (core)
  • Provider: OpenAI, Azure.AI.OpenAI, or OllamaSharp

Dependencies

Requires the plugin scaffold (sub-issue #1) to be merged first.

Acceptance Criteria

  • SKILL.md has valid YAML frontmatter with name and description
  • Covers IEmbeddingGenerator setup, batching, dimension selection, caching
  • eval.yaml has at least one scenario that validates the skill
  • Does not duplicate content from meai-chat-integration

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions