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.2.tar.gz (59.0 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.2-py3-none-any.whl (90.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for artha_engine-0.1.2.tar.gz
Algorithm Hash digest
SHA256 747ad65d7c18d38305be8a68d47ba377fb582e75c3c8d671b0ceaac97ee78bec
MD5 4adaa4993bd6a9dde3ed5aeb87c43f00
BLAKE2b-256 58c88a51b851a36c67e88441fc2787ce9e0b12610c2bd44c6c32a67744d276e6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for artha_engine-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a91f52e2826ba958b3e258e99e5b080f4f78f877c250f5fd52c238f40400457a
MD5 3790f74248c520f134a67018e102fd22
BLAKE2b-256 e80e50e94ffb1735422e7f3885a243e76775677285ad4d132e452ed394691435

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