Live data from Hacker News

Show HN: Lantern – a PostgreSQL vector database for building AI applications

docs.lantern.dev

1–10 of 46 posts

Show HN: Lantern – a PostgreSQL vector database for building AI applications

#1
We are excited to share Lantern! Lantern is a PostgreSQL vector database extension for building AI applications. Install and use our extension here: https://github.com/lanterndata/lantern

We have the most complete feature set of all the PostgreSQL vector database extensions. Our database is built on top of usearch — a state of the art implementation of HNSW, the most scalable and performant algorithm for handling vector search.

There’s three key metrics we track. CREATE INDEX time, SELECT throughput, and SELECT latency. We match or outperform pgvector and pg_embedding (Neon) on all of these metrics.

** Here’s what we support today **

- Creating an AI application end to end without leaving your database (example: https://github.com/ezra-varady/lanterndb-semantic-image-sear...)

- Embedding generation for popular use cases (CLIP model, Hugging Face models, custom model)

- Interoperability with pgvector's data type, so anyone using pgvector can switch to Lantern

- Parallel index creation capabilities -- Support for creating the index outside of the database and inside another instance allows you to create an index without interrupting database workflows.

** Here’s what’s coming soon **

- Cloud-hosted version of Lantern

- Templates and guides for building applications for different industries

- Tools for generating embeddings (support for third party model API's, more local models)

- Support for version control and A/B test embeddings

- Autotuned index type that will choose appropriate index creation parameters

- 1 byte and 2 byte vector elements, and up to 8000 dimensional vectors support

** Why we started Lantern today **

There's dozens of vector databases on the market, but no enterprise option built on top of PostgreSQL. We think it's super important to build on top of PostgreSQL

- Developers know how to use PostgreSQL.

- Companies already store their data on PostgreSQL.

- Standalone vector databases have to rebuild all of what PostgreSQL has built for the past 30-years, including all of the optimizations on how to best store and access data.

We are open source and excited to have community contributors! Looking forward to hearing your feedback!

Show HN: Lantern – a PostgreSQL vector database for building AI applications
docs.lantern.dev

Re: Show HN: Lantern – a PostgreSQL vector database for building AI applications

#2
This might be a noob question but what does Lantern have that a normal Postgres dB with pgvector does not? I think Supabase already has a Postgres as a service product with the pgvector extension too.

Second:

>Creating an AI application end to end without leaving your database (example: https://github.com/ezra-varady/lanterndb-semantic-image-sear...)

What does "without leaving your database" mean in this context?

Re: Show HN: Lantern – a PostgreSQL vector database for building AI applications

#3
"There's three key metrics we track. CREATE INDEX time, SELECT throughput, and SELECT latency."

There's a fourth metric that I'm really interested in: assuming it's possible, how long does it take to update the index with just one or two updated or inserted vectors?

Is the expectation with this (and the other) tools that I'll do a full index rebuild every X minutes/hours, or do some of them support ongoing partial updates as data is inserted and updated?

Just had a thought: maybe I could handle this case by maintaining an index of every existing vector, then tracking rows that have been created since that index itself.

Then I could run an indexed search that returns the top X results + their distance scores, then separately do a brute-force calculation of scores just for the small number of rows that I know aren't in the index - and then combine those together.

Would that work OK?

Even if the index doesn't return the scores directly, if it gives me the top 20 I could re-calculate distance scores against those 20 plus the X records that have been inserted since the index was creation and return my own results based on that.

Re: Show HN: Lantern – a PostgreSQL vector database for building AI applications

#4
post #2

This might be a noob question but what does Lantern have that a normal Postgres dB with pgvector does not? I think Supabase already has a Postgres as a service product with the pgvector extension too. Second: >Creating an AI application end to end without leaving your database (example: https://github.com/ezra-varady/lanterndb-semantic-image-sear ...) What does "without leaving your database" mean in this context?

I assume that question - Lantern v.s. pgvector - is meant to be answered by those performance graphs: Lantern is a bit faster.

(I'd find those graphs easily to quickly understand if they had a "lower is better"/"higher is better" note on each one.)

Re: Show HN: Lantern – a PostgreSQL vector database for building AI applications

#6
post #2

This might be a noob question but what does Lantern have that a normal Postgres dB with pgvector does not? I think Supabase already has a Postgres as a service product with the pgvector extension too. Second: >Creating an AI application end to end without leaving your database (example: https://github.com/ezra-varady/lanterndb-semantic-image-sear ...) What does "without leaving your database" mean in this context?

Pgvector builds a vector index.

Our extension, similarly, builds an index but also extends SQL in more ways.

For example,

- Generating embeddings to augment plain relational data

- Using data from local proprietary embedding models or third-party model APIs in queries.

We have more things planned like vector versioning, data retention policies and recall regression tracking.

> What does "without leaving your database" mean in this context?

You can work with embeddings with just SQL. For instance, a table of academic papers can be augmented with CLIP model embeddings produced locally. This entire process - creating, storing, and querying - happens using just SQL."

  SELECT abstract,
       introduction,
       figure1,
       clip_text(abstract) AS abstract_ai,
       clip_text(introduction) AS introduction_ai,
       clip_image(figure1) AS figure1_ai
  INTO papers_augmented
  FROM papers;

  SELECT 
    abstract, 
    introduction
  FROM papers_augmented
  ORDER BY abstract_ai  clip_text("The Foundation of the General Theory of Relativity")
  LIMIT 10;

Re: Show HN: Lantern – a PostgreSQL vector database for building AI applications

#9

Not going to lie.. the more I use Postgres the more I realize my entire application is Postgres. Soon you'll be doing entire CRUD endpoints and sending emails from Postgres... Wait, PostgREST already does... builds entire SaaS with Postgres

PGaaS :D
Post reply on HN