{"record":{"id":"cbe3842eb9a61dbd","repo":"mem0ai/mem0","slug":"method-list-not-supported-by-langchainvectorstor","errorCode":null,"errorMessage":"Method 'list' not supported by LangchainVectorStore wrapper.","messagePattern":"Method 'list' not supported by LangchainVectorStore wrapper\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"mem0-ts/src/oss/src/vector_stores/langchain.ts","lineNumber":205,"sourceCode":"    } else {\n      console.error(\n        `LangchainVectorStore: The underlying Langchain store instance does not seem to support a 'delete' method.`,\n      );\n      throw new Error(\n        \"Method 'delete' not available on the provided Langchain VectorStore client.\",\n      );\n    }\n  }\n\n  async list(\n    filters?: SearchFilters,\n    topK: number = 100,\n  ): Promise<[VectorStoreResult[], number]> {\n    // No standard list method in Langchain core interface.\n    console.error(\n      `LangchainVectorStore: The 'list' method is not supported by the generic LangchainVectorStore wrapper.`,\n    );\n    throw new Error(\n      \"Method 'list' not supported by LangchainVectorStore wrapper.\",\n    );\n    // Could potentially be implemented if the underlying store has a specific list/scroll/query capability.\n  }\n\n  async deleteCol(): Promise<void> {\n    console.error(\n      `LangchainVectorStore: The 'deleteCol' method is not supported by the generic LangchainVectorStore wrapper.`,\n    );\n    throw new Error(\n      \"Method 'deleteCol' not supported by LangchainVectorStore wrapper.\",\n    );\n  }\n\n  // --- Wrapper-Specific Methods (In-Memory User ID) ---\n\n  async getUserId(): Promise<string> {\n    return this.storeUserId;","sourceCodeStart":187,"sourceCodeEnd":223,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0-ts/src/oss/src/vector_stores/langchain.ts#L187-L223","documentation":"list() is unimplemented because Langchain's core VectorStore interface has no enumeration/scroll capability, and the wrapper cannot generically enumerate documents across heterogeneous stores. It throws (with a console.error) instead of returning an incomplete or fabricated listing.","triggerScenarios":"Calling store.list(filters, topK) directly, or any Memory flow (e.g. delete-all, history listing, get-all) that internally enumerates vectors while using the langchain provider.","commonSituations":"Calling memory.getAll() or memory.deleteAll() over a langchain-backed Memory instance; migrating an app from a provider that supports list.","solutions":["If the underlying store has its own enumeration API (e.g. FAISS index traversal, Chroma collection.get), call it directly and manage ids yourself.","Maintain your own id registry (DB/file) of inserted memory ids so listing/deleting can be done via targeted delete calls.","Switch to a provider with native list support (qdrant, chroma, pgvector, elasticsearch) if enumeration-based Memory APIs are required."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"// Keep an id registry so list() is never required:\nawait fs.writeFile(`ids/${memoryId}.txt`, JSON.stringify(payload));\n// enumeration = reading the registry instead of store.list()","typeGuard":null,"tryCatchPattern":"try {\n  const [results, total] = await store.list(filters, topK);\n} catch (e) {\n  if (e instanceof Error && e.message.includes(\"Method 'list' not supported\")) {\n    // fallback: enumerate via your own id registry + targeted deletes/lookups\n  }\n  throw e;\n}","preventionTips":["Do not call memory.getAll()/deleteAll() with the langchain provider.","Maintain your own registry of inserted memory ids.","Choose a provider with native list/scroll if enumeration is needed."],"tags":["langchain","unsupported-operation","list","typescript"],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}