Skip to content

Latest commit

 

History

History
52 lines (35 loc) · 1.79 KB

File metadata and controls

52 lines (35 loc) · 1.79 KB

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

PII Agent — an AI agent demo that interacts with PII data through a Postgres database. The data/ folder is a self-contained database setup (schema, loader, Docker) separate from the agent itself.

Environment

  • Python: 3.12 (managed via uv)
  • Package manager: uv
  • Virtual environment: .venv/

Architecture

The project has two separate concerns:

  • data/ — Database provisioning: Docker Compose, SQLAlchemy model, CSV loader. This only sets up the demo database.
  • Agent code (TBD) — Will interact with the database through its own integration, not through data/.

Database Setup (data/)

  • data/docker-compose.yml — Postgres 16 container (pii_user/pii_password/pii_demo)
  • data/model.py — SQLAlchemy ORM model: Base and Person (flat table, 16 string columns matching CSV)
  • data/load_csv.py — Idempotent CSV loader with load_csv(engine, csv_path) function and CLI entry point
  • data/sample-pii-data.csv — 30 rows of sample PII data

Commands

# Install dependencies
uv pip install -r data/requirements.txt

# Start Postgres
docker compose -f data/docker-compose.yml up -d

# Load sample data into Postgres
python -m data.load_csv

# Run tests
python -m pytest data/tests/ -v

# Run a single test
python -m pytest data/tests/test_model.py::test_person_table_columns -v

Key Details

  • Connection string: postgresql+psycopg://pii_user:pii_password@localhost:5432/pii_demo
  • DATABASE_URL env var overrides the default connection string in load_csv.py
  • All Person columns are strings (including dates) — intentional simplicity for the demo
  • load_csv() is idempotent — skips rows whose id already exists