Multimodal Data Types
OneNode supports multimodal data types that make working with AI and embeddings simple. With built-in multimodal data types, you can store text, images, and other media in your database and have them automatically embedded for semantic search.
What Multimodal Data Types Do For You
- Automatic Embedding: Just wrap your content in a multimodal data type, and OneNode handles the embedding process
- Semantic Search Across Different Modalities: Query text, images, and other media types using natural language in a single search
- No External Media Storage Needed: Store your media directly in OneNode—no need for separate file storage systems or CDNs
- Async by Default: All embedding and processing happens asynchronously, keeping your application fast and responsive
Quick Example
See how easy it is to use multimodal data types in your applications:
from onenode import Text, Image
# Step 1: Create Text instance
description_text = Text("This is a detailed description that will be embedded for semantic search")
# Step 2: Enable indexing for Text
description_text.enable_index()
# Step 3: Create Image instance (file type auto-detected from extension)
thumbnail_image = Image("thumbnail.jpg")
# Step 4: Enable indexing for Image
thumbnail_image.enable_index()
# Step 5: Create document with multimodal fields
document = {
"title": "My First Document",
"description": description_text,
"thumbnail": thumbnail_image
}
# Step 6: Store in OneNode
collection.insert([document])
# Step 7: Search semantically across all embedded fields
results = collection.find({"$semanticSearch": "design principles"})
Available Multimodal Data Types
- Text: For text data ranging from short phrases to long documents
- Image: For images (accepts files, binary data, and base64 encoded data)
- Coming Soon: EmbVideo, EmbFile, EmbAudio, and Emb3D for additional media types
💡 Pro Tip
Multimodal data types handle customization options like chunk sizes and embedding models. Start simple and refine as your needs evolve.
How can we improve this documentation?
Share Your Thoughts
Your feedback helps us improve our documentation. Let us know what you think!