Lightning-fast in-memory vector database with automatic OpenAI embeddings. Build semantic search, recommendations, and AI features in minutes.
npm install neuradb
import { NeuraDB } from 'neuradb'
const db = new NeuraDB()
await db.addDocument({
content: "AI will transform software",
metadata: { category: "tech" }
})
const results = await db.search("artificial intelligence")Everything you need to integrate NeuraDB into your application
Automatic OpenAI embeddings with multiple model support
Lightweight library with no external dependencies
Optimized in-memory operations for fast retrieval
Full TypeScript support with comprehensive types
import { NeuraDB } from 'neuradb'
// Initialize database
const db = new NeuraDB()
// Add documents
await db.addDocument({
id: 'doc1',
content: 'Machine learning transforms data analysis',
metadata: { category: 'AI', difficulty: 'intermediate' }
})
// Search with natural language
const results = await db.search('artificial intelligence', {
limit: 5,
threshold: 0.7,
similarityMethod: 'cosine'
})import { NeuraDB } from 'neuradb'
import OpenAI from 'openai'
const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY })
const db = new NeuraDB({
openai,
embeddingModel: 'text-embedding-3-small',
defaultBatchSize: 100
})
// Batch add with automatic embeddings
await db.addDocuments(documents, {
createEmbedding: true,
batchSize: 50,
onProgress: (processed, total) => {
console.log(`Progress: ${processed}/${total}`)
}
})Measures the cosine of the angle between vectors. Best for text similarity.
Measures straight-line distance between points. Good for numerical data.
Measures vector alignment. Useful for recommendation systems.