Titan and Cohere
Amazon Titan Text Embeddings and Cohere Embed. The model family is detected from the model id; Cohere requests are batched.
LM-Kit's embedding layer is an interface, not a fixed backend. The
LM-Kit.NET.Integrations.Aws package implements
IEmbedder on top of Amazon Bedrock, so Amazon Titan and
Cohere embedding models plug into the same RAG pipeline as local
models. Run local for private data, Bedrock for scale, or both,
without changing the pipeline around them.
Amazon Titan Text Embeddings and Cohere Embed. The model family is detected from the model id; Cohere requests are batched.
Pass the embedder to RagEngine with a local tokenizer. Chunking stays local; vectors come from Bedrock.
The same IEmbedder contract local models implement. Switching providers is a constructor change, not a rewrite.
RAG, semantic search, and clustering all consume vectors through
IEmbedder. Because the contract is provider-agnostic, the
model behind it is a deployment decision, not an architectural one. The
Bedrock bridge is one implementation of that contract.
Swap Bedrock for a local model, or the reverse, by changing which IEmbedder you construct. The RAG pipeline does not change.
Keep sensitive corpora on a local model and route high-volume workloads to Bedrock. Both sit behind the same interface.
BedrockEmbedder plugs into RagEngine exactly like a local embedder. Import, chunking, and retrieval are unchanged.
For Cohere, queries and passages are embedded with the correct input_type automatically, improving retrieval recall.
Region and credentials resolve through the standard AWS credential chain (environment, shared profile, or IAM role). The library never handles secrets.
Inject a pre-configured IAmazonBedrockRuntime for full control over endpoints, retries, and testing, or use the region constructor.
The region constructor uses the default AWS credential chain. Pass an explicit dimension for Titan v2 when you want one.
using Amazon; using LMKit.Integrations.Aws.Embeddings; // Region constructor resolves credentials from the default AWS chain. var embedder = new BedrockEmbedder( modelId: "amazon.titan-embed-text-v2:0", region: RegionEndpoint.USEast1, dimensions: 1024);
A remote embedder produces the vectors; a small local model tokenizes and chunks during import. Retrieval is identical to a fully local setup.
using LMKit.Model; using LMKit.Retrieval; // Local model chunks/tokenizes; Bedrock produces the vectors. using var tokenizer = LM.LoadFromModelID("bge-small"); var rag = new RagEngine(embedder, tokenizer); await rag.ImportTextAsync(handbookText, "docs", "handbook"); var hits = await rag.FindMatchingPartitionsAsync("expense policy", topK: 5);
Cohere models are batched and distinguish queries from passages. The embedder sets the right input_type for each call.
using Amazon; using LMKit.Integrations.Aws.Embeddings; var cohere = new BedrockEmbedder("cohere.embed-multilingual-v3", RegionEndpoint.EUWest1); // Passages use input_type=search_document, queries use search_query. float[][] passages = await cohere.GetEmbeddingsAsync(new[] { "doc a", "doc b" }); float[] query = await cohere.GetQueryEmbeddingsAsync("semantic search text");
Persist the vectors in production stores. Official connectors for Qdrant and PostgreSQL/pgvector implement the same IVectorStore the built-in path uses.
Any IEmbeddingGenerator from the .NET AI ecosystem can be used as an LM-Kit IEmbedder, and the reverse.
Full-document workflows with source attribution and adaptive ingestion, on whichever embedder you choose.
Cosine similarity, reranking, and hybrid retrieval over the vectors Bedrock produces.
Working console demos on GitHub, step-by-step how-to guides on the docs site, and the API reference for the classes used on this page.