mem0ai/mem0 · critical · Error
vectorBucketName is required
Error message
vectorBucketName is required
What it means
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.
Source
Thrown at mem0-ts/src/oss/src/vector_stores/s3_vectors.ts:49
interface S3VectorsClientLike {
send(command: any): Promise<any>;
}
export class S3Vectors implements VectorStore {
private readonly config: S3VectorsConfig;
private readonly vectorBucketName: string;
private readonly collectionName: string;
private readonly dimension: number;
private readonly distanceMetric: "cosine" | "euclidean";
private client?: S3VectorsClientLike;
private clientPromise?: Promise<S3VectorsClientLike>;
private sdkPromise?: Promise<any>;
private _initPromise?: Promise<void>;
private cachedUserId?: string;
constructor(config: S3VectorsConfig) {
if (!config.vectorBucketName) {
throw new Error("vectorBucketName is required");
}
if (!config.collectionName) {
throw new Error("collectionName is required");
}
const dimension = config.embeddingModelDims ?? config.dimension;
if (!dimension || dimension < 1) {
throw new Error("embeddingModelDims or dimension is required");
}
this.config = config;
this.vectorBucketName = config.vectorBucketName;
this.collectionName = config.collectionName;
this.dimension = dimension;
this.distanceMetric = config.distanceMetric || "cosine";
void this.initialize().catch(console.error);
}View on GitHub (pinned to 001c235229)
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
Example fix
// before
const vs = new S3Vectors({ collectionName: 'memories', dimension: 1536 });
// after
const vs = new S3Vectors({
vectorBucketName: process.env.S3_VECTORS_BUCKET!,
collectionName: 'memories',
dimension: 1536,
}); Defensive patterns
Strategy: validation
Validate before calling
function assertS3VectorsConfig(c: any): void {
if (!c?.vectorBucketName) throw new Error('vectorBucketName is required');
}
assertS3VectorsConfig(config); Type guard
const hasBucket = (c: any): c is { vectorBucketName: string } =>
typeof c?.vectorBucketName === 'string' && c.vectorBucketName.length > 0; Try / catch
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; } Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- collectionName is required
- embeddingModelDims or dimension is required
- Together API key is required
- Failed to parse googleServiceAccountJson: ${err.message}
- Vertex AI could not determine a Google Cloud project ID. Set
AI-assisted analysis of mem0ai/mem0@001c235229 (2026-08-15).
Data as JSON: /api/errors/c2cf5b7d2d358149.
Report an issue: GitHub.