Skip to content

feat(vectorstore): add in-memory VectorStore with Delete method and c…#20

Merged
Parth576 merged 5 commits intomainfrom
step18-in-mem-vectorsearch
Mar 6, 2026
Merged

feat(vectorstore): add in-memory VectorStore with Delete method and c…#20
Parth576 merged 5 commits intomainfrom
step18-in-mem-vectorsearch

Conversation

@Parth576
Copy link
Owner

@Parth576 Parth576 commented Mar 5, 2026

…onfig flag

Add InMemoryStore as a lightweight alternative to Qdrant for resource-constrained deployments. Add Delete method to VectorStore interface for post-analysis vector cleanup. Wire conditional store initialization via VECTOR_STORE env var (default: memory).

  • Add Delete(ctx, collectionID, url, contentHash) to VectorStore interface
  • Create InMemoryStore with sync.RWMutex thread safety
  • Add no-op Delete to QdrantStore (logs and returns nil)
  • Add VECTOR_STORE config field (memory|qdrant, default: memory)
  • Update main.go for conditional store initialization
  • Add Delete pass-through to RAG pipeline
  • Call Delete in analyzer after caching results
  • 13 unit tests for InMemoryStore (all pass with -race)

Assisted by the code-assist SOP

Parth576 added 5 commits March 4, 2026 23:55
…onfig flag

Add InMemoryStore as a lightweight alternative to Qdrant for
resource-constrained deployments. Add Delete method to VectorStore
interface for post-analysis vector cleanup. Wire conditional store
initialization via VECTOR_STORE env var (default: memory).

- Add Delete(ctx, collectionID, url, contentHash) to VectorStore interface
- Create InMemoryStore with sync.RWMutex thread safety
- Add no-op Delete to QdrantStore (logs and returns nil)
- Add VECTOR_STORE config field (memory|qdrant, default: memory)
- Update main.go for conditional store initialization
- Add Delete pass-through to RAG pipeline
- Call Delete in analyzer after caching results
- 13 unit tests for InMemoryStore (all pass with -race)

Assisted by the code-assist SOP
…ryStore

Replace placeholder Search() with brute-force dot product similarity:
- Add dotProduct() helper for computing vector similarity
- Filter chunks by URL and contentHash before scoring
- Skip chunks with nil/empty vectors
- Sort results by score descending, return top N
- Log search operations with structured fields (collection, filters, results, latency_ms)
- Handle edge cases: empty collection, limit <= 0, fewer results than limit

Add 12 new tests covering all acceptance criteria and update existing
tests to include vector data for compatibility with real search logic.

Assisted by the code-assist SOP
…or in-memory default

- Add `profiles: [qdrant]` to Qdrant service in docker-compose.yml
- Remove `depends_on: qdrant` and `QDRANT_URL` env override from backend service
- Update README.md to document in-memory as default, Qdrant as optional via --profile
- Update CLAUDE.md tech stack and build commands to reflect new defaults
- Document VECTOR_STORE env var throughout

Note: .env.example needs manual update to add VECTOR_STORE=memory (sandbox restriction).

Assisted by the code-assist SOP
@Parth576 Parth576 merged commit 9353c0b into main Mar 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant