***

title: datasphere_serverless
slug: /reference/python/agents/skills/datasphere-serverless
description: Search SignalWire DataSphere documents using a DataMap for serverless execution.
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

Search SignalWire DataSphere documents using a DataMap for serverless execution.
Unlike the standard `datasphere` skill, this version executes entirely server-side
without a webhook round-trip, making it suitable for serverless deployments.

**Tools:** `search_knowledge` (default, customizable via `tool_name`)

**Requirements:** SignalWire DataSphere credentials

**Multi-instance:** Yes

<ParamField path="space_name" type="str" required={true} toc={true}>
  SignalWire space name.
</ParamField>

<ParamField path="project_id" type="str" required={true} toc={true}>
  SignalWire project ID.
</ParamField>

<ParamField path="token" type="str" required={true} toc={true}>
  SignalWire API token.
</ParamField>

<ParamField path="document_id" type="str" required={true} toc={true}>
  DataSphere document ID to search within.
</ParamField>

<ParamField path="count" type="int" default="1" toc={true}>
  Number of search results to return.
</ParamField>

<ParamField path="distance" type="float" default="3.0" toc={true}>
  Maximum distance threshold for results.
</ParamField>

<ParamField path="tags" type="list[str]" toc={true}>
  Tags to filter search results.
</ParamField>

<ParamField path="language" type="str" toc={true}>
  Language code for query expansion (e.g., `"en"`, `"es"`).
</ParamField>

<ParamField path="pos_to_expand" type="list[str]" toc={true}>
  Parts of speech to expand with synonyms: `"NOUN"`, `"VERB"`, `"ADJ"`, `"ADV"`.
</ParamField>

<ParamField path="max_synonyms" type="int" toc={true}>
  Maximum number of synonyms for query expansion (1–10).
</ParamField>

<ParamField path="no_results_message" type="str" toc={true}>
  Message returned when no results are found. Supports `{query}` placeholder.
</ParamField>

<ParamField path="tool_name" type="str" default="search_knowledge" toc={true}>
  Custom tool name for this instance.
</ParamField>

```python
from signalwire import AgentBase

class MyAgent(AgentBase):
    def __init__(self):
        super().__init__(name="assistant", route="/assistant")
        self.set_prompt_text("You are a helpful assistant.")
        self.add_skill("datasphere_serverless", {
            "space_name": "your-space",
            "project_id": "YOUR_PROJECT_ID",
            "token": "YOUR_API_TOKEN",
            "document_id": "YOUR_DOCUMENT_ID",
            "count": 3
        })

agent = MyAgent()
agent.serve()
```