{"record":{"id":"c2cf5b7d2d358149","repo":"mem0ai/mem0","slug":"vectorbucketname-is-required","errorCode":null,"errorMessage":"vectorBucketName is required","messagePattern":"vectorBucketName is required","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"mem0-ts/src/oss/src/vector_stores/s3_vectors.ts","lineNumber":49,"sourceCode":"interface S3VectorsClientLike {\n  send(command: any): Promise<any>;\n}\n\nexport class S3Vectors implements VectorStore {\n  private readonly config: S3VectorsConfig;\n  private readonly vectorBucketName: string;\n  private readonly collectionName: string;\n  private readonly dimension: number;\n  private readonly distanceMetric: \"cosine\" | \"euclidean\";\n  private client?: S3VectorsClientLike;\n  private clientPromise?: Promise<S3VectorsClientLike>;\n  private sdkPromise?: Promise<any>;\n  private _initPromise?: Promise<void>;\n  private cachedUserId?: string;\n\n  constructor(config: S3VectorsConfig) {\n    if (!config.vectorBucketName) {\n      throw new Error(\"vectorBucketName is required\");\n    }\n    if (!config.collectionName) {\n      throw new Error(\"collectionName is required\");\n    }\n\n    const dimension = config.embeddingModelDims ?? config.dimension;\n    if (!dimension || dimension < 1) {\n      throw new Error(\"embeddingModelDims or dimension is required\");\n    }\n\n    this.config = config;\n    this.vectorBucketName = config.vectorBucketName;\n    this.collectionName = config.collectionName;\n    this.dimension = dimension;\n    this.distanceMetric = config.distanceMetric || \"cosine\";\n\n    void this.initialize().catch(console.error);\n  }","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/mem0-ts/src/oss/src/vector_stores/s3_vectors.ts#L31-L67","documentation":"The S3 Vectors vector store requires an existing S3 Vectors bucket name at construction. Unlike some other stores, it cannot derive or create one, so a missing/falsy vectorBucketName fails fast in the constructor.","triggerScenarios":"new S3Vectors({ collectionName: 'x', dimension: 1536 }) with no vectorBucketName; config read from env vars where S3_VECTORS_BUCKET is unset; empty string passed for the bucket.","commonSituations":"New integration setup where the bucket was created in AWS console but the name was never wired into config; env var name typo; deploying without the bucket provisioned via IaC.","solutions":["Create an S3 Vectors bucket in AWS (aws s3vectors create-vector-bucket --vector-bucket-name my-bucket) and pass its name in config","Load the bucket name from environment/SSM and verify it is non-empty before constructing the store","Check for typos in the config key — it must be exactly vectorBucketName"],"exampleFix":"// before\nconst vs = new S3Vectors({ collectionName: 'memories', dimension: 1536 });\n\n// after\nconst vs = new S3Vectors({\n  vectorBucketName: process.env.S3_VECTORS_BUCKET!,\n  collectionName: 'memories',\n  dimension: 1536,\n});","handlingStrategy":"validation","validationCode":"function assertS3VectorsConfig(c: any): void {\n  if (!c?.vectorBucketName) throw new Error('vectorBucketName is required');\n}\nassertS3VectorsConfig(config);","typeGuard":"const hasBucket = (c: any): c is { vectorBucketName: string } =>\n  typeof c?.vectorBucketName === 'string' && c.vectorBucketName.length > 0;","tryCatchPattern":"try { const vs = new S3Vectors(config); } catch (e) { if (e instanceof Error && e.message === 'vectorBucketName is required') { /* provision bucket or fix env, not retryable */ } throw e; }","preventionTips":["Provision the S3 Vectors bucket with IaC and export its name into config","Assert required config keys in one startup validator for all vector stores","Add integration tests that construct stores with real-shaped config objects"],"tags":["s3-vectors","aws","configuration","bucket","typescript"],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}