Metadata-Version: 2.4
Name: novyx-crewai
Version: 1.1.1
Summary: Persistent memory + rollback + audit trail for CrewAI agents using Novyx Core
Author-email: Novyx Labs <blake@novyxlabs.com>
Maintainer-email: Novyx Labs <blake@novyxlabs.com>
License: MIT
Project-URL: Homepage, https://novyxlabs.com
Project-URL: Documentation, https://novyxlabs.com/docs
Project-URL: Repository, https://github.com/novyxlabs/novyx-core
Project-URL: Changelog, https://github.com/novyxlabs/novyx-core/blob/main/packages/novyx-crewai/CHANGELOG.md
Project-URL: Issues, https://github.com/novyxlabs/novyx-core/issues
Keywords: crewai,novyx,memory,ai,agents,llm,persistent,semantic,rag
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: novyx>=2.9.0
Provides-Extra: crewai
Requires-Dist: crewai>=0.80.0; extra == "crewai"
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: ruff>=0.1.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Dynamic: license-file

# novyx-crewai

[![PyPI version](https://img.shields.io/pypi/v/novyx-crewai.svg)](https://pypi.org/project/novyx-crewai/)
[![Python versions](https://img.shields.io/pypi/pyversions/novyx-crewai.svg)](https://pypi.org/project/novyx-crewai/)
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)

**Persistent memory storage for CrewAI agents using Novyx Core.**

Drop-in storage backend that gives your CrewAI agents persistent, semantic memory powered by [Novyx RAM](https://novyxlabs.com).

## Installation

```bash
pip install novyx-crewai
```

## Quick Start

### 1. Get an API Key

Sign up at [novyxlabs.com](https://novyxlabs.com) to get your API key.

### 2. Use with CrewAI

```python
import os
from crewai import Agent, Crew, Task
from novyx_crewai import NovyxStorage

# Create persistent storage backed by Novyx
storage = NovyxStorage(
    api_key=os.getenv("NOVYX_API_KEY"),
    memory_type="short_term",
)

# Create an agent
researcher = Agent(
    role="Researcher",
    goal="Find and summarize information",
    backstory="You are a research assistant.",
    verbose=True,
)

task = Task(
    description="Research the latest trends in AI agents.",
    expected_output="A short summary of trends.",
    agent=researcher,
)

# Build a crew with Novyx-backed memory
crew = Crew(
    agents=[researcher],
    tasks=[task],
    memory=True,
    short_term_memory=storage,
)

result = crew.kickoff()
print(result)
```

### 3. Standalone Usage

You can also use `NovyxStorage` directly without CrewAI:

```python
from novyx_crewai import NovyxStorage

storage = NovyxStorage(api_key="nram_xxx")

# Save a memory
storage.save("The user prefers concise answers.", agent="researcher")

# Search memories
results = storage.search("user preferences", limit=5)
for r in results:
    print(f"[{r['score']:.2f}] {r['context']}")

# Clear all memories for this storage type
storage.reset()
```

## API

### `NovyxStorage(api_key, memory_type="short_term", api_url=None)`

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `api_key` | `str` | required | Your Novyx API key |
| `memory_type` | `str` | `"short_term"` | Memory type tag (e.g. `short_term`, `long_term`, `entity`) |
| `api_url` | `str` | `None` | Custom API URL (defaults to Novyx production) |

### Methods

- **`save(value, metadata=None, agent=None)`** -- Store a memory with optional metadata and agent tag.
- **`search(query, limit=10, score_threshold=0.5)`** -- Search memories. Returns `list[dict]` with `"context"` and `"score"` keys.
- **`reset()`** -- Delete all memories tagged with this storage's memory type.

## License

MIT License - see [LICENSE](LICENSE) for details.

## Links

- [Novyx Core](https://novyxlabs.com)
- [Documentation](https://docs.novyxlabs.com/integrations/crewai)
- [GitHub](https://github.com/novyxlabs/novyx-crewai)
