Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
e2028ff
Added `IVectorTextResultItem.Similarity` and marked `IVectorTextResul…
crpietschmann Apr 23, 2025
f322873
added Azure Document Intelligence example to semantic search PDF file
crpietschmann Apr 23, 2025
1908df1
Update index.md
crpietschmann Apr 23, 2025
b48de90
Update build-release.yml
crpietschmann Apr 23, 2025
43daf22
Update build-release.yml
crpietschmann Apr 23, 2025
ba7cbd9
Update dotnet-tests.yml
crpietschmann Apr 23, 2025
e5db27d
Update dotnet-tests.yml
crpietschmann Apr 23, 2025
8097abc
update readmes
crpietschmann Apr 23, 2025
0be0110
Update dotnet-tests.yml
crpietschmann Apr 23, 2025
fb65b42
Update dotnet-tests.yml
crpietschmann Apr 23, 2025
3ae999c
Update dotnet-tests.yml
crpietschmann Apr 23, 2025
c80cb9a
Update dotnet-tests.yml
crpietschmann Apr 23, 2025
e8beaac
Update ghpages-mkdocs.yml
crpietschmann Apr 23, 2025
ad494e8
Update dotnet-tests.yml
crpietschmann Apr 23, 2025
69bc498
Update ghpages-mkdocs.yml
crpietschmann Apr 23, 2025
81d7178
Update dotnet-tests.yml
crpietschmann Apr 23, 2025
ba09465
Update dotnet-tests.yml
crpietschmann Apr 23, 2025
cffa9ea
Update dotnet-tests.yml
crpietschmann Apr 23, 2025
afdd3b9
Update dotnet-tests.yml
crpietschmann Apr 23, 2025
31f6577
Update dotnet-tests.yml
crpietschmann Apr 23, 2025
66a47be
Update dotnet-tests.yml
crpietschmann Apr 23, 2025
7762423
Update dotnet-tests.yml
crpietschmann Apr 23, 2025
bc96931
Update dotnet-tests.yml
crpietschmann Apr 23, 2025
1c2d336
Update dotnet-tests.yml
crpietschmann Apr 23, 2025
6da3bcb
Update dotnet-tests.yml
crpietschmann Apr 23, 2025
58a891a
Update dotnet-tests.yml
crpietschmann Apr 23, 2025
57f1d67
Update dotnet-tests.yml
crpietschmann Apr 23, 2025
7591b8e
Update dotnet-tests.yml
crpietschmann Apr 23, 2025
e335d27
Update dotnet-tests.yml
crpietschmann Apr 23, 2025
b1df42d
Update dotnet-tests.yml
crpietschmann Apr 23, 2025
52ef390
Update dotnet-tests.yml
crpietschmann Apr 23, 2025
f13a1f8
Update dotnet-tests.yml
crpietschmann Apr 23, 2025
35a6ce4
Update dotnet-tests.yml
crpietschmann Apr 23, 2025
bba3570
Update dotnet-tests.yml
crpietschmann Apr 23, 2025
6553071
Update dotnet-tests.yml
crpietschmann Apr 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
name: Build and Release
name: Build Release

on:
push:
branches:
- main
- dev
paths-ignore:
- 'docs/**'
- mkdocs.yml
pull_request:
branches:
- main
- dev
paths-ignore:
- 'docs/**'
- mkdocs.yml
Expand Down Expand Up @@ -39,6 +31,15 @@ jobs:
- name: Build
run: dotnet build --configuration Release --no-restore

- name: Run tests with code coverage
run: dotnet test --no-build --verbosity normal --results-directory "./TestResults/Coverage/" --collect:"XPlat Code Coverage"

- name: Upload test results artifact
uses: actions/upload-artifact@v4
with:
name: test-results
path: '**/TestResults/**'

- name: Performance Test
run: dotnet run --project SharpVectorPerformance --configuration Release

Expand Down
144 changes: 135 additions & 9 deletions .github/workflows/dotnet-tests.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
name: .NET Tests

on:
push:
branches:
- main
- dev
paths-ignore:
- 'docs/**'
- 'mkdocs.yml'
pull_request:
branches:
- main
Expand All @@ -18,7 +11,7 @@ on:
workflow_dispatch:

jobs:
build:
tests:
runs-on: ubuntu-latest
defaults:
run:
Expand All @@ -40,10 +33,143 @@ jobs:
run: dotnet build --no-restore

- name: Run tests with code coverage
run: dotnet test --no-build --verbosity normal --results-directory "./TestResults/Coverage/" --collect:"XPlat Code Coverage"
run: dotnet test --no-build --verbosity normal --results-directory "./TestResults/Coverage/" --logger "trx;LogFileName=test_results.trx" --collect:"XPlat Code Coverage"

# - name: Publish test results
# uses: dorny/test-reporter@v1
# with:
# name: tests
# path: src/TestResults/Coverage/test_results.trx
# reporter: dotnet-trx
# fail-on-error: true

- name: Upload test results artifact
uses: actions/upload-artifact@v4
with:
name: test-results
path: '**/TestResults/**'




- name: Install xmlstarlet
run: sudo apt-get update && sudo apt-get install -y xmlstarlet

- name: Summarize test results from .trx
run: |
TRX_FILE="TestResults/Coverage/test_results.trx"

# Register the namespace (ns) and query using that
PASSED=$(xmlstarlet sel -N ns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010" -t -v "count(//ns:UnitTestResult[@outcome='Passed'])" "$TRX_FILE")
FAILED=$(xmlstarlet sel -N ns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010" -t -v "count(//ns:UnitTestResult[@outcome='Failed'])" "$TRX_FILE")
SKIPPED=$(xmlstarlet sel -N ns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010" -t -v "count(//ns:UnitTestResult[@outcome='NotExectured'])" "$TRX_FILE")
TOTAL=$(xmlstarlet sel -N ns="http://microsoft.com/schemas/VisualStudio/TeamTest/2010" -t -v "count(//ns:UnitTestResult)" "$TRX_FILE")

echo "## 🧪 Test Results Summary" >> $GITHUB_STEP_SUMMARY

# Write message based on test outcome
if [ "$FAILED" -eq 0 ]; then
echo "✅ All tests passed!" >> $GITHUB_STEP_SUMMARY
else
echo "❌ $FAILED test(s) failed!" >> $GITHUB_STEP_SUMMARY
fi

BAR_LENGTH=10

make_bar() {
COUNT=$1
TOTAL=$2
CHAR=$3
FILLED=$(( (COUNT * BAR_LENGTH + TOTAL / 2) / TOTAL ))
EMPTY=$(( BAR_LENGTH - FILLED ))

BAR=""
for ((i=0; i<FILLED; i++)); do BAR+="$CHAR"; done
for ((i=0; i<EMPTY; i++)); do BAR+="⬜"; done
echo "$BAR"
}

format_pct() {
COUNT=$1
TOTAL=$2
echo "$(echo "scale=1; $COUNT*100/$TOTAL" | bc)%"
}

PASSED_BAR=$(make_bar $PASSED $TOTAL "🟩")
FAILED_BAR=$(make_bar $FAILED $TOTAL "🟥")
SKIPPED_BAR=$(make_bar $SKIPPED $TOTAL "🟨")

PASSED_PCT=$(format_pct $PASSED $TOTAL)
FAILED_PCT=$(format_pct $FAILED $TOTAL)
SKIPPED_PCT=$(format_pct $SKIPPED $TOTAL)

{
echo ""
echo "| | Count | Percent | |"
echo "|-----------|--------|---------|-------------|"
echo "| ✅ Passed | $PASSED | $PASSED_PCT | $PASSED_BAR |"
echo "| ❌ Failed | $FAILED | $FAILED_PCT | $FAILED_BAR |"
echo "| ➖ Skipped | $SKIPPED | $SKIPPED_PCT | $SKIPPED_BAR |"
echo "| 📊 Total | $TOTAL | | |"
} >> $GITHUB_STEP_SUMMARY




- name: Install ReportGenerator
run: dotnet tool install -g dotnet-reportgenerator-globaltool

- name: Generate Markdown report
run: |
reportgenerator \
-reports:./TestResults/Coverage/**/coverage.cobertura.xml \
-targetdir:./coveragereport \
-reporttypes:MarkdownSummaryGithub

- name: Append coverage to summary
run: |
echo "## Code Coverage Summary" >> $GITHUB_STEP_SUMMARY
cat ./coveragereport/SummaryGithub.md >> $GITHUB_STEP_SUMMARY

- name: Upload code coverage report
uses: actions/upload-artifact@v4
with:
name: CodeCoverage
path: ./src/TestResults/Coverage/**/coverage.cobertura.xml



performance:
runs-on: ubuntu-latest
defaults:
run:
working-directory: src

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup .NET Core
uses: actions/setup-dotnet@v2
with:
dotnet-version: '8.0.x' # Adjust the version as needed

- name: Restore dependencies
run: dotnet restore

- name: Build
run: dotnet build --no-restore

- name: Performance Test
run: dotnet run --project SharpVectorPerformance --configuration Release

- name: Performance Results
run: |
echo "## Performance Results" > $GITHUB_STEP_SUMMARY
cat ./BenchmarkDotNet.Artifacts/results/SharpVectorPerformance.MemoryVectorDatabasePerformance-report-github.md >> $GITHUB_STEP_SUMMARY

- name: Upload Performance artifact
uses: actions/upload-artifact@v4
with:
name: performance-results
path: './src/BenchmarkDotNet.Artifacts/*'
2 changes: 2 additions & 0 deletions .github/workflows/ghpages-mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ on:
- .github/workflows/ghpages-mkdocs.yml
- docs/**
- mkdocs.yml
paths-ignore:
- .github/**
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## vNext

Add:

- Added `IVectorTextResultItem.Similarity` and marked `IVectorTextResultItem.VectorComparison` obsolete. `VectorComparison` will be removed in the future.
- Added more comment metadata to code

## v2.1.1

Add:
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

`Build5Nines.SharpVector` is an in-memory vector database library designed for .NET applications. It allows you to store, search, and manage text data using vector representations. The library is customizable and extensible, enabling support for different vector comparison methods, preprocessing techniques, and vectorization strategies.

[![.NET Core Tests](https://github.com/Build5Nines/SharpVector/actions/workflows/dotnet-tests.yml/badge.svg)](https://github.com/Build5Nines/SharpVector/actions/workflows/dotnet-tests.yml)
[![Build and Release](https://github.com/Build5Nines/SharpVector/actions/workflows/build-release.yml/badge.svg)](https://github.com/Build5Nines/SharpVector/actions/workflows/build-release.yml)
[![Release Build](https://github.com/Build5Nines/SharpVector/actions/workflows/build-release.yml/badge.svg)](https://github.com/Build5Nines/SharpVector/actions/workflows/build-release.yml)
![Libraries.io dependency status for GitHub repo](https://img.shields.io/librariesio/github/build5nines/sharpvector)

[![NuGet](https://img.shields.io/nuget/v/Build5Nines.SharpVector.svg)](https://www.nuget.org/packages/Build5Nines.SharpVector/)
Expand Down
3 changes: 1 addition & 2 deletions docs/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ description: The lightweight, in-memory, semantic search, text vector database f

**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.

[![.NET Core Tests](https://github.com/Build5Nines/SharpVector/actions/workflows/dotnet-tests.yml/badge.svg)](https://github.com/Build5Nines/SharpVector/actions/workflows/dotnet-tests.yml)
[![Build and Release](https://github.com/Build5Nines/SharpVector/actions/workflows/build-release.yml/badge.svg)](https://github.com/Build5Nines/SharpVector/actions/workflows/build-release.yml)
[![Release Build](https://github.com/Build5Nines/SharpVector/actions/workflows/build-release.yml/badge.svg)](https://github.com/Build5Nines/SharpVector/actions/workflows/build-release.yml)
![Libraries.io dependency status for GitHub repo](https://img.shields.io/librariesio/github/build5nines/sharpvector)

[![NuGet](https://img.shields.io/nuget/v/Build5Nines.SharpVector.svg)](https://www.nuget.org/packages/Build5Nines.SharpVector/)
Expand Down
1 change: 1 addition & 0 deletions docs/docs/resources/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ Here's a couple helpful tutorial links with additional documentation and example
- [Enhanced In-Memory Text Vector Search in .NET with SharpVector and OpenAI Embeddings](https://build5nines.com/enhanced-in-memory-text-vector-search-in-net-with-sharpvector-and-openai-embeddings/?utm_source=github&utm_medium=sharpvector) by Chris Pietschmann
- [Build a Generative AI + RAG App in C# with Phi-3, ONNX, and SharpVector](https://build5nines.com/build-a-generative-ai-rag-app-in-c-with-phi-3-onnx-and-sharpvector/?utm_source=github&utm_medium=sharpvector) by Chris Pietschmann
- [Implementing Local RAG using Phi-3 ONNX Runtime and Sidecar Pattern on Linux App Service](https://azure.github.io/AppService/2024/09/03/Phi3-vector.html) by Tulika Chaudharie (Principal Product Manager at Microsoft for Azure App Service)
- [Semantic Search PDF Files Locally using .NET / C# and Build5Nines.SharpVector](https://build5nines.com/semantic-search-pdf-files-locally-using-c-and-build5nines-sharpvector/) by Chris Pietschmann
Loading
Loading