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
* updated project structure
* fixed format check results
* updated to use default rerank model
* addressed first reviewer's suggestions
* update README.md
* updated to introduce default index name
---------
Co-authored-by: zho <jornathanm910923@gmail.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,6 +8,11 @@ Tagged releases are published to npm from GitHub Actions when a **GitHub Release
8
8
9
9
## [Unreleased]
10
10
11
+
### Changed
12
+
13
+
- Package root export is the generic **core** layer (`setupCoreServer`); full CLI parity uses `@will-cppa/pinecone-read-only-mcp/alliance` (`setupAllianceServer`, built-in URL generators). `resolveConfig` uses env when set, else defaults: index **`rag-hybrid`**, rerank **`bge-reranker-v2-m3`** (constants `DEFAULT_INDEX_NAME` / `DEFAULT_RERANK_MODEL` in `src/core/config.ts`).
14
+
- When reranking was requested but `PineconeClient` has no rerank model (manual library use): `query` / `query_documents` include `rerank_skipped_reason: no_model`; `guided_query` sets `decision_trace.rerank_status: skipped_no_model`.
15
+
11
16
### Added
12
17
13
18
-`UrlGeneratorFn` type alias (same as `UrlGenerator`) and `RegisterBuiltinUrlGeneratorsOptions` with `reinstallBuiltins` on `registerBuiltinUrlGenerators()` to restore default `mailing` / `slack-Cpplang` generators after overrides; README “Custom URL generators” section and tests for custom registration and built-in override.
-**`src/alliance/`** — C++ Alliance app tools (`suggest_query_params`, `guided_query`, Boost/Slack URL builtins). Import from `@will-cppa/pinecone-read-only-mcp/alliance` and call `setupAllianceServer(config)` for the full tool surface (what the CLI uses).
93
+
87
94
## Configuration
88
95
89
-
You need a **Pinecone API key** and (by default) a **dense** index plus matching **sparse**index; see [docs/CONFIGURATION.md](docs/CONFIGURATION.md) for every environment variable and CLI flag.
96
+
You need a **Pinecone API key**. **Index**uses `PINECONE_INDEX_NAME` when set, else defaults to `rag-hybrid`; sparse index defaults to `{index}-sparse`. **Reranking**uses `PINECONE_RERANK_MODEL` when set, else `bge-reranker-v2-m3`. MCP configs with only `PINECONE_API_KEY` keep prior Alliance defaults. See [docs/CONFIGURATION.md](docs/CONFIGURATION.md) for every variable and CLI flag.
|`PINECONE_API_KEY`| Yes (for live Pinecone) | — |
96
-
|`PINECONE_INDEX_NAME`| No |`rag-hybrid`|
103
+
|`PINECONE_INDEX_NAME`| No |`rag-hybrid` when unset |
104
+
|`PINECONE_RERANK_MODEL`| No |`bge-reranker-v2-m3` when unset |
97
105
|`PINECONE_SPARSE_INDEX_NAME`| No |`{index}-sparse`|
98
106
|`PINECONE_READ_ONLY_MCP_LOG_LEVEL`| No |`INFO` (`DEBUG`–`ERROR`) |
99
107
|`PINECONE_READ_ONLY_MCP_LOG_FORMAT`| No |`text` (`json` for log pipelines) |
@@ -102,31 +110,37 @@ Run `pinecone-read-only-mcp --help` for CLI equivalents (`--cache-ttl-seconds`,
102
110
103
111
### Deployment model
104
112
105
-
The server uses **process-global** memory for the suggest-flow gate (`suggest_query_params` context), namespaces cache, URL generator registry, and active configuration. **Stdio MCP (one client per Node process)** matches this model. If you embed `setupServer` behind a multi-tenant HTTP transport, isolate those structures per session yourself or treat the suggest-flow guard as best-effort only.
113
+
The server uses **process-global** memory for the suggest-flow gate (`suggest_query_params` context), namespaces cache, URL generator registry, and active configuration. **Stdio MCP (one client per Node process)** matches this model. If you embed `setupAllianceServer` behind a multi-tenant HTTP transport, isolate those structures per session yourself or treat the suggest-flow guard as best-effort only.
106
114
107
-
### Library embedding (`setupServer`)
115
+
### Library embedding
108
116
109
-
Treat **`setupServer()` as one logical server per Node process**: it mutates shared module singletons (suggest-flow map, namespaces cache, URL registry, config context, shared `PineconeClient` slot). A **second**`setupServer()` in the same process **throws** unless you call **`teardownServer()`** first.
117
+
Treat **`setupCoreServer()`/ `setupAllianceServer()`as one logical server per Node process**: they mutate shared module singletons (suggest-flow map, namespaces cache, URL registry, config context, shared `PineconeClient` slot). A **second**setup call in the same process **throws** unless you call **`teardownServer()`** first.
110
118
111
-
Recommended pattern: `resolveConfig` → `setPineconeClient(new PineconeClient(...))` → `await setupServer(config)` → connect one MCP transport. For tests or re-initialization in the same process, call `teardownServer()` then `setupServer(config)` again. For isolated production tenants, prefer **one server per Node process** (or separate OS processes) rather than sharing one embedder across tenants.
119
+
-**Generic bridge only:**`import { setupCoreServer, teardownServer, ... } from '@will-cppa/pinecone-read-only-mcp'`
120
+
-**Full Alliance surface (CLI parity):**`import { setupAllianceServer } from '@will-cppa/pinecone-read-only-mcp/alliance'`
112
121
113
-
Import `setupServer` and `teardownServer` from `@will-cppa/pinecone-read-only-mcp`. See [examples/library-embedding-demo.ts](examples/library-embedding-demo.ts) and [docs/TOOLS.md](docs/TOOLS.md#suggest-flow-gate).
122
+
Recommended pattern: `resolveConfig({ apiKey, indexName, ... })` → `setPineconeClient(new PineconeClient(...))` → `await setupAllianceServer(config)` → connect one MCP transport. See [examples/library-embedding-demo.ts](examples/library-embedding-demo.ts) and [docs/TOOLS.md](docs/TOOLS.md#suggest-flow-gate).
114
123
115
124
### Custom URL generators
116
125
117
126
Namespaces other than `mailing` and `slack-Cpplang` (or different URL rules for any namespace) can use programmatic registration — no fork required.
118
127
119
-
Import `registerUrlGenerator` and types `UrlGeneratorFn` / `UrlGenerationResult` from `@will-cppa/pinecone-read-only-mcp`. Register **additional** namespaces before tools that emit URLs run (typically right after `setupServer` resolves config). To **replace** the built-in `mailing`or`slack-Cpplang` generators, call `registerUrlGenerator`**after**`setupServer`, because `setupServer` installs the defaults first.
128
+
Import `registerUrlGenerator` and types `UrlGeneratorFn` / `UrlGenerationResult` from `@will-cppa/pinecone-read-only-mcp`. Register **additional** namespaces before tools that emit URLs run. Built-in `mailing`/`slack-Cpplang` generators are installed by `setupAllianceServer` (not by `setupCoreServer`).
@@ -436,7 +454,7 @@ Returns the **unique document count** matching a metadata filter and semantic qu
436
454
437
455
### `keyword_search`
438
456
439
-
Performs **keyword (lexical/sparse-only)** search over the dedicated sparse index (default: `rag-hybrid-sparse`, i.e. `{PINECONE_INDEX_NAME}-sparse`). Use for exact or keyword-style queries. Does not use the dense index or semantic reranking. Call `list_namespaces` first to discover namespaces; `suggest_query_params` is optional.
457
+
Performs **keyword (lexical/sparse-only)** search over the sparse index (`{PINECONE_INDEX_NAME}-sparse` by default). Use for exact or keyword-style queries. Does not use the dense index or semantic reranking. Call `list_namespaces` first to discover namespaces; `suggest_query_params` is optional.
440
458
441
459
**Parameters:**
442
460
@@ -457,7 +475,7 @@ Performs **keyword (lexical/sparse-only)** search over the dedicated sparse inde
457
475
"status": "success",
458
476
"query": "contracts C++",
459
477
"namespace": "wg21-papers",
460
-
"index": "rag-hybrid-sparse",
478
+
"index": "your-index-sparse",
461
479
"result_count": 5,
462
480
"results": [
463
481
{
@@ -624,7 +642,7 @@ The script prints a table of p50, p95, and p99 latencies in milliseconds and wri
624
642
PINECONE_API_KEY=your-key npm run test:search
625
643
```
626
644
627
-
If the sparse index (`rag-hybrid-sparse` by default) does not exist or has no data, the keyword search step is skipped with a warning.
645
+
If the sparse index (`{PINECONE_INDEX_NAME}-sparse`) does not exist or has no data, the keyword search step is skipped with a warning.
628
646
629
647
2.**Via MCP client:**
630
648
Start the server and call the `keyword_search` tool with `query_text`, `namespace` (from `list_namespaces`), and optional `top_k` or `metadata_filter`. Response shape is the same as the `query` tool (e.g. `results` with ids, metadata, scores; `reranked` is always `false`).
|`logFormat`|`logFormat` / `PINECONE_READ_ONLY_MCP_LOG_FORMAT`|`text` or `json`|
@@ -28,6 +28,12 @@ Configuration is built from **CLI flags** (when using the binary), **environment
28
28
29
29
**Throws** if `apiKey` is missing after trim.
30
30
31
+
For the full Alliance tool surface (including `suggest_query_params`, `guided_query`, and built-in URL generators), import from `@will-cppa/pinecone-read-only-mcp/alliance` and call `setupAllianceServer(config)`.
32
+
33
+
### Rerank model
34
+
35
+
`resolveConfig` uses `PINECONE_INDEX_NAME` / `PINECONE_RERANK_MODEL` when set; otherwise **`rag-hybrid`** and **`bge-reranker-v2-m3`**. MCP configs that only set `PINECONE_API_KEY` keep the same defaults as before.
36
+
31
37
---
32
38
33
39
## CLI flags (`parseCli` / `src/cli.ts`)
@@ -52,9 +58,9 @@ Configuration is built from **CLI flags** (when using the binary), **environment
52
58
53
59
## Library embedding
54
60
55
-
1. Build `ServerConfig` with `resolveConfig({ apiKey: '...', ... })` or pass explicit overrides.
56
-
2. Construct `PineconeClient` and `setPineconeClient(client)` before `setupServer(config)` (mirrors `src/index.ts`).
57
-
3.`await setupServer(config)` then connect an MCP transport.
61
+
1. Build `ServerConfig` with `resolveConfig({ apiKey: '...', indexName: '...', ... })` or pass explicit overrides.
62
+
2. Construct `PineconeClient` and `setPineconeClient(client)` before `setupAllianceServer(config)` (mirrors `src/index.ts`).
63
+
3.`await setupAllianceServer(config)` (or `setupCoreServer` for generic tools only) then connect an MCP transport.
58
64
59
65
See [README deployment model](../README.md#deployment-model) and [examples/library-embedding-demo.ts](../examples/library-embedding-demo.ts).
|[custom-url-generator.ts](./custom-url-generator.ts)| Embed the MCP server as a library, register a **custom URL generator** for a namespace, and wire `PineconeClient` + `setupServer()`. |
6
-
|[suggest-flow-demo.ts](./suggest-flow-demo.ts)| Document the **suggest_query_params → query** gate sequence and trimmed namespace usage. |
7
-
|[guided-query-demo.ts](./guided-query-demo.ts)| Document **guided_query** and the **`decision_trace`** payload. |
0 commit comments