Skip to content

PGVector

PGVector helps Nappai find similar pieces of information in your data. Imagine searching for documents similar to a specific text; PGVector does this by comparing the “meaning” of your search to the “meaning” of your stored data. It uses a powerful database system (PostgreSQL) to do this efficiently.

Relationship with PostgreSQL

This component directly interacts with a PostgreSQL database to store and search vector data. This means you’ll need a PostgreSQL database set up and configured correctly for PGVector to work. You’ll provide Nappai with your database credentials to connect.

Inputs

  • Table: The name of the table in your PostgreSQL database where the information is stored. This is like choosing a specific folder to work with. Required.
  • Search Query: The text you want to search for. PGVector will find similar items based on this. Optional.
  • Ingestion Data: The new information you want to add to your database. This could be text, images, or other data that has been converted into a format PGVector understands. Can be left empty.
  • Embedding: This is the method used to convert your data (text, images, etc.) into a format that PGVector can understand and search. Think of it as translating your data into a language PGVector speaks. Required.
  • Number of Results: How many similar items you want PGVector to return. The default is 4. Advanced setting.
  • Credential: Your login information for your PostgreSQL database. This allows Nappai to access your data securely. Required.

Outputs

  • Resultado de búsqueda de documentos: A list of items that are similar to your search query. This output can be used in other parts of your Nappai workflow, such as displaying results to a user or triggering other actions.

Usage Example

Let’s say you have a database of product descriptions. You want to find products similar to “comfortable running shoes.” You would:

  1. Select the table containing your product descriptions in the “Table” input.
  2. Enter “comfortable running shoes” in the “Search Query” input.
  3. Choose the appropriate “Embedding” method.
  4. (Optional) Adjust the “Number of Results” if you want more or fewer suggestions.
  5. Run the component.

The output will be a list of product descriptions similar to “comfortable running shoes.”

Templates

[List of templates where the component is used will be added here once the templates are defined.]

  • VectorStoreInfo: Provides information about the vector store being used.
  • Self Query Retriever: Uses PGVector to generate search queries automatically.
  • [List of other connected components and brief descriptions will be added here.] Many components can use the output of PGVector to further process the results. For example, you could use a “Summarizer” to summarize the similar documents found.

Tips and Best Practices

  • Make sure your PostgreSQL database is properly configured and accessible to Nappai.
  • Choose an appropriate embedding method for your data type.
  • Experiment with the “Number of Results” to find the optimal number of suggestions.

Security Considerations

  • Protect your PostgreSQL database credentials carefully. Do not share them unnecessarily.
  • Regularly review and update your database security settings.