mem0ai/mem0 · error · Error
Method 'deleteCol' not supported by LangchainVectorStore wra
Error message
Method 'deleteCol' not supported by LangchainVectorStore wrapper.
What it means
The LangchainVectorStore adapter throws this from deleteCol() because the generic LangChain vector store interface has no portable 'delete collection' operation. The wrapper only delegates methods that every underlying LangChain store exposes (addDocuments, similaritySearch, delete by id); destroying the whole collection is backend-specific. Calling deleteCol() therefore always fails by design.
Source
Thrown at mem0-ts/src/oss/src/vector_stores/langchain.ts:215
async list(
filters?: SearchFilters,
topK: number = 100,
): Promise<[VectorStoreResult[], number]> {
// No standard list method in Langchain core interface.
console.error(
`LangchainVectorStore: The 'list' method is not supported by the generic LangchainVectorStore wrapper.`,
);
throw new Error(
"Method 'list' not supported by LangchainVectorStore wrapper.",
);
// Could potentially be implemented if the underlying store has a specific list/scroll/query capability.
}
async deleteCol(): Promise<void> {
console.error(
`LangchainVectorStore: The 'deleteCol' method is not supported by the generic LangchainVectorStore wrapper.`,
);
throw new Error(
"Method 'deleteCol' not supported by LangchainVectorStore wrapper.",
);
}
// --- Wrapper-Specific Methods (In-Memory User ID) ---
async getUserId(): Promise<string> {
return this.storeUserId;
}
async setUserId(userId: string): Promise<void> {
this.storeUserId = userId;
}
async initialize(): Promise<void> {
// No specific initialization needed for the wrapper itself,
// assuming the passed Langchain client is already initialized.
return Promise.resolve();View on GitHub (pinned to 001c235229)
Solutions
- Switch to a concrete Mem0 vector store provider (qdrant, chroma, sqlite (memory.ts), etc.) if you need collection lifecycle operations.
- Delete documents by id instead: keep the ids you inserted and call the wrapper's delete(ids), which is supported.
- Subclass LangchainVectorStore and override deleteCol() to call your specific backend's destroy/drop method (e.g. client.delete({ ids: true }) for Chroma).
- For tests, recreate the underlying LangChain store instance instead of calling deleteCol().
Example fix
// before
await memory.vectorStore.deleteCol(); // throws: not supported by wrapper
// after (drop documents by id)
await memory.vectorStore.delete inserted ids via store.delete(ids);
// or subclass:
class MyLangchainStore extends LangchainVectorStore {
async deleteCol(): Promise<void> {
// backend-specific, e.g. for a Chroma-backed client:
await (this as any).lc_kwargs.client.delete({ deleteAll: true });
}
} Defensive patterns
Strategy: type-guard
Validate before calling
const canDeleteCol = (s: any): boolean => typeof s.deleteCol === 'function' && s.constructor?.name !== 'LangchainVectorStore';
Type guard
function supportsDeleteCol(store: unknown): store is { deleteCol(): Promise<void> } {
return (
!!store &&
typeof (store as any).deleteCol === 'function' &&
!(store instanceof (require('./langchain').LangchainVectorStore))
);
} Try / catch
try {
await store.deleteCol();
} catch (e) {
if (e instanceof Error && /not supported by LangchainVectorStore wrapper/.test(e.message)) {
// fall back to deleting by ids or recreating the underlying store
} else throw e;
} Prevention
- Check provider capabilities before wiring generic reset tooling: only concrete stores implement deleteCol.
- Track inserted ids so you can delete documents individually on the langchain wrapper.
- In test suites, recreate the Memory instance with a fresh underlying LangChain store instead of calling deleteCol.
When it happens
Trigger: Instantiating Memory with vectorStore: { provider: 'langchain', config: { client: <any LangChain VectorStore> } } and then calling memory.vectorStore.deleteCol(), or running a reset/wipe routine that calls deleteCol() on every configured store. Also hit by generic tooling (CLI, tests) that assumes the full VectorStoreAPI surface.
Common situations: Teams using an in-memory or niche LangChain store (e.g. MemoryVectorStore, HNSWLib) as a drop-in Mem0 backend, then trying to reset state between test runs. Migration from a concrete provider (qdrant/chroma) to the langchain wrapper where deleteCol previously worked.
Related errors
- Method 'get' not reliably supported by LangchainVectorStore
- Langchain vector store provider requires an initialized Lang
- Provided Langchain 'client' does not appear to be a valid La
- IDs array must be provided and have the same length as vecto
- Vector dimension mismatch at index ${i}. Expected ${this.dim
AI-assisted analysis of mem0ai/mem0@001c235229 (2026-08-15).
Data as JSON: /api/errors/674800e7aa5856a9.
Report an issue: GitHub.