Metadata-Version: 2.4
Name: uams-sdk
Version: 1.0.2
Summary: Official Python SDK and MCP server for the Unified Agent Memory System (UAMS).
Author: Shivam Sharma
Project-URL: Homepage, https://github.com/Shivamsharma6/unified_memory
Project-URL: Repository, https://github.com/Shivamsharma6/unified_memory.git
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.27.0
Requires-Dist: pydantic>=2.0.0
Requires-Dist: cachetools>=5.3.0
Requires-Dist: mcp[cli]<1.13,>=1.12.4
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-asyncio; extra == "dev"

# UAMS Shared Memory SDK

A unified, asynchronous Python SDK for the **Unified Agent Memory System (UAMS)**. 
Designed to be shared natively by both **Hermes** and **OpenClaw** agents.

## Features
- **Unified Client:** One standard interface for all agents.
- **Async First:** Built on `httpx` for non-blocking operations.
- **Intelligent Caching:** Built-in TTL caching with automatic invalidation on writes.
- **Full API Coverage:** Semantic search, graph traversal, context compression, and writes.
- **MCP Adapter:** Exposes UAMS as standard MCP tools, resources, and prompts for agent tool discovery.

## Installation
```bash
pip install -e .
```

## Usage
```python
import asyncio
from uams_sdk import UAMSClient

async def main():
    client = UAMSClient(base_url="http://localhost:8000")
    task = "How do I fix Docker file locks?"

    # Default preflight before the agent works.
    memory = await client.begin_task(task)
    print(memory["context"])

    # Default write-back after durable work.
    await client.end_task(
        task=task,
        outcome="Documented the Docker file-lock workaround.",
        entities=["Docker File Locks"],
        tags=["#procedure"],
    )

asyncio.run(main())
```

## MCP Server

Run the adapter from the repository root:

```bash
./uams mcp
```

Or run the installed console entry point:

```bash
UAMS_API_URL=http://localhost:8000 uams-mcp
```

Agent MCP config:

```json
{
  "mcpServers": {
    "uams": {
      "command": "/absolute/path/to/unified_memory/uams",
      "args": ["mcp"],
      "env": {
        "UAMS_API_URL": "http://localhost:8000"
      }
    }
  }
}
```

Generate snippets from the repository root:

```bash
./uams mcp-config all
./uams mcp-config codex
./uams mcp-config json
```

Discovered MCP capabilities:

- Tools: `begin_task`, `end_task`, `health`, `search_memory`, `get_context`, `get_procedures`, `remember`, `get_related_entities`, `summarize_memory`, `store_fix_summary`
- Resource: `uams://memory-policy`
- Prompt: `use_uams_memory`

Agent default protocol:

```text
Before each non-trivial task, call `begin_task`.
During work, call `search_memory` when more recall is needed.
After durable work, call `end_task`.
Never store raw transcripts; store distilled facts, decisions, fixes, and procedures.
```
