Add filter with metadata using restricts
This commit is contained in:
19
README.md
19
README.md
@@ -6,7 +6,24 @@ An MCP (Model Context Protocol) server that exposes a `knowledge_search` tool fo
|
||||
|
||||
1. A natural-language query is embedded using a Gemini embedding model.
|
||||
2. The embedding is sent to a Vertex AI Matching Engine index endpoint to find nearest neighbors.
|
||||
3. The matched document contents are fetched from a GCS bucket and returned to the caller.
|
||||
3. Optional filters (restricts) can be applied to search only specific source folders.
|
||||
4. The matched document contents are fetched from a GCS bucket and returned to the caller.
|
||||
|
||||
## Filtering by Source Folder
|
||||
|
||||
The `knowledge_search` tool supports filtering results by source folder:
|
||||
|
||||
```python
|
||||
# Search all folders
|
||||
knowledge_search(query="what is a savings account?")
|
||||
|
||||
# Search only in specific folders
|
||||
knowledge_search(
|
||||
query="what is a savings account?",
|
||||
source_folders=["Educacion Financiera", "Productos y Servicios"]
|
||||
)
|
||||
```
|
||||
|
||||
|
||||
## Prerequisites
|
||||
|
||||
|
||||
Reference in New Issue
Block a user