Skip to content
This repository was archived by the owner on Sep 29, 2025. It is now read-only.

Commit 1dd81fc

Browse files
authored
(EAI-483): ingest:all command deletes pages and embeddings not in data sources (#562)
* ingest:all command deletes pages and embeddings not in data sources, default behavior is soft delete pages * refactor tests to use mongodb-memory-server, add tests for delete in ingest:all command
1 parent 7f4e4a8 commit 1dd81fc

File tree

10 files changed

+585
-138
lines changed

10 files changed

+585
-138
lines changed

package-lock.json

Lines changed: 221 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/mongodb-rag-core/src/contentStore/EmbeddedContent.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,21 @@ export interface EmbeddedContent {
6060
chunkAlgoHash?: string;
6161
}
6262

63+
export type DeleteEmbeddedContentArgs = {
64+
/**
65+
The page for which to delete embedded content.
66+
*/
67+
page?: Page;
68+
/**
69+
The names of the data sources for which to delete embedded content.
70+
*/
71+
dataSources?: string[];
72+
/**
73+
If true, delete pages that do NOT match the data sources in the query.
74+
*/
75+
inverseDataSources?: boolean;
76+
};
77+
6378
/**
6479
Data store of the embedded content.
6580
*/
@@ -72,10 +87,7 @@ export type EmbeddedContentStore = VectorStore<EmbeddedContent> & {
7287
/**
7388
Delete all embedded content for the given page and/or data sources.
7489
*/
75-
deleteEmbeddedContent(args: {
76-
page?: Page;
77-
dataSources?: string[];
78-
}): Promise<void>;
90+
deleteEmbeddedContent(args: DeleteEmbeddedContentArgs): Promise<void>;
7991

8092
/**
8193
Replace all embedded content for the given page with the given embedded content.

0 commit comments

Comments
 (0)