Lantern Howto
Lantern is an open-source PostgreSQL vector database extension that provides high-performance vector search capabilities for building AI applications.
View MoreHow to Use Lantern
Sign up for Lantern Cloud: Go to lantern.dev and click 'Try Lantern for Free' to create a free account. No credit card is required.
Create a database: After signing up, create a new Postgres database with Lantern enabled.
Connect to your database: Use the provided connection details to connect to your Lantern-enabled Postgres database using your preferred method (e.g. psql, application code, etc.).
Create a table with a vector column: Execute SQL to create a table that includes a column for storing vector embeddings, e.g. 'CREATE TABLE books (id SERIAL PRIMARY KEY, book_embedding REAL[3]);'
Insert vector data: Insert vector embeddings into your table, e.g. 'INSERT INTO books (book_embedding) VALUES ('{0,1,0}'), ('{3,2,4}');'
Create an HNSW index: Create a Lantern HNSW index on your vector column for faster queries, e.g. 'CREATE INDEX book_index ON books USING lantern_hnsw(book_embedding dist_l2sq_ops) WITH (M=2, ef_construction=10, ef=4, dim=3);'
Perform vector similarity search: Use SQL to query for similar vectors, e.g. 'SELECT id FROM books ORDER BY book_embedding <-> '{0,0,0}' LIMIT 1;'
Generate embeddings (optional): Use Lantern's built-in embedding generation to create vectors from text or images, e.g. 'SELECT id FROM books ORDER BY book_embedding <-> text_embedding('BAAI/bge-base-en', 'My text input') LIMIT 1;'
Lantern FAQs
Lantern is a hosted Postgres vector database and toolkit for developers to build high-performance AI applications. It offers vector search capabilities, embedding generation, and efficient indexing.
Popular Articles
Best AI Tools for Exploration and Interaction in 2024: Search Engines, Chatbots, NSFW Content, and Comprehensive Directories
Dec 11, 2024
12 Days of OpenAI Content Update 2024
Dec 11, 2024
Top 8 AI Tools Directory in December 2024
Dec 11, 2024
Elon Musk's X Introduces Grok Aurora: A New AI Image Generator
Dec 10, 2024
View More