Skip to content

Latest commit

 

History

History
87 lines (65 loc) · 2.59 KB

README.md

File metadata and controls

87 lines (65 loc) · 2.59 KB

Weaviate.Client.Managed Documentation

Type-safe, attribute-driven Weaviate client for .NET. Define schemas with C# attributes, query with LINQ-style expressions.

Quick Navigation

Document Description
Getting Started 5-minute quickstart
Guide Complete user guide
Architecture System design and decisions
API Reference Complete API surface

Reference

Document Description
Attributes All 14 attributes with properties and examples
Mapping Type conversion, vectors, references
Migrations Schema evolution and breaking changes

Advanced & Operations

Document Description
Advanced Multi-tenancy, multi-vector, RAG, ConfigMethod
Best Practices Collection design, performance, testing
Dependency Injection DI patterns for ASP.NET Core
Roadmap Current state and future vision

Installation

dotnet add package Weaviate.Client.Managed

Minimal Example

using Weaviate.Client;
using Weaviate.Client.Managed.Attributes;
using Weaviate.Client.Managed.Extensions;

// Define your model
[WeaviateCollection("Articles")]
public class Article
{
    [Property]
    public string Title { get; set; } = "";

    [Property]
    public string Content { get; set; } = "";

    [Vector<Vectorizer.Text2VecOpenAI>(SourceProperties = [nameof(Title), nameof(Content)])]
    public float[]? Embedding { get; set; }
}

// Use it
var client = new WeaviateClient(new WeaviateConfig { Host = "localhost:8080" });
var articles = await client.Collections.CreateManaged<Article>();

await articles.Insert(new Article { Title = "Hello", Content = "World" });

var results = await articles.Query
    .NearText("greeting")
    .Limit(10)
    .Execute();

// Access results
foreach (var result in results)
{
    Console.WriteLine($"{result.Object.Title}: Score={result.Metadata?.Score}");
}

// Or extract just objects when metadata not needed
var objects = results.Objects();

Terminology

This library uses "Managed" terminology:

  • ManagedCollection<T> - Type-safe collection wrapper
  • CreateManaged<T>() - Create a managed collection
  • UseManaged<T>() - Get existing collection as managed (collection name from attribute)
  • AsManaged<T>() - Wrap existing collection client

Historical note: Earlier development used "CollectionMapper" and "WOMP" terminology.