Metadata-Version: 2.4
Name: engram-client
Version: 0.4.0
Summary: Python client for Engram Cloud - AI memory infrastructure
Author: Ronaldo Lima
License: MIT
Project-URL: Homepage, https://github.com/limaronaldo/engram
Project-URL: Repository, https://github.com/limaronaldo/engram-python-sdk
Keywords: engram,ai,memory,mcp,agents
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.25.0
Provides-Extra: langchain
Requires-Dist: langchain-core>=0.3.0; extra == "langchain"
Provides-Extra: crewai
Requires-Dist: crewai>=0.86.0; extra == "crewai"
Provides-Extra: openai
Requires-Dist: openai>=1.0.0; extra == "openai"
Provides-Extra: llamaindex
Requires-Dist: llama-index-core>=0.11.0; extra == "llamaindex"
Dynamic: license-file

# engram-client

[![PyPI](https://img.shields.io/pypi/v/engram-client)](https://pypi.org/project/engram-client/)
[![Python](https://img.shields.io/pypi/pyversions/engram-client)](https://pypi.org/project/engram-client/)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)

Python client for [Engram Cloud](https://github.com/limaronaldo/engram-cloud) - AI memory infrastructure for agents.

## Installation

```bash
pip install engram-client
```

## Quick Start

```python
from engram_client import EngramClient

client = EngramClient(
    base_url="https://engram-cloud-gateway.fly.dev",
    api_key="ek_...",
    tenant="my-tenant",
)

# Create a memory
memory = client.create(
    "User prefers dark mode",
    tags=["preferences", "ui"],
    workspace="my-project",
)

# Search (hybrid: BM25 + vector + fuzzy)
results = client.search("user preferences")

# List with filters
memories = client.list(limit=20, workspace="my-project")

# Get by ID
memory = client.get(42)

# Update
client.update(42, content="User prefers light mode", tags=["preferences"])

# Delete
client.delete(42)

# Stats
stats = client.stats()
```

## Context Manager

```python
with EngramClient(base_url="...", api_key="...", tenant="...") as client:
    client.create("Hello from Python SDK")
```

## API Reference

### `EngramClient(base_url, api_key, tenant)`

| Method | Description |
|--------|-------------|
| `create(content, **kwargs)` | Create a memory |
| `get(id)` | Get memory by ID |
| `update(id, **kwargs)` | Update a memory |
| `delete(id)` | Delete a memory |
| `list(**kwargs)` | List memories with filters |
| `search(query, **kwargs)` | Hybrid search |
| `stats()` | Storage statistics |

### Parameters

**create / update kwargs:** `tags`, `workspace`, `memory_type`, `importance`, `metadata`, `tier`

**list kwargs:** `limit`, `offset`, `workspace`, `memory_type`, `tags`, `sort_by`, `sort_order`

**search kwargs:** `limit`, `workspace`, `tags`, `memory_type`, `include_archived`

## Requirements

- Python >= 3.9
- httpx >= 0.25.0

## Related

- [Engram](https://github.com/limaronaldo/engram) - Core memory engine (Rust)
- [Engram Cloud](https://github.com/limaronaldo/engram-cloud) - Multi-tenant SaaS gateway
- [engram-client](https://www.npmjs.com/package/engram-client) - TypeScript client

## License

MIT
