Skip to content

Review follow-up: migrate LocalVectorStore to async fs I/O #94

@amondnet

Description

@amondnet

Original Review Suggestion

Using writeFileSync (and readFileSync) blocks the event loop. Since these are called within async methods, it is recommended to use the asynchronous node:fs/promises API to avoid blocking the application, especially as the vector index grows.

Reviewer: @gemini-code-assist
PR: #92
File: packages/store/src/local/vector-store.ts (line 124)
Comment: #92 (comment)

Status

Decision: Skipped
Reason: This store is a zero-dependency dev-fallback for small JSON files where sync I/O is acceptable. Migrating to node:fs/promises would be a significant refactor with no practical benefit at current scale.

Action Items

  • Migrate readFileSync / writeFileSync in open() / flush() to node:fs/promises equivalents
  • Update flush() to return Promise<void> and make callers await it
  • Revisit if LocalVectorStore starts being used with large indexes in production paths

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions