Metadata-Version: 2.5
Name: memcell
Version: 0.1.2
Summary: Official Python SDK for MemCell persistent cognitive memory and reasoning engine
Author-email: MemCell Team <engineering@memcell.io>
License-Expression: Apache-2.0
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Requires-Dist: httpx>=0.27.0
Requires-Dist: pydantic>=2.0.0
Provides-Extra: dev
Requires-Dist: pytest-asyncio>=0.23.0; extra == 'dev'
Requires-Dist: pytest>=8.0.0; extra == 'dev'
Requires-Dist: respx>=0.21.0; extra == 'dev'
Requires-Dist: ruff>=0.3.0; extra == 'dev'
Description-Content-Type: text/markdown

# memcell

Official Python SDK for [MemCell](https://memcell.io)—persistent cognitive memory and reasoning substrate for AI coding agents.

## Installation

```bash
pip install memcell
# or
uv add memcell
# or
poetry add memcell
```

## Quickstart

### Asynchronous Client (`AsyncMemCell`)

```python
import asyncio
from memcell import AsyncMemCell

async def main():
    async with AsyncMemCell(api_key="mc_live_...") as memory:
        # Pre-flight recall before an agent acts
        recall = await memory.recall(
            namespace="acme/devops",
            query="how to deploy the canary pipeline"
        )
        print(recall.prompt_context)

        # In-flight scoped execution with automatic reinforcement
        devops = memory.scope("acme/devops", subject="pipeline:canary")
        result = await devops.wrap_execution(
            action="deploy_canary",
            external_ref="ci:run:1049",
            fn=lambda ctx: print("Deploying with context:", ctx.prompt_context)
        )

asyncio.run(main())
```

### Synchronous Client (`MemCell`)

```python
from memcell import MemCell

memory = MemCell(api_key="mc_live_...")

recall = memory.recall(
    namespace="acme/backend",
    query="database connection pool configuration"
)
for statement in recall.statements:
    print(f"[{statement.kind}] {statement.title} (confidence: {statement.confidence})")
```

### OAuth 2.0 Machine-to-Machine (M2M)

```python
from memcell import AsyncMemCell

memory = AsyncMemCell(
    client_id="client_xyz",
    client_secret="secret_xyz",
    scope="memory:read:acme/* memory:write:acme/backend"
)
# Automatically handles token exchange and proactively refreshes before expiration!
```

### Rate Limiting & Resilience

```python
from memcell import AsyncMemCell

memory = AsyncMemCell(
    api_key="mc_live_...",
    max_retries=3,
    on_rate_limit_warning=lambda warning, response: print(f"Warning: {warning}")
)
# Automatically performs jittered exponential backoff respecting server Retry-After!
```

## License

Apache-2.0 © [MemCell](https://memcell.io)
