Overview
The Data API allows you to store custom data in collections with powerful semantic search capabilities using vector embeddings. Returns DataEntryInstance objects with direct property access.Direct Access
Access
entry.title not entry.data.titleSearch Scores
Results include relevance scores
Instance Methods
Built-in
update(), save(), and delete()Array Methods
Use
.map(), .filter() on search resultsReturn Shape Reference
Quick examples:
Key Features
Custom Collections
Store any JSON data in named collections
Vector Search
Semantic similarity search using AI embeddings
Flexible Schema
No fixed schema - store any structure
Filtering
Query by field values with operators
Methods
create()
Create a new entry in a collection.Name of the collection (e.g., ‘movies’, ‘customers’, ‘articles’)
Any JSON-serializable object to store
Text to index for vector search. Include all searchable content.
search()
Semantic search using vector embeddings.Name of the collection to search
Search text (natural language query)
Maximum number of results to return
Minimum similarity score (0-1). Higher = more similar.
DataEntryInstance objects, each with a score property.
Similarity Scores:
1.0= Perfect match0.8-0.9= Very similar0.6-0.7= Somewhat similar<0.6= Low similarity
get()
Retrieve entries with optional filtering and pagination.Name of the collection
Filter criteria (MongoDB-style queries)
Page number (1-indexed)
Items per page
getEntry()
Retrieve a specific entry by ID.update()
Update an existing entry.Name of the collection
ID of the entry to update
Data to merge with existing entry
Optional new text for vector search indexing
Updates merge with existing data. Only the specified fields are updated; other fields are preserved.
DataEntryInstance Methods
When you retrieve or create data entries, you get aDataEntryInstance object with convenient instance methods.
save()
Save the current state of the data entry to the server. This is a convenience method that persists all changes made to the entry.Optional new text for vector search indexing
true if successful
Example:
The
save() method provides a simpler workflow - modify properties then save, rather than calling Data.update() with the collection name and entry ID.update() (Instance Method)
Update the entry using the instance method.delete() (Instance Method)
Delete the entry using the instance method.Static Methods
delete()
Delete an entry using the static method.Use Cases
Knowledge Base
Customer CRM
Task Management
Filter Operators
The Data API supports MongoDB-style filter operators:Best Practices
Create Rich Search Text
Create Rich Search Text
Include all searchable content in searchText:
Use Appropriate Score Thresholds
Use Appropriate Score Thresholds
0.8+: High precision, few results0.7: Balanced (recommended default)0.6: More results, lower precision<0.6: May return irrelevant results
Structure Data Consistently
Structure Data Consistently
Use consistent field names across entries:
Add Timestamps
Add Timestamps
Track when entries are created/modified:
Vector Search Tips
- What It Is
- Best For
- Tips
Vector search uses AI to understand meaning, not just match keywords.Example:
- Query: “affordable laptop for students”
- Finds: “budget-friendly notebook for college”
- Even though no words match exactly!
If your Data results don’t look right, log the raw return value before transforming it:Then run
lua logs --type skill --limit 5 after sending a test message to see the actual shape at runtime. See the Debugging Skills guide for the full 5-step workflow.Next Steps
Custom Data Examples
See working examples
Build Your First Skill
Complete tutorial using Data API
Debugging Skills
Inspect runtime return values

