TypeScript
import { Orchata } from '@orchata/sdk'; const client = new Orchata({ apiKey: 'oai_your_api_key' }); // Discover relevant spaces const { relevantSpaces } = await client.smartQuery({ query: 'How do I authenticate users?', maxSpaces: 3, relevanceMethod: 'hybrid' }); // Then query those spaces const { results } = await client.query({ spaceIds: relevantSpaces.map(s => s.space.id), query: 'user authentication' });
{ "relevantSpaces": [ { "space": { "id": "<string>", "name": "<string>", "description": "<string>" }, "relevanceScore": 123, "matchReason": "keyword_match" } ], "totalSpaces": 123 }
Discover the most relevant spaces for a query using hybrid keyword and embedding similarity. Returns space recommendations (not actual query results).
Smart query request
1
1 <= x <= 50
keyword
embedding
hybrid
0 <= x <= 1
Successfully retrieved relevant spaces
Show child attributes