idx

ADR 0002: Use Binary GOB Index Serialization

Status

Accepted

Context

The first BM25 implementation serialized indices as JSON. JSON made the file human-readable, but that is not the primary requirement for this CLI.

The CLI runs locally and prioritizes low memory use, compact index files, and fast load times. JSON adds text overhead, more allocations during parsing, and a larger on-disk footprint.

Decision

The default index storage format is Go binary serialization using encoding/gob.

JSON is retained only as a secondary reference/debug format in code, and binary indices are the format written by idx init and refreshed by idx sync.

Alternatives Considered

JSON

GOB

Decision Drivers

Consequences

Positive

Negative

Operational Notes

Follow-Up Options