Skip to content

[task] Add metadata schema version field for document chunks #80

Description

@AlexanderGardiner

Checks

  • I searched open and closed issues and pull requests and did not find a duplicate.

Area

Source

Goal

Add a scalar metadata version field to document-derived chunks so future retrieval and migration logic can distinguish old metadata shapes from newer ones.

The chunk metadata schema already calls out schema versioning as an open question. As Anchor adds extractor metadata, file ingestion, offsets, and chunk position fields, stored chunks may start to have different metadata shapes depending on when they were ingested.

A simple version field gives downstream callers a stable way to interpret stored metadata without guessing.

Suggested file locations

Scope

Add a document metadata schema version for chunks produced from file/document ingestion.

The implementation should:

  • Add a scalar metadata field such as schema_version: 1.
  • Apply it to document-derived chunks during file ingestion.
  • Keep the value Chroma-compatible.
  • Document what the version means in the chunk metadata schema.
  • Preserve all existing metadata fields.

Out of scope

  • Do not migrate existing stored chunks.
  • Do not add a general migration framework.
  • Do not add schema validation infrastructure.
  • Do not change MemoryStore.
  • Do not add new dependencies.
  • Do not apply this to agent write-back memory unless the implementation already has a clear document-only boundary.

Definition of done

  • Document-derived chunks include schema_version.
  • The schema doc describes the field and its initial value.
  • Tests verify the field is present on file-ingested chunks.
  • Existing metadata such as source, source_format, questions, timestamp, offsets, and chunk position fields are preserved where applicable.
  • Existing text-ingestion behavior remains compatible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: sourceApplication or library source code.help wantedMaintainers would welcome a community contribution on this work.kind: featureA user-facing capability request.needs: duplicate-reviewAutomation found similar existing work that needs maintainer review.status: ready-for-workTriaged and ready for a contributor to claim.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions