Skip to main content

Database Personal Assistant - An AI-powered database management system with advanced text-to-SQL capabilities

Project description

DBPA (Database Personal Assistant)

A natural language interface for database management, powered by AI.

Features

  • 🗣️ Natural Language Queries: Interact with your database using plain English
  • 📊 Table Management: Easy interface for managing database tables
  • 🎓 Query Training: Learn from and improve query generation
  • 📝 Error Analysis: Comprehensive error tracking and analysis
  • 🔄 Vector Store: Efficient storage and retrieval of example queries
  • 🌐 Multi-Model Support: Works with OpenAI and Groq

Installation

pip install dbpa

Quick Start

  1. Set up your environment variables:
export OPENAI_API_KEY="your-api-key"
export POSTGRES_HOST="your-host"
export POSTGRES_DATABASE="your-db"
export POSTGRES_USER="your-user"
export POSTGRES_PASSWORD="your-password"
  1. Start the DBPA interface:
dbpa start

Usage

Basic Query

from dbpa import DatabaseAssistant

assistant = DatabaseAssistant()
result = assistant.query("Show me all customers who made purchases last month")
print(result)

Table Management

from dbpa import TableManager

manager = TableManager()
tables = manager.get_available_tables()
manager.select_tables(["customers", "orders"])

Query Training

from dbpa import QueryTrainer

trainer = QueryTrainer()
trainer.train("Find total sales by product category")

Configuration

DBPA can be configured using a config.json file:

{
    "ai_model": "gpt-4",
    "language": "en",
    "max_tokens": 1000,
    "temperature": 0.7
}

Contributing

We welcome contributions! Please see our Contributing Guide for details.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dbpa-0.1.0.tar.gz (5.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dbpa-0.1.0-py3-none-any.whl (23.2 kB view details)

Uploaded Python 3

File details

Details for the file dbpa-0.1.0.tar.gz.

File metadata

  • Download URL: dbpa-0.1.0.tar.gz
  • Upload date:
  • Size: 5.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for dbpa-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ef7c29cfd1bfd2a58de31a4a2ead4294fd60bac5f95626629e7a2310c909521a
MD5 0683928c3c4c1d7be6201b4d18218f5f
BLAKE2b-256 3b50e2a85d787b2469498db2ce7899291a0e6d673dbf92ee88ae37271d706b4a

See more details on using hashes here.

File details

Details for the file dbpa-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: dbpa-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 23.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for dbpa-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 88ff48f33cd240522a4e551cc4ea9a199c2adcedea6223827fb06dae4113f347
MD5 9a7b0979909cae0249e5876228befb8d
BLAKE2b-256 b96b3f74395848750b231f4e6aaf0c2a2a9b4853c081e4efcb0f93f18f32707d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page