{"record":{"id":"46ec48f7daeb4fc9","repo":"ruvnet/ruflo","slug":"agentdb-not-initialized","errorCode":null,"errorMessage":"AgentDB not initialized","messagePattern":"AgentDB not initialized","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/@claude-flow/plugins/src/integrations/agentic-flow.ts","lineNumber":571,"sourceCode":"    this.initialized = true;\n  }\n\n  /**\n   * Shutdown AgentDB.\n   */\n  async shutdown(): Promise<void> {\n    if (!this.initialized) return;\n\n    this.vectors.clear();\n    this.initialized = false;\n  }\n\n  /**\n   * Store a vector.\n   */\n  async store(id: string, vector: Float32Array, metadata?: Record<string, unknown>): Promise<void> {\n    if (!this.initialized) {\n      throw new Error('AgentDB not initialized');\n    }\n\n    if (vector.length !== this.config.dimensions) {\n      throw new Error(`Vector dimension mismatch: expected ${this.config.dimensions}, got ${vector.length}`);\n    }\n\n    const entry: VectorEntry = {\n      id,\n      vector,\n      metadata,\n      timestamp: new Date(),\n    };\n\n    this.vectors.set(id, entry);\n\n    this.emit(AGENTIC_FLOW_EVENTS.MEMORY_STORED, {\n      id,\n      timestamp: new Date(),","sourceCodeStart":553,"sourceCodeEnd":589,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/@claude-flow/plugins/src/integrations/agentic-flow.ts#L553-L589","documentation":"The built-in vector store (AgentDB shim inside the integration) guards store() with an initialized flag that only initialize() sets and shutdown() clears. store() is the first check it performs, before dimension validation, so this error always means lifecycle ordering, not bad data.","triggerScenarios":"store() before await initialize({...}) resolves; init fired without await so a subsequent store races it; storing after shutdown() cleared the flag; init failed (e.g. bad config) and the failure was swallowed before store was attempted.","commonSituations":"Plugin onInitialize seeding embeddings before awaiting DB init; fire-and-forget init calls; restart flows that reuse a store instance after shutdown.","solutions":["await vectorStore.initialize(config) before any store call","Store the init promise and await it at every entry point (seed function, request handler) rather than calling initialize() multiple times","After shutdown(), re-initialize before storing again"],"exampleFix":"// before\ndb.initialize({ dimensions: 1536 }); // not awaited\nawait db.store('v1', vec); // Error: AgentDB not initialized\n\n// after\nconst ready = db.initialize({ dimensions: 1536 });\nawait ready;\nawait db.store('v1', vec);","handlingStrategy":"validation","validationCode":"const dbReady = db.initialize({ dimensions: 1536 }); // one awaited promise\nasync function put(id: string, vec: Float32Array): Promise<void> {\n  await dbReady;\n  await db.store(id, vec);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Await initialize() before any store; share the ready promise across call sites","Do not fire-and-forget init in one function and store in another","After shutdown(), re-initialize before further writes"],"tags":["agentdb","vectors","initialization-order","async"],"backgroundTag":"not-initialized","analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}