feat: Automate Qdrant PDF ingestion via Media hooks
All checks were successful
Build & Deploy / 🔍 Prepare (push) Successful in 7s
Build & Deploy / 🧪 QA (push) Successful in 1m1s
Build & Deploy / 🏗️ Build (push) Successful in 4m22s
Build & Deploy / 🚀 Deploy (push) Successful in 1m41s
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s

This commit is contained in:
2026-03-08 01:08:55 +01:00
parent 7f1aeaee7e
commit 1dc52da677
4 changed files with 161 additions and 1 deletions

View File

@@ -152,6 +152,31 @@ export async function deleteProductVector(id: string | number) {
}
}
/**
* Delete knowledge chunks by their source Media ID
*/
export async function deleteKnowledgeByMediaId(mediaId: string | number) {
try {
await ensureCollection();
await qdrant.delete(COLLECTION_NAME, {
wait: true,
filter: {
must: [
{
key: 'mediaId',
match: {
value: mediaId,
},
},
],
},
});
console.log(`Successfully deleted Qdrant chunks for Media ID: ${mediaId}`);
} catch (error) {
console.error('Error deleting knowledge by Media ID from Qdrant:', error);
}
}
/**
* Search products in Qdrant.
* Results are cached in Redis for 30 minutes keyed by query text.