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.1.tar.gz (58.7 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.1-py3-none-any.whl (89.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for artha_engine-0.1.1.tar.gz
Algorithm Hash digest
SHA256 4d2467689c2461a2d4e8ee787bc0a111a36edfc8042b114d778ceacc10463b8c
MD5 9b2b4bcef9bca3478ad37acfe5674e8f
BLAKE2b-256 f8808e98b9422c481e38074d43e71ed0768e5f120791cfb5e23aecd5a0cdc157

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for artha_engine-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 42225e098a3c0fa9fd7b80f8c33a94f0122c9e70cd71f091f34e11d14ec8316c
MD5 e9c05e11e9e9e6e8381bf7db46d80e03
BLAKE2b-256 e0b7602af7b52dba2b3b60aa22e9e5243649f012c5ebcd133fcd3a36373c0099

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