Skip to main content

Neurop Forge SDK - Execute 5,175+ pre-verified, hash-locked function blocks across 5 domains

Project description

Neurop Forge SDK

Execute 5,175+ pre-verified, hash-locked function blocks across 5 domains — with full audit trail.

Neurop Forge is an AI-native execution control layer. AI agents search, compose, and execute blocks — but never modify them. Every execution is deterministic, cryptographically auditable, and policy-governed.

Installation

pip install neuropforge

Quick Start

from neuropforge import NeuropForge

client = NeuropForge(api_key="your_api_key")

# Execute a block by exact name — deterministic, auditable
result = client.execute("to_uppercase", text="hello world")
print(result.result)       # "HELLO WORLD"
print(result.audit_hash)   # cryptographic proof of execution

# Search for blocks by natural language
blocks = client.search("validate email address")
for block in blocks:
    print(f"{block.name} [{block.domain}] — {block.why_selected}")

# Browse domains
for domain in client.domains():
    print(f"{domain.domain}: {domain.block_count} blocks")

Domains

Neurop Forge organizes 5,175+ blocks into 5 domains:

Domain Blocks Examples
data 4,552 String ops, math, validation, collections, date/time
crypto 218 Hashing, wallet generation, gas fee calculation
integrations 164 Webhook triggers, API calls, message formatting
payments 137 Transaction validation, fee calculation, refund processing
auth 104 Token generation, password hashing, permission checks
# List blocks in a specific domain
crypto_blocks = client.domain_blocks("crypto", limit=10)
for block in crypto_blocks:
    print(f"{block.name}: {block.description}")

Async Client

For asyncio-based agent frameworks (LangChain, CrewAI, AutoGen):

from neuropforge import AsyncNeuropForge

async with AsyncNeuropForge(api_key="your_api_key") as client:
    result = await client.execute("calculate_gas_fee", gas_limit=21000, gas_price_gwei=30.5)
    print(result.result)  # 0.0006405

    domains = await client.domains()
    blocks = await client.search("validate payment amount")

LangChain Integration

Use Neurop Forge as a LangChain tool for controlled AI execution:

from langchain.tools import tool
from neuropforge import NeuropForge

client = NeuropForge(api_key="your_api_key")

@tool
def neurop_execute(block_name: str, inputs: dict) -> str:
    """Execute a pre-verified Neurop Forge block. The AI cannot generate
    arbitrary code — it can only call verified blocks by exact name."""
    result = client.execute(block_name, **inputs)
    return str(result.result)

@tool
def neurop_search(query: str) -> str:
    """Search the Neurop Forge library for blocks matching a natural language query."""
    results = client.search(query, limit=5)
    return "\n".join(f"{r.name} [{r.domain}]: {r.why_selected}" for r in results)

CLI

The nf command-line tool is included for testing and exploration:

# Set your API key
export NEUROP_API_KEY="your_api_key"

# Check API health
nf health

# Browse domains
nf domains -v

# List blocks in a domain
nf domain-blocks crypto --limit 10 -v

# Search for blocks
nf search "validate email" -v

# Execute a block
nf exec to_uppercase --input text="hello world"

# Execute with JSON input
nf exec calculate_gas_fee --json '{"gas_limit": 21000, "gas_price_gwei": 30.5}'

# Get library statistics
nf stats

# Verify audit chain integrity
nf audit

Configuration

Set your API key via environment variable:

export NEUROP_API_KEY="your_api_key"

Or pass it directly:

client = NeuropForge(api_key="your_api_key")

Custom API endpoint (for self-hosted deployments):

client = NeuropForge(
    api_key="your_api_key",
    base_url="https://your-instance.example.com",
    timeout=60.0
)

API Reference

NeuropForge(api_key, base_url, timeout)

Initialize the sync client. Supports context manager (with).

AsyncNeuropForge(api_key, base_url, timeout)

Initialize the async client. Supports async context manager (async with).

Methods (sync and async)

Method Description Returns
execute(block_name, **inputs) Execute a block by exact name ExecutionResult
search(query, limit) Search blocks by natural language List[SearchResult]
domains() List all domains with block counts List[DomainInfo]
domain_blocks(domain, limit) List blocks in a domain List[BlockInfo]
list_blocks(limit, category) List available blocks List[BlockInfo]
health() Check API health dict
stats() Get library statistics dict
audit_chain() Get audit chain info dict

Data Classes

  • ExecutionResult: success, block_name, result, execution_time_ms, audit_hash
  • SearchResult: name, domain, operation, why_selected
  • BlockInfo: name, category, description, inputs, domain
  • DomainInfo: domain, block_count, description

Exceptions

  • NeuropForgeError: Base exception
  • BlockNotFoundError: Block doesn't exist
  • ExecutionError: Block execution failed
  • AuthenticationError: Invalid or missing API key
  • RateLimitError: Rate limit exceeded

Why Neurop Forge?

  • Deterministic: Same inputs always produce same outputs
  • Auditable: Every execution has a cryptographic audit hash
  • Secure: AI can only execute verified blocks, never arbitrary code
  • Compliant: Designed for SOC 2, HIPAA, PCI-DSS environments
  • Domain-organized: 5 domains for clear separation of concerns

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

neurop_forge_sdk-2.0.0.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

neurop_forge_sdk-2.0.0-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file neurop_forge_sdk-2.0.0.tar.gz.

File metadata

  • Download URL: neurop_forge_sdk-2.0.0.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for neurop_forge_sdk-2.0.0.tar.gz
Algorithm Hash digest
SHA256 8efa6942e9de99495bc59c456fecae47431ddc7a0be978653db369d428d16008
MD5 9bce786c2ab3140e42641f8051794927
BLAKE2b-256 bfa9c01b0a047cc120526a5d8e3e4a13132929517d61048645828c357d753c42

See more details on using hashes here.

File details

Details for the file neurop_forge_sdk-2.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for neurop_forge_sdk-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 960aeeda2023c23a1fb3877dfb8b100aa6a0d1f80af7962f93549612a3335897
MD5 e35780a7ce799a5821fbc04ee410b43b
BLAKE2b-256 f0250ac85a7b1cd01c6c095c77edc4fb473a31151b5940c271d80083c8556f43

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page