
Lantern
Lantern Systems, Inc. · Coding
Lantern is an open-source Postgres extension that adds HNSW vector search and embedding generation to your existing database, plus a managed cloud service for AI apps.

About Lantern
What Is Lantern
Lantern runs inside PostgreSQL as an extension, so vectors sit in the same tables as the rest of your data. You add a vector column, build a lantern_hnsw index on it, and the database answers nearest neighbor queries with plain SQL. No second store, no sync job, no separate query language.
The project targets teams building semantic search, recommendations, and retrieval for AI assistants without leaving Postgres. It supports Postgres 11 through 16 and reuses pgvector's vector type, which means a pgvector table can move over with a data type that already matches.
The limits matter too. Lantern is maintained by a small team, the newest open-source release is v0.5.0 from November 2024, and the free cloud tier is small at 0.25 vCPU and 0.5 GB of RAM. It's a good fit for prototypes and mid-size catalogs, less so for teams that need a large support organization.
Getting Started
- Create a free Lantern Cloud project, or install the extension on your own Postgres with Docker, Homebrew, or a precompiled binary.
- Run
CREATE EXTENSION lanternin the database you plan to use. Each database on an instance needs its own copy. - Add a vector column to a table and insert rows as arrays of floats.
- Build an index with
CREATE INDEX ... USING lantern_hnsw, picking an operator class such as cosine or L2 squared. - Query with the distance operators, or switch on automatic embedding generation so Lantern fills the vector column from your text.
Product Information
A quick look at Lantern's pricing, supported platforms, and performance.
Best for
The users, tasks, and scenarios where this tool fits best.
Users
- Backend developers who already run Postgres
- AI engineers building retrieval for chatbots
- Small teams without a database administrator
Tasks
- Semantic search over product catalogs, support docs, or internal wikis, where a text query should return results by meaning rather than exact words.
- Image similarity search with CLIP embeddings, which Lantern supports as a built-in model alongside text models.
- Recommendation features that rank items by distance to a user's embedding, computed in the same query that joins your business tables.
- Deduplication and near-duplicate detection across large record sets, using a cosine index and a distance threshold.
Scenarios
- Adding search to an existing Rails, Django, or Node app without introducing a new datastore.
- Migrating off pgvector or Pinecone when you want one database to own both relational data and vectors.
- Prototyping a RAG pipeline on the free tier before committing to a paid instance.
Key features
HNSW Index Built for Postgres
Lantern adds a lantern_hnsw index type for vector columns and speeds up ORDER BY ... LIMIT queries. The index is built on usearch, a compact HNSW implementation, and supports L2 squared, cosine, and Hamming distance through operator classes you choose at index time.
Embedding Generation in SQL
You can generate vectors without leaving the database. Lantern ships helper functions that call embedding models and write the result into a column, so a Python or Node service doesn't have to chunk text, call an API, and handle retries itself.
Automatic Embedding Columns
Managed columns keep vectors current. You point Lantern at a text column and a model, and new or changed rows get embedded in the background as an asynchronous task. That removes the usual glue code between a content table and its search index.
LLM Calls From SQL
Version 0.5.0 added llm_completion and add_completion_job, which let you run prompts against an LLM inside a query or as a background job. It's a narrow feature, useful for classification and short summaries, not a replacement for an application layer.
Serverless Indexing and Parallel Builds
Index creation is often the slow part of a vector setup. Lantern can build the index graph outside the database server or on a separate machine, so a large rebuild doesn't stall normal traffic. On the cloud, that's billed as serverless indexing from $0.50 per GB.
Index Autotuning and Quantization
Picking M, ef, and ef_construction by hand takes experiments. Lantern includes an autotune tool that suggests parameters for your data, and product quantization to shrink index size when memory is the constraint.
Pros and cons
Pros
- Vectors live in Postgres, so joins, filters, and transactions work the same way they do for the rest of your schema.
- pgvector's data type is supported, which keeps the migration path short if you already use it.
- Embedding generation and managed columns cut out a separate ingestion service.
- The cloud free tier never pauses, so a demo project can sit idle without losing its database.
- Index builds can run outside the main server, which keeps production responsive during a rebuild.
Cons
- The open-source release cadence is slow. v0.5.0 landed in November 2024, and the repository's last push was December 2024, so you should expect to depend on your own fork for fixes.
- Documentation assumes you're comfortable with SQL and index tuning. Teams without a backend engineer will find the first index build confusing.
- The free cloud instance has 0.25 vCPU and 0.5 GB of RAM, which is enough for a demo and not much more.
- Embedding costs stack on top of the database bill, and passing your own OpenAI or Cohere key is the only way to avoid Lantern's per-token markup.
Frequently asked questions
Yes, in two senses. The extension is open source under AGPL-3.0 and free to self-host, and Lantern Cloud has a free tier with 0.25 vCPU, 0.5 GB of RAM, and no pausing. Paid cloud instances start at $44 per month and run up to $704 per month for 16 vCPU and 60 GB of RAM.
Related content
Explore related tools, skills, and articles for Lantern.
Lantern Alternatives
Base Code
Base44 (Wix) · Coding · ProductivityBase Code is a shared cloud development environment from Base44. Teammates describe changes to an existing GitHub codebase in chat, preview them live and send them back as pull requests.
Google EmbeddingGemma 2
Google DeepMind · Writing · Image · CodingGoogle EmbeddingGemma 2 is a 740M-parameter open model that turns text, code, images, audio, and video frames into vectors in one 768-dimension space, running on phones and laptops.
GitGlow
GitGlow · Coding · ProductivityGitGlow is a local-first desktop Git client that lets independent developers review their own code and their AI agents' changes in one place before shipping.
