Skip to main content

novyx-agent

Build AI agents with persistent memory, rollback, and audit trails.

from novyx_agent import Agent, tool

agent = Agent(
    name="Aria",
    api_key="nram_...",
    provider="anthropic",       # or "openai" or "litellm"
    model="claude-sonnet-4-6",
)

@agent.tool
def search_web(query: str) -> str:
    """Search the web for information."""
    return requests.get(f"https://api.search.com?q={query}").text

result = agent.run("What did we discuss yesterday?")
print(result)

That's it. The agent automatically recalls relevant memories before every LLM call, executes tools, and remembers the exchange for next time.

v2.0 note: provider and model are now required. Novyx is provider-agnostic — pick openai, anthropic, or litellm (for any other model). No hidden defaults.

Why novyx-agent?

Every agent framework gives you tool calling. None of them give you this:

# Roll back the agent's memory to before it went off the rails
agent.rollback("2 hours ago")

# Cryptographic audit trail — every memory operation, hash-chained
trail = agent.audit(limit=50)

# Memory health check — recall accuracy, drift, conflicts, staleness
health = agent.eval()
assert health["score"] >= 0.8, "Memory quality too low"

# Pass/fail gate for CI/CD
agent.eval_gate(min_score=0.7)

# Knowledge graph
agent.add_triple("Python", "is_a", "programming language")
triples = agent.query_triples(subject="Python")

No other agent SDK has rollback, audit trails, eval, or replay. Not OpenAI Agents SDK, not CrewAI, not LangGraph, not Pydantic AI.

Install

pip install novyx-agent

# Pick your LLM provider:
pip install novyx-agent[openai]      # OpenAI / OpenAI-compatible
pip install novyx-agent[anthropic]   # Claude
pip install novyx-agent[litellm]     # Any model via LiteLLM
pip install novyx-agent[all]         # All providers

Quick Start

1. Basic agent

from novyx_agent import Agent

agent = Agent(
    name="Assistant",
    api_key="nram_your_key",
    provider="openai",
    model="gpt-4o",
)

result = agent.run("Summarize what we've been working on")
print(result)

2. Agent with tools

from novyx_agent import Agent, tool

agent = Agent(
    name="ResearchBot",
    api_key="nram_...",
    provider="anthropic",
    model="claude-sonnet-4-6",
)

@agent.tool
def search_docs(query: str, limit: int = 5) -> str:
    """Search internal documentation."""
    return f"Found {limit} results for: {query}"

@agent.tool
def create_ticket(title: str, body: str) -> str:
    """Create a support ticket."""
    return f"Created ticket: {title}"

result = agent.run("Find docs about auth and create a ticket for the bug")
print(result)
print(f"Tools used: {[tc.tool for tc in result.tool_calls]}")

3. Agent with Claude

agent = Agent(
    name="Claude Agent",
    api_key="nram_...",
    provider="anthropic",
    model="claude-sonnet-4-6",
)

4. Agent with any model (LiteLLM)

agent = Agent(
    name="Universal",
    api_key="nram_...",
    provider="litellm",
    model="ollama/llama3",      # or "gemini/gemini-1.5-pro", "groq/llama3-70b", etc.
)

5. Memory control

from novyx_agent import Agent, MemoryConfig

agent = Agent(
    name="Selective",
    api_key="nram_...",
    provider="anthropic",
    model="claude-sonnet-4-6",
    memory=MemoryConfig(
        auto_recall=True,           # Recall before each run
        auto_remember=True,         # Remember after each run
        recall_limit=10,            # Max memories to recall
        recall_threshold=0.5,       # Minimum relevance score
        recall_tags=["project-x"],  # Only recall tagged memories
        remember_tags=["project-x"],# Tag stored memories
        remember_importance=8,      # 1-10 importance
    ),
)

6. Rollback & audit

# Oops, the agent stored bad data
agent.rollback("30 minutes ago")

# Preview before committing
preview = agent.rollback_preview("1 hour ago")
print(f"Would restore {preview['restore_count']} memories")

# Full audit trail
for entry in agent.audit(limit=20):
    print(f"{entry['action']} at {entry['timestamp']}")

7. Eval gates for CI/CD

health = agent.eval()
print(f"Memory score: {health['score']}")
# score = 0.7*recall + 0.2*freshness + 0.1*consistency

# Hard gate — raises if below threshold
agent.eval_gate(min_score=0.7)

8. Direct Novyx access

# Full SDK access for advanced operations
nx = agent.novyx
nx.dashboard()
nx.cortex_run()
nx.replay_timeline(hours=24)

Architecture

novyx-agent
├── agent.py      — Agent class (run loop, memory integration)
├── tools.py      — @tool decorator (auto-schema from type hints)
├── types.py      — Pydantic models (ToolDef, RunResult, configs)
├── providers.py  — LLM adapters (OpenAI, Anthropic, LiteLLM)
└── __init__.py   — Public API

The run loop:

  1. Recall — semantic search over Novyx memories relevant to the prompt
  2. Build context — system prompt + recalled memories + conversation history + user message
  3. LLM loop — call the model → if tool calls, execute them → repeat until text response
  4. Remember — store a summary of the exchange as a new memory
  5. ReturnRunResult with output, tool calls, memory stats, token usage

API Reference

Agent

Method Description
run(prompt) Run the agent on a prompt
remember(observation) Store a memory
recall(query) Search memories
forget(memory_id) Delete a memory
rollback(target) Roll back memory state
rollback_preview(target) Preview rollback
audit(**kwargs) Get audit trail
eval() Run memory health eval
eval_gate(min_score) Pass/fail gate
add_triple(s, p, o) Add knowledge graph triple
query_triples(**kwargs) Query knowledge graph
clear_history() Clear conversation history
novyx Direct Novyx SDK access

@tool

@tool
def my_function(param: str, count: int = 5) -> str:
    """Description becomes the tool description."""
    return "result"

Automatically extracts: name, description (from docstring), parameters (from type hints), required/optional (from defaults).

RunResult

Field Type Description
output str The agent's text response
tool_calls List[ToolCall] Tools invoked during the run
memories_recalled int Memories retrieved
memories_stored int Memories created
model str Model used
usage Dict[str, int] Token usage

License

MIT

Release files for novyx-agent 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for novyx-agent 2.0.0
File Size Uploaded
novyx_agent-2.0.0.tar.gz 26.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for novyx-agent 2.0.0
File Interpreter ABI Platform
novyx_agent-2.0.0-py3-none-any.whl Python 3 none any Details

Total release size:47.3 kB

Release files / novyx_agent-2.0.0.tar.gz

Download URL novyx_agent-2.0.0.tar.gz
Size 26.3 kB
Tags Source
SHA-256 checksum
How to use checksums
c594fcc561ffb9e3855ca684f7b134659333ea544eff46f8c255bcfd245b1a7a
BLAKE2b-256 checksum
How to use checksums
4a1cda8502f881c7a06934a5ef5167b125f654ab2d22ba6fa62b0993cd56c347
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14

Release files / novyx_agent-2.0.0-py3-none-any.whl

Download URL novyx_agent-2.0.0-py3-none-any.whl
Size 21.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b4279b1a8ebbc71b5a5c1dd4f4f72fabfb6049999791e59ffd5133a99c9db5c9
BLAKE2b-256 checksum
How to use checksums
698fb081fcb5b263c0fd83f685664d3ae6f3e34f23632ccb99b3f7201c4bf369
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.14

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page