***

title: DataSphereServerlessSkill
slug: /reference/typescript/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

[add-skill]: /docs/server-sdks/reference/typescript/agents/agent-base/add-skill

[ref-datamap]: /docs/server-sdks/reference/typescript/agents/data-map

Search SignalWire DataSphere documents using a [DataMap][ref-datamap] for
serverless execution. Unlike the standard `datasphere` skill, this version
executes entirely server-side without a webhook round-trip.

**Class:** `DataSphereServerlessSkill`

**Tools:** `search_datasphere`

**Env vars:** `SIGNALWIRE_PROJECT_ID`, `SIGNALWIRE_TOKEN`, `SIGNALWIRE_SPACE`

**Multi-instance:** Yes

<ParamField path="tool_name" type="string" toc={true}>
  Custom tool name for this instance. Required when using multiple instances.
</ParamField>

<ParamField path="space_name" type="string" toc={true}>
  SignalWire space name. Falls back to the `SIGNALWIRE_SPACE` environment variable.
</ParamField>

<ParamField path="project_id" type="string" toc={true}>
  SignalWire project ID. Falls back to the `SIGNALWIRE_PROJECT_ID` environment variable.
</ParamField>

<ParamField path="token" type="string" toc={true}>
  SignalWire auth token. Falls back to the `SIGNALWIRE_TOKEN` environment variable.
</ParamField>

<ParamField path="document_id" type="string" toc={true}>
  Restrict search to a specific document ID.
</ParamField>

<ParamField path="max_results" type="number" default="5" toc={true}>
  Maximum number of results to return.
</ParamField>

<ParamField path="distance_threshold" type="number" default="0.7" toc={true}>
  Maximum distance threshold for results (0-1, lower is more similar).
</ParamField>

```typescript {6-9}
import { AgentBase, DataSphereServerlessSkill } from '@signalwire/sdk';

const agent = new AgentBase({ name: 'assistant', route: '/assistant' });
agent.setPromptText('You are a helpful assistant.');

await agent.addSkill(new DataSphereServerlessSkill({
  document_id: 'YOUR_DOCUMENT_ID',
  max_results: 3,
}));

agent.run();
```