Artha Engine
Artha Engine is the core Python library for building Arthaanu-based memory systems. It provides:
- typed Arthaanu representations
- encoder, lifecycle, decoder, and projection registries
- an append-only semantic event ledger
- SQLite and in-memory stores
- projection replay with watermarks and status
- semantic write helpers for append-then-refresh recipes
- generic vector search and ranked-leg fusion helpers
- typed product actions exposed as HTTP, MCP, and CLI tools
- application manifests and OpenAPI export from action schemas
- transport-neutral job status helpers
- Clerk/JWT/API-key authentication adapters
- portable OCI application builds
- a small
arthaCLI for inspection and local operation
The engine is intentionally small. Product-specific memory types, profiles, retrieval policy, and domain projections should usually live in userland packages built on top of the engine.
Install Locally
From this repository:
cd artha_engine
uv sync
uv run artha doctor
To run the FastAPI runtime:
uv sync --extra server
uv run artha serve --port 8765
Create product actions with one typed declaration:
@actions.action(
name="memory.search",
http=("POST", "/memories/search"),
mcp=True,
cli="memory search",
scopes=["memory:read"],
)
def search(input: SearchInput, context: ActionContext) -> SearchOutput:
...
CLI
artha doctor
artha registry
artha encode text --input "Artha keeps semantic events canonical."
artha events --limit 5
artha objects --limit 5
artha projections
artha check
artha build
Use --db path/to/artha.db to point commands at a specific SQLite ledger.
Most commands support --json for agent-friendly output.
Application CLIs generated from @actions.action(..., cli=...) also support
remote mode:
memuron --base-url https://api.example.app --api-key arth_sk_... memory search --query postgres
memuron config set --base-url https://api.example.app --api-key arth_sk_...
Remote mode calls the action's HTTP route instead of requiring a local database.
Install artha-engine[app] (or your product package with the same extra) for
httpx support.
HTTP applications also expose discovery contracts:
GET /_artha/manifest
GET /_artha/openapi
Use these for consoles, docs sites, SDK generation, and remote clients instead of maintaining a separate route catalog.
Managed API keys
Products can enable per-tenant API keys with one application hook:
from artha_engine import ArthaApplication, CompositeAuthProvider, ClerkAuthProvider
from artha_engine.app.managed_api_keys import ManagedApiKeyAuthProvider
application = ArthaApplication(...)
store = application.enable_managed_api_keys()
application.auth_provider = CompositeAuthProvider(
primary=ClerkAuthProvider(),
fallback=ManagedApiKeyAuthProvider(store=store),
)
This registers:
POST /api-keys
GET /api-keys
DELETE /api-keys/{key_id}
Keys are returned once on create (arth_sk_...), stored hashed, scoped, and
tenant-bound. A bootstrap ARTHA_API_KEY env var still works for ops scripts.
Metadata
Release files for artha-engine 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| artha_engine-0.1.4.tar.gz | 62.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| artha_engine-0.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 158.0 kB
Release files / artha_engine-0.1.4.tar.gz
| Download URL | artha_engine-0.1.4.tar.gz |
|---|---|
| Size | 62.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9dcc74e616d5d71cbfad8e77b011c5bfdfb506b098fe3c3719edafdbc2cfee9d
|
|
BLAKE2b-256 checksum How to use checksums |
df4f98a7c804adaf9fb170dc7ea84171bd230f6c671f1d1ef249338937f329fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.7
|
Release files / artha_engine-0.1.4-py3-none-any.whl
| Download URL | artha_engine-0.1.4-py3-none-any.whl |
|---|---|
| Size | 95.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
889c5c73192505c17365a3bc9b89ffb8ac39b214652bed00dcd3ac0e9747d421
|
|
BLAKE2b-256 checksum How to use checksums |
39b8bbbbae791e8e80e3b0a36e7d9ecc80f017dd24f5c5ff104b2bd931955a78
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.7
|