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 0.1.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 0.1.0
File Size Uploaded
neura_api-0.1.0.tar.gz 7.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for neura-api 0.1.0
File Interpreter ABI Platform
neura_api-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 15.8 kB

Release files / neura_api-0.1.0.tar.gz

Download URL neura_api-0.1.0.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
8513da5f66ce10cf524519e945ba1885acb8587ceb5d3072583e0ffc615ea3dd
BLAKE2b-256 checksum
How to use checksums
7e8fa98aef293526d33293b3981a0ac9593fd3793f5dc69705ef422412c61ab5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / neura_api-0.1.0-py3-none-any.whl

Download URL neura_api-0.1.0-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b263ed170fbe0d2f4d2bb084564e880ebd21e7d5db0fb0c021a995bf44d2a36a
BLAKE2b-256 checksum
How to use checksums
22aa5432974a0d4e75f76c20bf14f646c9e65c2539da3de6c84818b8572bc37a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

0.1.0 This release

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