Postgres Vector Store
Overview
The Postgres Vector Store node in AnswerAI allows you to store and retrieve embedded data using pgvector on a PostgreSQL database. This feature enables efficient similarity searches on high-dimensional vectors, making it ideal for various AI and machine learning applications.
Key Benefits
- Efficient storage and retrieval of vector embeddings
- Seamless integration with PostgreSQL databases
- Supports similarity search for advanced querying capabilities
How to Use
-
Add the Postgres Vector Store node to your AnswerAI workflow canvas.
-
Configure the node with the following parameters:
- Connect Credential: Select or create a PostgresAPI credential
- Document: (Optional) Input the documents to be stored
- Embeddings: Select the embeddings model to use
- Record Manager: (Optional) Select a record manager to prevent duplication
- Host: Enter the PostgreSQL server host
- Database: Specify the database name
- Port: (Optional) Enter the PostgreSQL server port (default: 6432)
- Table Name: (Optional) Specify the table name for storing vectors (default: "documents")
- Additional Configuration: (Optional) Add any extra configuration in JSON format
- Top K: (Optional) Set the number of top results to fetch (default: 4)
-
Connect the node to other components in your workflow as needed.
Tips and Best Practices
- Ensure that your PostgreSQL database has the pgvector extension installed and enabled.
- Use appropriate indexing strategies for optimal performance, especially for large datasets.
- Consider using a Record Manager to prevent duplicate entries when upserting documents.
- Adjust the "Top K" value based on your specific use case and desired number of results.
Troubleshooting
-
Connection issues:
- Verify that the host, port, database name, and credentials are correct.
- Ensure that the PostgreSQL server is accessible from your AnswerAI instance.
-
Performance problems:
- Check if appropriate indexes are in place for the vector columns.
- Consider increasing the "Top K" value if you're not getting enough results.
-
Errors related to pgvector:
- Confirm that the pgvector extension is properly installed and enabled in your PostgreSQL database.
If you encounter persistent issues, consult the AnswerAI documentation or reach out to support for further assistance.