Skip to content

pc index vector query: empty --namespace coerced to __default__ #85

@matthewwalk

Description

@matthewwalk

Background Info

  • OS: macOS (Darwin 25.x)
  • Browser: N/A (CLI-only; no browser involved)
  • CLI Version: 0.4.5 (output of pc version)
  • How did you install the CLI? Homebrew

Reproduction steps

Steps:

  1. Confirm the index has vectors under the empty-string namespace, e.g. pc index stats --index-name <index-name> shows a "" key in namespaces with a non-zero vector_count.
  2. Save a query vector as a JSON file containing only a JSON array of floats (e.g. vec.json with [0.1, 0.2, ...]).
  3. Authenticate with pc (e.g. browser login / user token) and set project context with pc target as usual.
  4. Run:
pc index vector query \
  --index-name <index-name> \
  --namespace "" \
  --vector vec.json \
  --top-k 5 \
  --include-metadata \
  --json
  1. Observe the CLI output: it reports Namespace: __default__ (human table) or JSON containing "namespace":"__default__", with no matches (or an empty table), even though stats show vectors under "".

Expected behavior

The query should target namespace "", consistent with Pinecone REST POST https://<index-host>/query when the request body includes "namespace": "".

Screenshots

CLI output is effectively only {"namespace":"__default__"} with no useful matches, or the human-readable table shows Namespace: __default__ with no rows, while pc index stats still shows all vectors under the "" namespace key.

Additional context

Add any other context about the problem here.

  • Actual vs REST: The same query vector sent via REST POST /query with "namespace": "" returns expected neighbours; the issue appears specific to how the CLI passes or defaults --namespace.
  • Hypothesis: Empty --namespace may be treated as unset and fall back to __default__, rather than being sent as an explicit empty string.
  • Workaround: Use the data-plane REST POST https://<index-host>/query with "namespace": "" in the JSON body until CLI behaviour matches.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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