Discover Build5Nines.SharpVector¶
Build5Nines.SharpVector is the lightweight, in-memory, semantic search, 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 Semantic Search and 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, Ollama, 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.
Your IT Career Upgrade Starts Now!
We believe mentorship is the fastest, most powerful way to unlock your IT career β and master in-demand skills like Cloud, Cybersecurity, DevOps, Development, and AI. You donβt have to do it alone. Our community is here to rise with you.
Join the Build5Nines Membership and get access to exclusive courses, hands-on labs, members-only forums, and mentoring.
π§ 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:
-
Building semantic search over documents or notes
-
Embedding search within desktop or server .NET applications
-
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
βοΈ Local, OpenAI, or Ollama Embeddings Generation¶
Build5Nines.SharpVector
includes a local text vectorizer to generate embeddings for text added to the database. This is automatic and eliminates external LLM server dependencies. However, both OpenAI Embeddings and Ollama Embeddings are also supported for more robust and higher quality embeddings support.
-
Local Embeddings
Use built-in functionality to generate text vector embeddings, without server dependencies.
-
OpenAI Embeddings
Use OpenAI and/or Azure OpenAI Service embeddings models like
text-embedding-ada-002
or others. -
Ollama Embeddings
Use Ollama embeddings models like
nomic-embed-text
or others.
π Contributing¶
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).