Preferences

I agree.

Similar to blog post, instead of at the extension layer I built a PostgreSQL ORM for Node.js based on ActiveRecord + Django's ORM that includes the concept of vector fields [0][1] that lets you write code like this:

    // Stores the `title` and `content` fields together as a vector
    // in the `content_embedding` vector field
    BlogPost.vectorizes(
      'content_embedding',
      (title, content) => `Title: ${title}\n\nBody: ${content}`
    );

    // Find the top 10 blog posts matching "blog posts about dogs"
    // Automatically converts query to a vector
    let searchBlogPosts = await BlogPost.query()
      .search('content_embedding', 'blog posts about dogs')
      .limit(10)
      .select();
I find it tremendously useful; you can query the underlying data or the embedding content, and you can define how the fields in the model get stored as embeddings in the first place.

[0] https://github.com/instant-dev/orm?tab=readme-ov-file#using-...

[1] https://github.com/instant-dev/orm?tab=readme-ov-file#using-...


This item has no comments currently.

Keyboard Shortcuts

Story Lists

j
Next story
k
Previous story
Shift+j
Last story
Shift+k
First story
o Enter
Go to story URL
c
Go to comments
u
Go to author

Navigation

Shift+t
Go to top stories
Shift+n
Go to new stories
Shift+b
Go to best stories
Shift+a
Go to Ask HN
Shift+s
Go to Show HN

Miscellaneous

?
Show this modal