TinyHuman Neocortex SDK (Rust)
A persistent memory layer for AI applications. Neocortex lets your AI agents store, retrieve, and use context across conversations -- so they remember what matters.
Built on the TinyHumans API.
Install
Add to your Cargo.toml:
[]
= "0.1"
Requires Rust 1.70+ and Tokio (async runtime).
Running locally
From the package directory (packages/sdk-rust):
Unit and integration tests use mocked HTTP. For end-to-end tests (hits a real backend; skipped by default):
TINYHUMANS_API_KEY=your_key
Set TINYHUMANS_BASE_URL if your backend URL differs from the default (https://staging-api.tinyhumans.ai).
Quick start
use ;
async
Core concepts
Memory items are the basic unit of storage. Each item has title, content, namespace, and optional metadata, priority, and timestamps. The API supports insert, query (RAG), delete, recall (Master node), and memories/recall (Ebbinghaus bank).
Namespaces let you organize memories by category (e.g. "preferences", "conversation-history", "user-facts").
Context is retrieved via query_memory or recall_memory and can be injected into LLM prompts as system context.
API reference
TinyHumanMemoryClient
let client = new?;
Configuration: TinyHumanConfig::new(token). Optionally set base URL with .with_base_url(url) or the TINYHUMANS_BASE_URL environment variable.
insert_memory
Insert (ingest) a document into memory. POST /v1/memory/insert.
client.insert_memory.await?;
query_memory
Query memory via RAG. POST /v1/memory/query.
let res = client.query_memory.await?;
delete_memory
Delete memory (admin). POST /v1/memory/admin/delete. Optional namespace to scope deletion.
recall_memory
Recall context from Master node. POST /v1/memory/recall.
recall_memories
Recall memories from Ebbinghaus bank. POST /v1/memory/memories/recall.
Error handling
Errors are returned as TinyHumanError: Validation, Http, Api { message, status, body }, or Decode. Use thiserror / #[error] for display and matching.
Tests
End-to-end (real backend):
TINYHUMANS_API_KEY=your_key