A conversational AI application designed to generate synthetic data and perform natural language data querying on SQL schemas. This project uses Google's Gemini 2.0 Flash model, Streamlit for the UI, and PostgreSQL for data storage.
- Python: 3.13+
- uv: Fast Python package installer and resolver
- Docker & Docker Compose: For running the database and application containerized.
-
Clone the repository:
git clone <repository-url> cd ai-app
-
Install
uv(if not installed):# On macOS/Linux curl -LsSf https://astral.sh/uv/install.sh | sh # On Windows powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
-
Install Dependencies: This command creates a virtual environment and installs both project and development dependencies (like
pytest,pylint,mypy).uv sync --extra dev
-
Environment Setup: Create a
.envfile in the root directory based on your configuration:# .env # Google Cloud / Vertex AI GOOGLE_CLOUD_PROJECT=your-project-id GOOGLE_CLOUD_LOCATION=us-central1 # Database DB_USER=postgres DB_PASSWORD=postgres DB_NAME=synthetic_db DB_HOST=db DB_PORT=5432 # Langfuse LANGFUSE_SECRET_KEY=sk-lf-... LANGFUSE_PUBLIC_KEY=pk-lf-... LANGFUSE_HOST=https://cloud.langfuse.com
This spins up both the Streamlit app and the PostgreSQL database.
docker compose upThis project uses pylint for linting and mypy for static type checking.
Run Linting:
uv run pylint src testsRun Type Checking:
uv run mypyRun Tests:
uv run pytest