You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add per-source descriptions and per-namespace declared schemas from p… (#204)
* Add per-source descriptions and per-namespace declared schemas from private config
* fixed format errors
* Address PR review: fix test-search script, tighten description validation, harden tests/docs
Co-authored-by: Cursor <cursoragent@cursor.com>
* Fix stale-namespace warnings and surface namespace descriptions on list_namespaces
* addressed reviews: not.toContain(corpusPlaceholder) - clearest intent: "this exact text must not be in the instructions."
* created namespace-cache.ts for removing the duplication
---------
Co-authored-by: zho <jornathanm910923@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,8 +8,15 @@ Tagged releases are published to npm from GitHub Actions when a **GitHub Release
8
8
9
9
## [Unreleased]
10
10
11
+
### Added
12
+
13
+
-**Per-source and per-namespace private config:** optional `description` (source-level) and `namespaces` map (`description` + declared `metadata_schema`) in JSON config files (`PINECONE_CONFIG_FILE` only — not inline `PINECONE_SOURCES`). Declared schemas skip live sampling; stale declared namespaces surface as `config_warnings` in `list_namespaces`. See [CONFIGURATION.md](docs/CONFIGURATION.md#json-config-file).
14
+
-**`list_namespaces`:** optional per-namespace `schema_source` (`declared` | `sampled`), optional per-namespace `description` (from private config), and top-level `config_warnings` when private config declarations do not match live Pinecone data.
-**Breaking (library API):**`PineconeClient.listNamespacesWithMetadata()` now returns `{ namespaces, warnings }` instead of a bare array. Migration: [MIGRATION.md § Unreleased PineconeClient.listNamespacesWithMetadata](docs/MIGRATION.md#unreleased-pineconeclientlistnamespaceswithmetadata-return-shape).
13
20
-**Instructions:** Trimmed operator/install/deploy content (env-var setup, misconfiguration note, Alliance CLI index/rerank defaults, stderr logging config) from `CORE_SERVER_INSTRUCTIONS` and `ALLIANCE_INSTRUCTIONS_APPENDIX` — reduces per-session token cost; no behavior change. Replaced colliding Alliance appendix steps 4–5 with unnumbered "Manual Alliance flow" bullets (includes `PINECONE_DISABLE_SUGGEST_FLOW=true` escape clause). Full detail remains in [docs/CONFIGURATION.md](docs/CONFIGURATION.md).
Copy file name to clipboardExpand all lines: docs/CONFIGURATION.md
+12-1Lines changed: 12 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,6 +75,17 @@ Set `PINECONE_CONFIG_FILE` (or `--config-file`) to a path such as [examples/mult
75
75
76
76
Values support `${ENV_VAR}` indirection (resolved at startup). Per-source `sparseIndexName` and `rerankModel` are optional; Alliance defaults apply when omitted.
77
77
78
+
Optional **config-file-only** fields (not supported in inline `PINECONE_SOURCES`):
79
+
80
+
| Field | Scope | Purpose |
81
+
| ----- | ----- | ------- |
82
+
|`description`| Per source | Short corpus/content hint surfaced via `list_sources` (helps LLM routing across sources or MCP entries) |
83
+
|`namespaces`| Per source | Map of namespace name → `{ description?, metadata_schema? }`; per-namespace `description` is surfaced via `list_namespaces` on matching live rows |
84
+
85
+
`metadata_schema` is a flat `fieldName → type` map (same vocabulary as `list_namespaces` → `metadata_fields`, e.g. `"title": "string"`). When declared for a live namespace, the server **skips live sampling** for that namespace and trusts the declared schema until the config file changes. Namespaces declared in config but absent from Pinecone produce a non-fatal `config_warnings` entry in `list_namespaces` (never a startup failure).
86
+
87
+
**Never** commit real corpus descriptions, namespace names, or internal field names to the open-source repo — use generic placeholders in examples only. Real values belong in staff-machine private config files per [Deployment profiles](#deployment-profiles). See [SECURITY.md](./SECURITY.md).
88
+
78
89
### MCP tools and routing
79
90
80
91
| Tool |`source` parameter |
@@ -131,7 +142,7 @@ Multi-source mode supports two operational profiles. **Never** ship a merged int
131
142
}
132
143
```
133
144
134
-
Prefer `PINECONE_CONFIG_FILE` with `${ENV_VAR}` indirection over inline API keys in `PINECONE_SOURCES`. See [SECURITY.md](./SECURITY.md).
145
+
Prefer `PINECONE_CONFIG_FILE` with `${ENV_VAR}` indirection over inline API keys in `PINECONE_SOURCES`. For internal deployments, add optional `description` and `namespaces` declarations in the JSON config file on staff machines only — never in public examples or committed constants. See [SECURITY.md](./SECURITY.md).
Copy file name to clipboardExpand all lines: docs/MIGRATION.md
+50Lines changed: 50 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,56 @@ This guide is for **library and MCP client authors** upgrading from earlier **0.
6
6
7
7
Under [semver 0.y.z](https://semver.org/spec/v2.0.0.html#spec-item-4), **0.1.x → 0.2.0 is a breaking minor** — pin `@0.2.0` only after reading this guide.
8
8
9
+
## Unreleased: `list_sources` response shape
10
+
11
+
**Who is affected:** MCP clients parsing `list_sources` success JSON in multi-source mode.
12
+
13
+
**Before:**
14
+
15
+
```json
16
+
{
17
+
"status": "success",
18
+
"sources": ["api_key_1", "api_key_2"],
19
+
"default": "api_key_1"
20
+
}
21
+
```
22
+
23
+
**After:**
24
+
25
+
```json
26
+
{
27
+
"status": "success",
28
+
"sources": [
29
+
{ "name": "api_key_1", "description": "Optional corpus hint from private config" },
30
+
{ "name": "api_key_2" }
31
+
],
32
+
"default": "api_key_1"
33
+
}
34
+
```
35
+
36
+
Read `sources[].name` instead of treating `sources` as `string[]`. `description` is omitted when not configured.
// warnings: string[] — e.g. stale declared namespace not found live
55
+
```
56
+
57
+
Optional `declaredSchemas` argument skips live sampling for namespaces with a declared schema.
58
+
9
59
## Unreleased: Stable vs experimental response fields
10
60
11
61
**Rationale:** Tool success payloads mixed stable contract fields with experimental diagnostics (`degraded`, `decision_trace`, etc.) at the top level. Experimental fields are now nested under `experimental` so consumers know which fields are safe across minor version bumps.
Copy file name to clipboardExpand all lines: docs/SECURITY.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,6 +23,10 @@ Tool responses returned to MCP clients (and LLM consumers) are sanitized in `src
23
23
24
24
This covers tool error payloads, hybrid degradation reasons, and SDK error text surfaced in DEBUG log mode — not only stderr logs.
25
25
26
+
## Private config content (descriptions and schemas)
27
+
28
+
Per-source `description` and per-namespace `namespaces` (including namespace names and `metadata_schema` field names) loaded from `PINECONE_CONFIG_FILE` are **High**-risk if committed to the open-source repo or shared through public distribution channels — they can disclose what private corpora contain and which internal metadata fields exist. Keep real values on staff machines only; use generic placeholders in examples and tests. Same deployment-profile separation as API keys — see [CONFIGURATION.md § Deployment profiles](./CONFIGURATION.md#deployment-profiles).
0 commit comments