Build5Nines.SharpVector¶
Build5Nines.SharpVector is the lightweight, in-memory text vector database built for .NET applications. It enables fast and flexible vector-based similarity search for text data — ideal for search engines, recommendation systems, semantic analysis, and AI-enhanced features.
Vector databases are used with Generative AI solutions augmenting the LLM (Large Language Model) with the ability to load additional context data with the AI prompt using the RAG (Retrieval-Augmented Generation) design pattern.
While there are lots of large databases that can be used to build Vector Databases (like Azure CosmosDB, PostgreSQL w/ pgvector, Azure AI Search, Elasticsearch, and more), there are not many options for a lightweight vector database that can be embedded into any .NET application. Build5Nines SharpVector is the lightweight in-memory Text Vector Database for use in any .NET application that you're looking for!
"For the in-memory vector database, we're using Build5Nines.SharpVector, an excellent open-source project by Chris Pietschmann. SharpVector makes it easy to store and retrieve vectorized data, making it an ideal choice for our sample RAG implementation."
- Tulika Chaudharie, Principal Product Manager at Microsoft for Azure App Service
Basic Usage¶
Here's a really simple usage of creating a vector database, adding some text to it, then performing a semantic search on the data.
C# | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
|
🚀 Key Features¶
- 🔍 Text Embedding & Search – Store and search documents using vector similarity (cosine, Euclidean, etc.)
- 🧠 Pluggable Embeddings – Works with your own vectorizer (like OpenAI, HuggingFace, or custom)
- ⚡ In-Memory Performance – Designed for speed in local or embedded applications
- 🛠️ Lightweight & Easy to Use – Minimal dependencies, simple API
- 📦 Custom Metadata - Store additional metadata with each text entry stored in the vector database.
- 🛠️ Supports async/await - Async methods for scalable and non-blocking database operations.
- ⚡ Vector Comparisons - Supports various vector comparison methods for searching similar texts. Including cosine similarity (by default), and configurable for Euclidean distance. Or write your own custom vector comparison algorithm.
🧠 Use Cases¶
An in-memory vector databases like Build5Nines.SharpVector
provides several advantages over a traditional vector database server, particularly in scenarios that might demand high performance, low latency, and efficient resource usage.
SharpVector is great for:
-
Embedding search within desktop or server .NET applications
-
Building semantic search over documents or notes
-
Powering recommendation features based on text similarity
-
Integrating with OpenAI or local embeddings for intelligent querying
-
Offline or Edge computing with limited or no internet connectivity
-
Development and testing without the overhead of installing a server
🙌 Get Involved¶
We welcome contributions, feedback, and new ideas. Whether it's a bug report or a pull request, head over to our GitHub repository to start collaborating!
The Build5Nines SharpVector project is maintained by Chris Pietschmann, founder of Build5Nines, Microsoft MVP, HashiCorp Ambassador, and Microsoft Certified Trainer (MCT).