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

# datasphere_serverless

> Search SignalWire DataSphere documents using a DataMap for serverless execution.

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

**`space_name`** `str` — required

SignalWire space name.

---

**`project_id`** `str` — required

SignalWire project ID.

---

**`token`** `str` — required

SignalWire API token.

---

**`document_id`** `str` — required

DataSphere document ID to search within.

---

**`count`** `int` — default: 1

Number of search results to return.

---

**`distance`** `float` — default: 3.0

Maximum distance threshold for results.

---

**`tags`** `list[str]`

Tags to filter search results.

---

**`language`** `str`

Language code for query expansion (e.g., `"en"`, `"es"`).

---

**`pos_to_expand`** `list[str]`

Parts of speech to expand with synonyms: `"NOUN"`, `"VERB"`, `"ADJ"`, `"ADV"`.

---

**`max_synonyms`** `int`

Maximum number of synonyms for query expansion (1–10).

---

**`no_results_message`** `str`

Message returned when no results are found. Supports `{query}` placeholder.

---

**`tool_name`** `str` — default: search\_knowledge

Custom tool name for this instance.

---

```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()
```