Skip to content

fix(vector-store): fix PostgreSQL DeleteByPrefix and update namespace defaults - #42

Merged
AbirAbbas merged 1 commit into
mainfrom
fix/doc-chatbot-namespace-and-delete
Dec 2, 2025
Merged

fix(vector-store): fix PostgreSQL DeleteByPrefix and update namespace defaults#42
AbirAbbas merged 1 commit into
mainfrom
fix/doc-chatbot-namespace-and-delete

Conversation

@AbirAbbas

Copy link
Copy Markdown
Contributor

Summary

  • Fix DeleteByPrefix to use PostgreSQL || operator for LIKE pattern - the previous approach with prefix+"%" in Go wasn't working correctly with parameter binding
  • Change default namespace from "documentation" to "website-docs" to match the frontend chat API expectations
  • Add scope: "global" to clear_namespace API call to ensure proper scope matching

Root Cause

The delete namespace API was returning deleted: 0 even when vectors existed because:

  1. The PostgreSQL LIKE pattern wasn't being constructed correctly through parameter binding
  2. The scope wasn't being explicitly passed, causing a mismatch

Test plan

  • Deploy control plane with the fix
  • Run curl -X DELETE .../api/v1/memory/vector/namespace -d '{"namespace":"website-docs", "scope":"global"}' and verify it deletes vectors
  • Re-run reindex script and verify vectors are created
  • Test chat functionality returns TypeScript examples

🤖 Generated with Claude Code

… defaults

- Fix DeleteByPrefix to use PostgreSQL || operator for LIKE pattern
  (the previous approach with prefix+"%" in Go wasn't working correctly
  with parameter binding)
- Change default namespace from "documentation" to "website-docs" to
  match the frontend chat API expectations
- Add scope: "global" to clear_namespace API call to ensure proper
  scope matching

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@AbirAbbas
AbirAbbas merged commit 0c84ca1 into main Dec 2, 2025
19 checks passed
@AbirAbbas
AbirAbbas deleted the fix/doc-chatbot-namespace-and-delete branch December 2, 2025 18:39
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