Skip to content

🔧 [P0] Fix multiple JSON/API correctness issues #124

Closed

Description

@ajianaz

Problem

Three quick-fix issues affecting API correctness and production stability:

1. Embedding vector leaked in JSON output

Memory.embedding (768 floats = 3KB per memory) is serialized in --json output for get, recall, search, list, aging preview, and import.

Fix: Add #[serde(skip_serializing)] on the embedding field in crates/uteke-core/src/memory/types.rs.

2. expect() panic in VectorIndex creation

Index::new(&options).expect("Failed to create usearch index") in crates/uteke-core/src/memory/vector.rs:251 will abort the entire process if usearch fails to allocate.

Fix: Return Result<> instead of panicking. Propagate error to caller with proper handling.

3. import() does not persist vector index

Uteke::import() inserts items one at a time into the vector index but never calls index.save(). If the process crashes mid-import, all imported vectors are lost. Contrast with remember() which calls index.save().ok() after every insert.

Fix: Call index.save() after the import loop completes (or batch-save periodically for large imports).

Acceptance Criteria

  • --json output excludes embedding vectors (verified with get and recall)
  • VectorIndex::create_index() returns Result instead of using expect()
  • import() persists the vector index after completion
  • All existing tests pass

Effort: ~1 hour

Activity

  1. ajianaz commented on Jun 2, 2026

    @ajianaz
    CollaboratorAuthor

    Fixed in #146 — skip_serializing on embedding, import() persists index, better panic message

  2. added a commit that references this issue on Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope:core

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions