Skip to content

Commit 136e96b

Browse files
Merge pull request #28 from dotnet-guide-com/feature/hybrid-search-ef-core-pgvector-rebuild
Rebuild EF Core pgvector hybrid search sample
2 parents f2283c3 + 51191bf commit 136e96b

37 files changed

Lines changed: 1515 additions & 303 deletions

‎.github/workflows/build-samples.yml‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ jobs:
105105
--no-build
106106
107107
build-hybrid-search:
108-
name: Build hybrid search RRF sample
108+
name: Build and test hybrid search sample
109109
runs-on: ubuntu-latest
110110

111111
steps:
@@ -120,22 +120,21 @@ jobs:
120120
- name: Restore
121121
run: |
122122
dotnet restore \
123-
dotnet-ai/hybrid-search-ef-core-pgvector/HybridSearchMinimal.csproj
123+
dotnet-ai/hybrid-search-ef-core-pgvector/HybridSearch.slnx
124124
125125
- name: Build
126126
run: |
127127
dotnet build \
128-
dotnet-ai/hybrid-search-ef-core-pgvector/HybridSearchMinimal.csproj \
128+
dotnet-ai/hybrid-search-ef-core-pgvector/HybridSearch.slnx \
129129
--configuration Release \
130130
--no-restore
131131
132-
- name: Run sample
132+
- name: Test
133133
run: |
134-
dotnet run \
135-
--project dotnet-ai/hybrid-search-ef-core-pgvector/HybridSearchMinimal.csproj \
134+
dotnet test \
135+
dotnet-ai/hybrid-search-ef-core-pgvector/HybridSearch.slnx \
136136
--configuration Release \
137137
--no-build
138-
139138
build-aspire-orchestration:
140139
name: Build Aspire orchestration sample
141140
runs-on: ubuntu-latest

‎README.md‎

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Each sample folder contains a focused implementation of one tutorial topic. The
1010
| Sample | What it demonstrates | Full tutorial |
1111
| --- | --- | --- |
1212
| [`dotnet-ai/provider-agnostic-chat-gateway`](dotnet-ai/provider-agnostic-chat-gateway/) | .NET 10 `Microsoft.Extensions.AI` gateway with allow-listed `IChatClient` providers, bounded conversation state, SSE streaming, safe function calling, and deterministic tests | [Microsoft.Extensions.AI Tutorial: Build a Multi-Provider IChatClient Gateway](https://www.dotnet-guide.com/tutorials/dotnet-ai/provider-agnostic-chat-gateway/) |
13-
| [`dotnet-ai/hybrid-search-ef-core-pgvector`](dotnet-ai/hybrid-search-ef-core-pgvector/) | Minimal Reciprocal Rank Fusion demo combining pre-ranked keyword and vector results | [Hybrid Search in .NET with EF Core 10 and pgvector](https://www.dotnet-guide.com/tutorials/dotnet-ai/hybrid-search-ef-core-pgvector/) |
13+
| [`dotnet-ai/hybrid-search-ef-core-pgvector`](dotnet-ai/hybrid-search-ef-core-pgvector/) | Verified .NET 10 API combining PostgreSQL full-text search (GIN) and pgvector cosine retrieval (HNSW), fused with Reciprocal Rank Fusion | [Hybrid Search in .NET with EF Core 10 and pgvector](https://www.dotnet-guide.com/tutorials/dotnet-ai/hybrid-search-ef-core-pgvector/) |
1414
| [`dotnet-ai/agent-framework-incident-triage`](dotnet-ai/agent-framework-incident-triage/) | Evidence-first Microsoft Agent Framework sample with read-only tools, deterministic incident evidence, `AgentSession` reuse, and correlation-vs-causation boundaries | [Microsoft Agent Framework Tutorial in C#: Build a Tool-Using AI Agent](https://www.dotnet-guide.com/tutorials/dotnet-ai/agent-framework-incident-triage/) |
1515
| [`dotnet-aspire/orchestrate-distributed-system`](dotnet-aspire/orchestrate-distributed-system/) | Minimal Aspire AppHost coordinating a web project and API with service discovery and startup ordering | [Aspire in .NET: Orchestrate, Run, and Deploy a Distributed System from One App Host](https://www.dotnet-guide.com/tutorials/dotnet-aspire/orchestrate-distributed-system/) |
1616
| [`software-architecture/architecture-testing-dotnet`](software-architecture/architecture-testing-dotnet/) | Minimal NetArchTest.eNhancedEdition rule that prevents Domain from depending on outer layers | [Architecture Testing in .NET: Enforce Layer and Module Boundaries with NetArchTest and ArchUnitNET](https://www.dotnet-guide.com/tutorials/software-architecture/architecture-testing-dotnet/) |
@@ -62,14 +62,17 @@ dotnet test ProviderAgnosticChatGateway.slnx --configuration Release
6262
dotnet run --project .\src\ProviderAgnosticChatGateway\ProviderAgnosticChatGateway.csproj
6363
```
6464

65-
### Hybrid search RRF sample
65+
### Hybrid search with EF Core and pgvector
6666

6767
```powershell
6868
cd dotnet-ai\hybrid-search-ef-core-pgvector
69-
dotnet restore
70-
dotnet run
69+
dotnet restore .\HybridSearch.slnx
70+
dotnet build .\HybridSearch.slnx --configuration Release --no-restore
71+
dotnet test .\HybridSearch.slnx --configuration Release --no-build
7172
```
7273

74+
For the live PostgreSQL + pgvector + Ollama verification path, follow this sample folder's `README.md` and run `.\scripts\verify.ps1`.
75+
7376
### Agent Framework incident triage
7477

7578
```powershell
@@ -92,10 +95,12 @@ tutorials/
9295
| | |-- src/
9396
| | `-- tests/
9497
| `-- hybrid-search-ef-core-pgvector/
95-
| |-- HybridSearchMinimal.csproj
96-
| |-- Program.cs
97-
| `-- README.md
98-
| `-- agent-framework-incident-triage/
98+
| |-- HybridSearch.slnx
99+
| |-- docker-compose.yml
100+
| |-- README.md
101+
| |-- src/HybridSearch.Api/
102+
| |-- tests/HybridSearch.Api.Tests/
103+
| `-- scripts/verify.ps1| `-- agent-framework-incident-triage/
99104
| |-- AgentFrameworkIncidentTriage.slnx
100105
| |-- README.md
101106
| |-- global.json
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
**/bin/
2+
**/obj/
3+
.vs/
4+
.idea/
5+
*.user
6+
*.suo
7+
*.log
8+
artifacts/
9+
_automation-backup/
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<Project>
2+
<PropertyGroup>
3+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
4+
<Nullable>enable</Nullable>
5+
<ImplicitUsings>enable</ImplicitUsings>
6+
</PropertyGroup>
7+
</Project>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<Solution>
2+
<Folder Name="/src/">
3+
<Project Path="src/HybridSearch.Api/HybridSearch.Api.csproj" />
4+
</Folder>
5+
<Folder Name="/tests/">
6+
<Project Path="tests/HybridSearch.Api.Tests/HybridSearch.Api.Tests.csproj" />
7+
</Folder>
8+
</Solution>

‎dotnet-ai/hybrid-search-ef-core-pgvector/HybridSearchMinimal.csproj‎

Lines changed: 0 additions & 10 deletions
This file was deleted.

‎dotnet-ai/hybrid-search-ef-core-pgvector/Program.cs‎

Lines changed: 0 additions & 184 deletions
This file was deleted.

0 commit comments

Comments
 (0)