From Knowledge Bases
Postgres
PostgresKnowledgeBase
PostgresKnowledgeBase
is a PostgreSQL-backed vector knowledge base class that supports fast document retrieval using semantic vector search and traditional text-based queries. It leverages the pgvector
extension for similarity search and is built to integrate with LLMs and embeddings models.
Installation
Environment Variables
You can use environment variables for seamless config:
Example Usage
Notes & Tips
- If the
embedding
field is not specified, semantic search will be disabled. - To enable
pgvector
, make sure your database has the extension installed:
- Semantic similarity uses the
<->
operator for efficient ANN search.