Postgres
Prerequisites
pip install -U psycopg2docker run -d \
-e POSTGRES_DB=ai \
-e POSTGRES_USER=ai \
-e POSTGRES_PASSWORD=ai \
-e PGDATA=/var/lib/postgresql/data/pgdata \
-v pgvolume:/var/lib/postgresql/data \
-p 5532:5432 \
--name pgvector \
bitca/pgvector:16Example
from bitca.agent import Agent
from bitca.tools.postgres import PostgresTools
# Initialize PostgresTools with connection details
postgres_tools = PostgresTools(
host="localhost",
port=5532,
db_name="ai",
user="ai",
password="ai"
)
# Create an agent with the PostgresTools
agent = Agent(tools=[postgres_tools])
# Example: Ask the agent to run a SQL query
agent.print_response("""
Please run a SQL query to get all users from the users table
who signed up in the last 30 days
""")Toolkit Params
Name
Type
Default
Description
Toolkit Functions
Function
Description
Last updated