Client Configuration
Create a client instance with optional configuration:Spaces
Spaces are knowledge bases that contain your documents.List Spaces
Create a Space
Get a Space
Update a Space
Delete a Space
Deleting a space archives it (soft delete). The space and its documents remain accessible but hidden.
Get Space Limits
Check document usage and limits for a space based on your plan:Documents
Documents contain the content in your spaces. Orchata automatically handles chunking and embedding.List Documents
Upload a Document
Upload Multiple Documents
Upload multiple documents in a single operation:Get Document Content
Retrieve the full processed content of a document:Upsert a Document
Create a document if it doesn’t exist, or update it if a document with the same filename already exists in the space:Append to a Document
Add content to the end of an existing document:Get Document by Filename
Look up a document by its filename within a space:Update a Document
Delete a Document
Queries
Query your knowledge base using semantic search.Simple Query
Query Multiple Spaces
Filter by Metadata
Group Results by Space
Query Options
string | string[]
required
One or more space IDs to search.
string
required
Natural language search query.
integer
default:"10"
Maximum number of results to return (1-100).
number
default:"0.0"
Minimum similarity score (0-1). Higher values return more relevant but fewer results.
object
Filter results by document metadata key-value pairs.
boolean
default:"false"
Group results by space ID instead of returning a flat array.
Smart Query
Discover which spaces are most relevant for a query without knowing which spaces to search.Find Relevant Spaces
Relevance Methods
Choose how spaces are matched to your query:Complete Workflow
Use Smart Query to discover spaces, then query them:Runtime Support
The SDK works across different JavaScript runtimes:Next Steps
AI Integration
Integrate with Vercel AI SDK for AI-powered applications.
Error Handling
Handle errors gracefully with typed error classes.
Quickstart
Review the quickstart guide.
API Reference
Explore the REST API documentation.