dotnet / dotnet/skills

[dotnet-ai] MEAI embeddings

Open
#228 0 comments 0 reactions 0 assignees View on GitHub
area-ai skill
Dominant language
C#
Stars
5.4k
Forks
415
Avg merge
1d 5h
Merged PRs (30d)
81

Description

## 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>` 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 generation** — `GenerateAsync()` for one input, `GenerateAsync(IEnumerable)` for batches
- **Dimension selection** — choosing embedding dimensions based on the model and use case
- **Caching** — `UseDistributedCache()` 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`

Contributor guide

Open the contributing guide

Research direction

Start with the plugin scaffold dependency and inspect the requested files: plugins/dotnet-ai/skills/meai-embeddings/SKILL.md and tests/dotnet-ai/meai-embeddings/eval.yaml. Add guidance for IEmbeddingGenerator setup, batching, dimensions, caching, and normalization without duplicating meai-chat-integration content. Done means valid frontmatter, complete coverage, and at least one passing semantic-search evaluation scenario.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
ai, documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.