# Piggie SDK

Python SDK for Apache AGE + pgvector on PostgreSQL.

Graph queries, vector search, and hybrid graph+vector operations — all in one PostgreSQL instance.

## Installation

```bash
pip install piggie

# With pandas support
pip install piggie[pandas]

# With all optional dependencies
pip install piggie[all]
```

## Quick Example

```python
import piggie

db = piggie.connect("postgresql://localhost:5433/mydb", graph="my_graph")

# Cypher queries → DataFrames
df = db.cypher("MATCH (n:Person) RETURN n.name, n.age").to_df()

# Vector search
results = db.vector_search("documents", "embedding", query_vec, k=10).to_df()

# Hybrid: graph traversal + vector similarity
results = db.hybrid_search(
    cypher="MATCH (p:Paper)-[:CITES]->(cited) RETURN cited",
    vector_table="papers",
    vector_column="abstract_embedding",
    query_vector=query_vec,
    k=10,
).to_df()
```

## What's Inside

- **[Quick Start](guide/quickstart.md)** — Get up and running in 5 minutes
- **[API Reference](guide/api-reference.md)** — Full method signatures and parameters
- **[Integrations](guide/integrations.md)** — LangChain, LlamaIndex, NetworkX, PyTorch Geometric

## Requirements

- Python 3.10+
- PostgreSQL with [Apache AGE](https://age.apache.org/) and [pgvector](https://github.com/pgvector/pgvector) extensions

## License

Apache 2.0
