AI agent for PostgreSQL — ask questions about your database
Project description
plugent
AI agent for PostgreSQL — ask questions about your database.
Installation
pip install plugent
Quick Start
from plugent import Plugent
# Initialize
plugent = Plugent(
groq_api_key="your_groq_api_key",
postgres_url="postgresql://user:password@localhost:5432/yourdb",
vector_store_path="./my_vector_store",
schedule_interval=60,
)
# Start - connects to DB, builds vector store, starts background sync
plugent.start()
# Ask questions about your data
answer = plugent.ask("What are the users in the database?")
print(answer)
# Stop the scheduler when done
plugent.stop()
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
groq_api_key |
str | required | Groq API key for LLM responses |
postgres_url |
str | required | PostgreSQL connection URL |
vector_store_path |
str | "./plugent_store" | Path for saving/loading vector store |
schedule_interval |
int | 60 | Seconds between DB change checks |
How It Works
- start() connects to PostgreSQL, reads all rows, embeds them using sentence-transformers, builds FAISS index, saves to disk, starts background scheduler
- ask() embeds your question, searches vector store for relevant context, sends to Groq LLM with context, returns answer
- Background scheduler checks for DB changes every N seconds, updates vector store for new/changed/deleted rows
Development
Run tests:
pytest tests/
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
plugent-0.1.2.post8.tar.gz
(8.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file plugent-0.1.2.post8.tar.gz.
File metadata
- Download URL: plugent-0.1.2.post8.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c738dbaea03240e00ffba3c72cf7fbef7376b04b75161fbb127e83ba1afc4f3
|
|
| MD5 |
fbe0f555210c056bbc633ea77de62351
|
|
| BLAKE2b-256 |
341a56d61471fdd0db1cd88428ef47bfd4b7c7110a93053342b6df74a52a07d1
|
File details
Details for the file plugent-0.1.2.post8-py3-none-any.whl.
File metadata
- Download URL: plugent-0.1.2.post8-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27e4cd38f44a0b58bff16d09bed19a464ef024e7b35f58192d46ebee8e4c3eac
|
|
| MD5 |
4e201250b7af32da9b48374864ac8411
|
|
| BLAKE2b-256 |
529443cf3e794b1c398ab971fee33776386e04e5317c45d6a95f6c8a2f5afe45
|