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
|`PINECONE_API_KEY`| Yes | - | Your Pinecone API key |
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
+
|`PINECONE_RERANK_MODEL`| No |`bge-reranker-v2-m3`| Reranking model |
67
+
|`PINECONE_READ_ONLY_MCP_LOG_LEVEL`| No |`INFO`| Logging level |
67
68
68
69
### Claude Desktop Configuration
69
70
@@ -143,11 +144,12 @@ node node_modules/@will-cppa/pinecone-read-only-mcp/dist/index.js --api-key YOUR
143
144
### Available Options
144
145
145
146
```
146
-
--api-key TEXT Pinecone API key (or set PINECONE_API_KEY env var)
147
-
--index-name TEXT Pinecone index name [default: rag-hybrid]
148
-
--rerank-model TEXT Reranking model [default: bge-reranker-v2-m3]
149
-
--log-level TEXT Logging level [default: INFO]
150
-
--help, -h Show help message
147
+
--api-key TEXT Pinecone API key (or set PINECONE_API_KEY env var)
148
+
--index-name TEXT Pinecone index name [default: rag-hybrid]
149
+
--sparse-index-name TEXT Sparse index for keyword_search [default: pinecone-rag-sparse]
150
+
--rerank-model TEXT Reranking model [default: bge-reranker-v2-m3]
151
+
--log-level TEXT Logging level [default: INFO]
152
+
--help, -h Show help message
151
153
```
152
154
153
155
## Deployment
@@ -338,6 +340,45 @@ Returns the **unique document count** matching a metadata filter and semantic qu
338
340
}
339
341
```
340
342
343
+
### `keyword_search`
344
+
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.
|`namespace`| string | Yes | - | Namespace to search (use `list_namespaces` to discover) |
353
+
|`top_k`| integer | No |`10`| Number of results to return (1-100) |
354
+
|`metadata_filter`| object | No | - | Optional metadata filter (same operators as `query`) |
355
+
|`fields`| string[]| No | - | Optional field names to return; omit for all fields |
356
+
357
+
**Returns:** JSON with `status`, `query`, `namespace`, `index` (sparse index name), `result_count`, and `results` (ids, metadata, scores). Result rows match the `query` tool shape (e.g. `paper_number`, `title`, `author`, `url`, `content`, `score`, `reranked: false`).
358
+
359
+
**Example response:**
360
+
361
+
```json
362
+
{
363
+
"status": "success",
364
+
"query": "contracts C++",
365
+
"namespace": "wg21-papers",
366
+
"index": "pinecone-rag-sparse",
367
+
"result_count": 5,
368
+
"results": [
369
+
{
370
+
"paper_number": "P0548",
371
+
"title": "Contracts for C++",
372
+
"author": "John Doe",
373
+
"url": "https://...",
374
+
"content": "...",
375
+
"score": 0.85,
376
+
"reranked": false
377
+
}
378
+
]
379
+
}
380
+
```
381
+
341
382
### `query`
342
383
343
384
Performs hybrid semantic search over the specified namespace in the Pinecone index with optional metadata filtering. For **count** questions, use the `count` tool instead.
@@ -470,6 +511,18 @@ npm run build
470
511
npm test
471
512
```
472
513
514
+
### Testing the keyword_search tool
515
+
516
+
1.**Connectivity and keyword search (script):**
517
+
Run the search test script (includes a keyword search step against the sparse index):
518
+
```bash
519
+
PINECONE_API_KEY=your-key npm run test:search
520
+
```
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.
522
+
523
+
2.**Via MCP client:**
524
+
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.
46
48
- URL Generation: Use generate_urls to synthesize URLs for namespaces that support it when metadata lacks url.
47
49
- 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
51
49
52
Usage:
50
53
1. Use list_namespaces (cached for 30 minutes) to discover available namespaces in the index
0 commit comments