Skip to main content

Semantic memory engine with append-only event ledger, Arthaanu representations, and projection replay.

Project description

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
  • typed product actions exposed as HTTP, MCP, and CLI tools
  • Clerk/JWT/API-key authentication adapters
  • portable OCI application builds
  • a small artha CLI 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.

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.

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

artha_engine-0.1.3.tar.gz (59.1 kB view details)

Uploaded Source

Built Distribution

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

artha_engine-0.1.3-py3-none-any.whl (90.1 kB view details)

Uploaded Python 3

File details

Details for the file artha_engine-0.1.3.tar.gz.

File metadata

  • Download URL: artha_engine-0.1.3.tar.gz
  • Upload date:
  • Size: 59.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.7

File hashes

Hashes for artha_engine-0.1.3.tar.gz
Algorithm Hash digest
SHA256 da0a70fac1c20f4bc5efd48ff08b6209629267bc9f74fbb10ac61f0bc5e4e4ac
MD5 6d26c3e57706ff02d47897919521d0de
BLAKE2b-256 6e2a4a194e383f228e073920c23243d0dd031378eff22f60c0f0cdf12a20a400

See more details on using hashes here.

File details

Details for the file artha_engine-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for artha_engine-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f982c4072969ae02aae5104f4af84304c9460f77626f9d178ce22ecea374f060
MD5 d3c8f9d922b33188e61046cc1fa02200
BLAKE2b-256 8ce47390fcf1522eabc9796255e41cdf997e2549b173b64fb9720f375257612d

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