datarobot_genai.drtools.core.clients.dr_docs
dr_docs
DataRobot Agentic AI Documentation search client.
Searches the DataRobot agentic-ai documentation section without requiring any API keys. Parses the sitemap.xml to discover agentic-ai documentation page URLs, fetches their full HTML content concurrently at index-build time, and builds a TF-IDF index from real page titles and body text. The index is cached in memory for fast repeated queries.
Only pages under https://docs.datarobot.com/en/docs/agentic-ai/ are indexed, keeping the corpus small (~28 pages) so the full index can be built in a few seconds.
TODO: Pre-built index (push index build out of MCP): Build the TF-IDF index in a separate process (workload api), then store it (serialized file or blob). Sitemap fetch, 28 HTTP requests, HTML parsing, tokenization, and index construction run outside the MCP.
In the MCP: Load pre-built index from file/URL or bundled resource. search_docs = load index if needed + TF-IDF search. Same for fetch_page_content if cache page contents in the artifact. No sitemap or bulk HTML fetch, no parsing/tokenizing in the MCP. Only loads that artifact and runs search in memory.
DocPage
Represents a single documentation page.
Source code in datarobot_genai/drtools/core/clients/dr_docs.py
as_dict
Return a dictionary representation of the page.
search_docs
async
Search DataRobot agentic-ai documentation for pages relevant to a query.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
query
|
str
|
The search query string. |
required |
max_results
|
int
|
Maximum number of results to return. |
MAX_RESULTS_DEFAULT
|
Returns
List of dictionaries with 'url', 'title', and 'description' keys.
Source code in datarobot_genai/drtools/core/clients/dr_docs.py
fetch_page_content
async
Fetch and extract the text content of a specific documentation page.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
url
|
str
|
The URL of the documentation page to fetch. |
required |
Returns
Dictionary with 'url', 'title', and 'content' keys.