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
refactor: use single sparse index for hybrid and keyword search (reviewer feedback)
refactor: use single sparse index for hybrid and keyword search
- Remove keywordIndex; use sparseIndex from ensureIndexes() for keywordSearch and listNamespacesFromKeywordIndex
- Remove sparseIndexName config (PINECONE_SPARSE_INDEX_NAME, --sparse-index-name) and DEFAULT_SPARSE_INDEX_NAME
- getSparseIndexName() now returns ${indexName}-sparse. Addresses reviewer: sparse_index and keyword_index are the same index
|`PINECONE_API_KEY`| Yes | - | Your Pinecone API key |
64
64
|`PINECONE_INDEX_NAME`| No |`rag-hybrid`| Pinecone index name (dense + sparse for hybrid) |
65
-
|`PINECONE_SPARSE_INDEX_NAME`| No |`pinecone-rag-sparse`| Sparse index for `keyword_search` tool |
66
65
|`PINECONE_RERANK_MODEL`| No |`bge-reranker-v2-m3`| Reranking model |
67
66
|`PINECONE_READ_ONLY_MCP_LOG_LEVEL`| No |`INFO`| Logging level |
68
67
@@ -146,7 +145,6 @@ node node_modules/@will-cppa/pinecone-read-only-mcp/dist/index.js --api-key YOUR
146
145
```
147
146
--api-key TEXT Pinecone API key (or set PINECONE_API_KEY env var)
148
147
--index-name TEXT Pinecone index name [default: rag-hybrid]
149
-
--sparse-index-name TEXT Sparse index for keyword_search [default: pinecone-rag-sparse]
150
148
--rerank-model TEXT Reranking model [default: bge-reranker-v2-m3]
151
149
--log-level TEXT Logging level [default: INFO]
152
150
--help, -h Show help message
@@ -342,7 +340,7 @@ Returns the **unique document count** matching a metadata filter and semantic qu
342
340
343
341
### `keyword_search`
344
342
345
-
Performs **keyword (lexical/sparse-only)** search over the dedicated sparse index (default: `pinecone-rag-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.
343
+
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.
346
344
347
345
**Parameters:**
348
346
@@ -363,7 +361,7 @@ Performs **keyword (lexical/sparse-only)** search over the dedicated sparse inde
363
361
"status": "success",
364
362
"query": "contracts C++",
365
363
"namespace": "wg21-papers",
366
-
"index": "pinecone-rag-sparse",
364
+
"index": "rag-hybrid-sparse",
367
365
"result_count": 5,
368
366
"results": [
369
367
{
@@ -518,7 +516,7 @@ npm test
518
516
```bash
519
517
PINECONE_API_KEY=your-key npm run test:search
520
518
```
521
-
If the sparse index (`pinecone-rag-sparse` by default) does not exist or has no data, the keyword search step is skipped with a warning.
519
+
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.
522
520
523
521
2.**Via MCP client:**
524
522
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`).
- Count: Use the count tool for "how many X?" questions; it uses semantic search only and minimal fields (no content) for performance, returning unique document count.
48
46
- URL Generation: Use generate_urls to synthesize URLs for namespaces that support it when metadata lacks url.
49
47
- Document reassembly: Use query_documents to get whole documents (chunks grouped and merged by document_number/doc_id/url) for content analysis or summarization.
50
-
- Keyword search: Use keyword_search to query the sparse index (e.g. pinecone-rag-sparse) for lexical/keyword-only retrieval without reranking.
48
+
- Keyword search: Use keyword_search to query the sparse index (default: rag-hybrid-sparse) for lexical/keyword-only retrieval without reranking.
51
49
52
50
Usage:
53
51
1. Use list_namespaces (cached for 30 minutes) to discover available namespaces in the index
0 commit comments