-
Notifications
You must be signed in to change notification settings - Fork 2
Add five new fields to MCPServiceConfig and mcpKnownKeys to support
#384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
731d00f
3006e2c
dd215cd
6ffa366
f086bb9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -79,6 +79,48 @@ following table describes the embedding configuration fields: | |||||
| | `embedding_model` | string | The embedding model name (e.g., `voyage-3`, `text-embedding-3-small`, `nomic-embed-text`). Required when `embedding_provider` is set. | | ||||||
| | `embedding_api_key` | string | API key for the embedding provider. Required for `voyage` and `openai` providers. | | ||||||
|
|
||||||
| ### Knowledgebase | ||||||
|
|
||||||
| Knowledgebase support enables the `search_knowledgebase` tool to query | ||||||
| a SQLite-backed knowledge base. The knowledge base file is staged on the | ||||||
| host; the Control Plane bind-mounts it into the container read-only. | ||||||
| Knowledgebase support is opt-in. When `kb_enabled` is `false` (the | ||||||
| default), no KB file is required — and any other `kb_*` fields present | ||||||
| in the config are **rejected** by the validator, not silently ignored. | ||||||
| Only `voyage` and `openai` are supported as embedding providers for the | ||||||
| knowledgebase; Ollama support is planned for a future release. | ||||||
|
|
||||||
| !!! warning | ||||||
|
|
||||||
| The Control Plane does not generate the knowledgebase SQLite file. | ||||||
| You must place the file on every host that will run an MCP service | ||||||
| instance **before** setting `kb_enabled: true`. If the file is | ||||||
| missing when the Control Plane attempts to deploy the service, the | ||||||
| deployment will be blocked with a clear error. | ||||||
|
|
||||||
| The default location is `{data_dir}/kb/nla-kb.db` (for example, | ||||||
| `/var/lib/pgedge-control-plane/kb/nla-kb.db`). Create the directory | ||||||
| and copy your file there, or use `kb_database_host_path` to specify | ||||||
| a custom path. | ||||||
|
|
||||||
| The following table describes the knowledgebase configuration fields: | ||||||
|
|
||||||
| | Field | Type | Description | | ||||||
| |---------------------------|---------|-------------| | ||||||
| | `kb_enabled` | boolean | Set to `true` to enable knowledgebase search. When `false` (the default), any other `kb_*` fields in the config are **rejected** — they must be removed before the config is accepted. | | ||||||
| | `kb_embedding_provider` | string | Embedding provider for the KB. One of: `voyage`, `openai`. Required when `kb_enabled` is `true`. | | ||||||
| | `kb_embedding_model` | string | Embedding model for the KB (e.g., `voyage-3-lite`, `text-embedding-3-small`). Required when `kb_enabled` is `true`. | | ||||||
| | `kb_embedding_api_key` | string | API key for the KB embedding provider. Required for `voyage` and `openai`. Scrubbed from API responses. | | ||||||
| | `kb_database_host_path` | string | Full path to the KB SQLite file on the host. Defaults to `{data_dir}/kb/nla-kb.db`. Must be an absolute path. | | ||||||
|
|
||||||
| !!! note | ||||||
|
|
||||||
| Changing any `kb_*` field (provider, model, credentials, or path) | ||||||
| requires a service redeploy — not just a config reload. SIGHUP only | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it necessary to describe this distinction about service redeploys vs config reload? Users shouldn't modify the config file outside of the Control Plane API, so they should only ever use the update database endpoint. |
||||||
| reloads database connection settings and does not reinitialize the | ||||||
| knowledgebase. Use `update-database` to apply KB config changes; the | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Just want to make it clear to users that we're talking about an API endpoint. |
||||||
| Control Plane will restart the container automatically. | ||||||
|
|
||||||
| ### LLM Tuning | ||||||
|
|
||||||
| The LLM tuning fields control the behavior of the LLM proxy and are | ||||||
|
|
@@ -333,6 +375,65 @@ to use a self-hosted Ollama server for both the LLM and embeddings: | |||||
| }' | ||||||
| ``` | ||||||
|
|
||||||
| ### Knowledgebase Search (Voyage AI) | ||||||
|
|
||||||
| In the following example, a `curl` command provisions an MCP service | ||||||
| with knowledgebase support enabled, using Voyage AI as the embedding | ||||||
| provider. Before provisioning, stage the knowledgebase file on every | ||||||
| host that will run an MCP service instance: | ||||||
|
|
||||||
| ```sh | ||||||
| sudo mkdir -p /var/lib/pgedge-control-plane/kb | ||||||
| sudo cp /path/to/your/nla-kb.db /var/lib/pgedge-control-plane/kb/nla-kb.db | ||||||
| ``` | ||||||
|
|
||||||
| === "curl" | ||||||
|
|
||||||
| ```sh | ||||||
| curl -X POST http://host-1:3000/v1/databases \ | ||||||
| -H 'Content-Type: application/json' \ | ||||||
| --data '{ | ||||||
| "id": "example", | ||||||
| "spec": { | ||||||
| "database_name": "example", | ||||||
| "nodes": [ | ||||||
| { "name": "n1", "host_ids": ["host-1"] } | ||||||
| ], | ||||||
| "database_users": [ | ||||||
| { | ||||||
| "username": "mcp_user", | ||||||
| "password": "changeme", | ||||||
| "db_owner": true, | ||||||
| "attributes": ["LOGIN"] | ||||||
| } | ||||||
| ], | ||||||
| "services": [ | ||||||
| { | ||||||
| "service_id": "mcp-server", | ||||||
| "service_type": "mcp", | ||||||
| "version": "latest", | ||||||
| "host_ids": ["host-1"], | ||||||
| "port": 8080, | ||||||
| "connect_as": "mcp_user", | ||||||
| "config": { | ||||||
| "kb_enabled": true, | ||||||
| "kb_embedding_provider": "voyage", | ||||||
| "kb_embedding_model": "voyage-3-lite", | ||||||
| "kb_embedding_api_key": "pa-..." | ||||||
| } | ||||||
| } | ||||||
| ] | ||||||
| } | ||||||
| }' | ||||||
| ``` | ||||||
|
|
||||||
| To use a custom path for the knowledgebase file, add | ||||||
| `kb_database_host_path` to the `config` object: | ||||||
|
|
||||||
| ```json | ||||||
| "kb_database_host_path": "/data/kb/my-kb.db" | ||||||
| ``` | ||||||
|
|
||||||
| ## Connecting to the MCP Server | ||||||
|
|
||||||
| The MCP server accepts JSON-RPC 2.0 requests once the service instance | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add a sentence in this section to tell people that they can get the knowledge base file from the pgEdge Postgres MCP release artifacts? It's unfortunate that the KB releases are separate from the normal tagged releases, so I think the best we can do is tell them to the download the
kb.dbfile from the latestKnowledge Baserelease on the releases page: https://github.com/pgEdge/pgedge-postgres-mcp/releases.