Skip to content

fix: exclude vector arrays from CLI --json output#337

Open
dingguagua996-stack wants to merge 1 commit intoCortexReach:masterfrom
dingguagua996-stack:fix/issue-302
Open

fix: exclude vector arrays from CLI --json output#337
dingguagua996-stack wants to merge 1 commit intoCortexReach:masterfrom
dingguagua996-stack:fix/issue-302

Conversation

@dingguagua996-stack
Copy link

Summary

The --json output for list, search, and stats CLI commands included full vector arrays (768-1024 dimensional floats per entry), making output extremely verbose and unreadable.

Changes

Use a JSON replacer function in formatJson() to automatically filter out vector fields from all CLI JSON output. This is consistent with the export command which already strips vectors (line 888: vector: undefined).

Before

{
  "id": "abc123",
  "text": "Some memory",
  "vector": [0.023, -0.045, 0.012, ...],  // 768+ numbers!
  ...
}

After

{
  "id": "abc123",
  "text": "Some memory",
  ...
}

Files Changed

File Change
cli.ts formatJson() now uses JSON replacer to exclude vector key

Fixes #302

The --json output for list/search/stats commands included full vector
arrays (768-1024 dimensional floats), making output extremely verbose
and unreadable.

Use a JSON replacer function in formatJson() to automatically filter
out 'vector' fields. This is consistent with the export command which
already strips vectors (line 888).

Fixes CortexReach#302
@AliceLJY
Copy link
Collaborator

方向对,CLI --json 去掉 vector 数组确实是刚需。

麻烦 rebase 到最新 master(我们刚发了 beta.10),然后补一个 test/cli-smoke.mjs 的断言:search 和 list 的 --json 输出里不包含 "vector" 字段。

rebase + 补测试后可以合 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI --json output includes verbose vector array making it unreadable

2 participants