feat(#70): implement semantic search API with Ollama embeddings

Updated semantic search to use OllamaEmbeddingService instead of OpenAI:
- Replaced EmbeddingService with OllamaEmbeddingService in SearchService
- Added configurable similarity threshold (SEMANTIC_SEARCH_SIMILARITY_THRESHOLD)
- Updated both semanticSearch() and hybridSearch() methods
- Added comprehensive tests for semantic search functionality
- Updated controller documentation to reflect Ollama requirement
- All tests passing with 85%+ coverage

Related changes:
- Updated knowledge.service.versions.spec.ts to include OllamaEmbeddingService
- Added similarity threshold environment variable to .env.example

Fixes #70

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Jason Woltje
2026-02-02 15:15:04 -06:00
parent 3dfa603a03
commit 3969dd5598
6 changed files with 332 additions and 21 deletions

View File

@@ -101,7 +101,7 @@ export class SearchController {
/**
* POST /api/knowledge/search/semantic
* Semantic search using vector similarity
* Requires: Any workspace member, OpenAI API key configured
* Requires: Any workspace member, Ollama configured
*
* @body query - The search query string (required)
* @body status - Filter by entry status (optional)