Skip to main content

Neura Python SDK

External brain for AI agents — persistent memory and state via HTTP.

from neura import Neura

neura = Neura(api_key="sk-...")

# Store a memory
neura.memory.create(content="User prefers dark mode", tags=["preference"])

# Semantic search
results = neura.memory.search("What are my preferences?")

# Persistent state
neura.state.set("current_goal", {"task": "Build the API"})
goal = neura.state.get("current_goal")

Install

pip install neura-api

Usage

Memory

# Create
mem = neura.memory.create(
    content="The user likes brutalist design",
    tags=["preference", "ui"],
    importance=8,
    metadata={"source": "conversation"},
)

# Semantic search
results = neura.memory.search("design preferences")

# Advanced search with filters
filtered = neura.memory.search_advanced(
    query="user settings",
    filters={"tags": ["preference"], "importance_min": 5},
    limit=20,
)

# Update
neura.memory.update(mem["id"], importance=9)

# Delete
neura.memory.delete(mem["id"])

State

# Set
neura.state.set("risk_level", "conservative")

# Get
risk = neura.state.get("risk_level")
# {"key": "risk_level", "value": "conservative", ...}

# List all
all_state = neura.state.list()

# Delete
neura.state.delete("risk_level")

Error Handling

from neura import NeuraHttpError

try:
    neura.memory.search("something")
except NeuraHttpError as e:
    print(e.code)         # 'rate_limited', 'not_found', etc.
    print(e.message)      # Human-readable
    print(e.action)       # 'wait_and_retry', 'check_api_key', etc.
    print(e.retry_after)  # Seconds to wait

Retries

The SDK automatically retries on network errors and rate limits with exponential backoff.

API

Method Endpoint Description
memory.create() POST /api/memory Store with auto-embedding
memory.search() GET /api/memory?query= Semantic search
memory.search_advanced() POST /api/memory/search Filtered search
memory.update() PATCH /api/memory/:id Update fields
memory.delete() DELETE /api/memory/:id Remove memory
state.set() POST /api/state Upsert key-value
state.get() GET /api/state/:key Get value by key
state.list() GET /api/state List all keys
state.delete() DELETE /api/state/:key Remove key

Metadata

Release files for neura-api-python 0.3.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 neura-api-python 0.3.0
File Size Uploaded Provenance Actions
neura_api_python-0.3.0.tar.gz 8.7 kB Without provenance Details for neura_api_python-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for neura-api-python 0.3.0
File Interpreter ABI Platform Actions
neura_api_python-0.3.0-py3-none-any.whl Python 3 none any Details for neura_api_python-0.3.0-py3-none-any.whl

Total release size: 19.1 kB

Release files / neura_api_python-0.3.0.tar.gz

Download URL neura_api_python-0.3.0.tar.gz
Size 8.7 kB
Tags Source
SHA-256 checksum
How to use checksums
ccf188e4d28a1aa8624712714cfef0652f353d28e167a7d581e3686f1b4b7a61
BLAKE2b-256 checksum
How to use checksums
9fbeb6f37766c446ccc4e5d7213e87f4a767252f193cbc2549b2bc2d8e55a872
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / neura_api_python-0.3.0-py3-none-any.whl

Download URL neura_api_python-0.3.0-py3-none-any.whl
Size 10.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9957a92dd7116bfad80e942ed23b73375f82eae1cb3375fb348436a749a84a2f
BLAKE2b-256 checksum
How to use checksums
b75ed7f51c051458f7abbf033300b33c0fe238b2179a9e13505d9e101220b068
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for neura-api-python 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files No provenance

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