Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Search improvement blog #617

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added public/ask-tembo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/improved-search-functionality.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/tembo-search.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
slug: search-tembo-cloud
title: 'Building Intelligent Search for Tembo Cloud with Tembo AI'
authors: [ash, adam]
description: |
Dogfooding our own tech we improved our search functionality and introduced an AI agent for more complex queries
tags: [vector, ai, LLM, search, pg_vector]
image: ./improved-search-functionality.png
date: 2024-08-28T09:00
planetPostgres: false
---

Here's our thought process: When a user is in our Cloud UI they might need to look up a thing they’re trying to accomplish. Rather than assuming they always have our Docs open in a second window, we wanted to offer search functionality to query our Docs and website straight from [cloud.tembo.io](https://cloud.tembo.io/). This blog will teach you how to achieve the same feature for your products the Tembo way: building on top of Postgres.

## Building AI-powered Search

Our Search is underpinned by the search and command widget tool [cmdk](https://github.com/pacocoursey/cmdk), fuzzy-search library [fuse.js](https://www.fusejs.io/), and vector search. We use vector search for the Docs, dogfooding our [pgvectorize extension](https://pgt.dev/extensions/vectorize), embeddings and [pgvector](https://pgt.dev/extensions/pgvector).
We’ve also introduced an AI agent for more complex queries. _Ask Tembo_ uses 2 custom [Tembo Apps](https://tembo.io/docs/product/cloud/apps/overview), deployed and hosted on Tembo Cloud. It uses a LLM hosted on Tembo. If you do a search in the Cloud UI, you're logged in and we understand your context, your results are bound to be most relevant.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that we changed from product update to "here's what we did and how you can do it too" I'm going to need a lot more meat here about which apps used and how someone can replay the same script for their application @aishwaryaborkar @ChuckHend

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can write that blog but I think we should sync up about timing for it and not push that content into this PR. There's a lot to it and we will likely need to cut a lot of content to fit into a single blog. Or maybe a better idea would be to make it a series of blogs on 'building chat applications on Postgres'.

@samay-sharma, @FloorD, what are your thoughts on pushing out this as a 'product update blog' and then working on something bigger to cover the 'here's how you can do it too'?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we'd do that, will we push search for the blog as well at the same time?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cause then it'd just be:

Improved search experience for Tembo Cloud

When you’re in Tembo’s Cloud UI you might need to look up a thing you’re trying to accomplish. Rather than always having our Docs open in a second window, you can now use our improved search functionality to search our Docs, blog and website straight from cloud.tembo.io.

With our improved search capabilities you can also search within your Instances (in your currently selected Organisation - if you have multiple Organisations, you must first navigate to the appropriate Organisation).

To top it off we’ve introduced an AI agent for your more complex queries.

Search within Tembo Cloud looks like so:
GIF

You can use Cmd+K or Ctrl+K to open the search window as well.

Toggle Ask Tembo to ask our AI assistant a question:
GIF

Tembo-powered search for your application

“In the olden days” we used Algolia for Docs search, but unsatisfied with the results we wanted to try and roll our own. We will share our setup as an open source Postgres-powered alternative for search in an upcoming blog post.

What’s next?

In terms of further improvement we want to offer suggestions for queries (FAQs), and show users their recent search queries. We’re also thinking of introducing a feedback mechanism if the selection doesn't match what you were looking for.

We could also make an attempt at showing relevant results for Ask Tembo immediately while processing the query in the backend, and then show more relevant results once the query is completed.

As always, we love to hear from you about functionality that will make your life easier. Please suggest and upvote features via [roadmap.tembo.io/](https://roadmap.tembo.io/roadmap)!

“In the olden days” we used Algolia for Docs search, but unsatisfied with the results we wanted to try and roll our own. We are considering releasing our setup as an open source Postgres-powered alternative. Let us know if that’s something you’d be interested in trying out for your product by voting for the feature on our [roadmap](https://roadmap.tembo.io/roadmap).

Search within Tembo Cloud now looks like so:

<img src='/tembo-search.gif' alt='vector search' />

And toggling _Ask Tembo_ to ask your question:

<img src='/ask-tembo.gif' alt='ask tembo' />

## What’s next?

We’ll include search functionality for [our blog](https://tembo.io/blog) soon, but today blog results already show up in _Ask Tembo_.

In terms of further improvement we want to offer suggestions for queries (FAQs), and show users their recent search queries. We’re also thinking of introducing a feedback mechanism if the selection doesn't match what you were looking for. In any case you can rest assured that we'll share the instructions so you can add similar functionality to your applications.

As always, we love to hear from you about functionality that will make your life easier. Please suggest and upvote features on our [roadmap](https://roadmap.tembo.io/roadmap)!