PostgreSQL Adapter
The PostgreSQL Adapter provides robust database functionality with vector search capabilities, ideal for production deployments. Visit Elizaos PostgreSQL Adapter docs for more details.
Installation
Section titled โInstallationโ-
Install required packages:
Terminal window npm i github:elizaos-plugins/adapter-postgresTerminal window pnpm add github:elizaos-plugins/adapter-postgresTerminal window yarn add github:elizaos-plugins/adapter-postgres -
Setup env variable:
Terminal window POSTGRES_URL=postgresql://user:pass@localhost:5432/db -
Enable vector search extension:
Terminal window CREATE EXTENSION vector;
Basic Setup
Section titled โBasic Setupโimport { AgentBuilder } from "@iqai/agent";import PostgresAdapter from "@elizaos/adapter-postgres";
const agent = new AgentBuilder() .withDatabase(PostgresAdapter) // ... other configuration .build();
Key Features
Section titled โKey Featuresโ- โ๏ธ Vector search support
- โ๏ธ Comprehensive logging
- โ๏ธ Production scaling
Best Practices
Section titled โBest Practicesโ- โ๏ธ Use for production deployments
- โ๏ธ Enable connection pooling
- โ๏ธ Implement proper indexing
- โ๏ธ Monitor vector search performance