The registry is a local-first, OCI-distributable system for managing agent configurations, secrets, and parameters. It is backed by TinyDB for local persistence and ORAS for OCI artifact distribution.
$ALQUIMIA_REGISTRY_DIR/ (default: ~/.local/share/alquimia)
├── metadata.json # All agentspace metadata
│ └── dist.json # Agents, secrets, parameters (TinyDB)
└── history/ # Persisted local sessions
from alquimia.registry.registry import AlquimiaRegistry
registry = AlquimiaRegistry ()
registry. load ( { " agentspace_id " : " default " } )
# registry.current_agentspace is now set
Method Description create(metadata)Create a new agentspace load(selector)Load an agentspace by selector save(data)Update agentspace metadata destroy()Delete the agentspace and all data list_repos()List all agentspaces query_repos(filters)Filter agentspaces by TinyDB predicates
Method Description add_agent(spec)Upsert an agent specification get_agent(assistant_id)Get a single agent by ID list_agents()List all agents in the current agentspace query_agents(selector)Filter agents by TinyDB predicates delete_agents(filters)Delete agents matching filters
Method Description add_secret(secret)Register a secret definition list_secrets()List all secrets query_secrets(filters)Filter secrets delete_secrets(filters)Delete secrets matching filters
Method Description add_parameters(param_def)Register parameter definitions list_parameters()List all parameters query_parameters(filters)Filter parameters delete_parameters(filters)Delete parameters matching filters
Method Description push(tag, **annotations)Publish agentspace to OCI registry pull(source_repo_id)Fetch agentspace from OCI registry delete_manifest(tag)Remove a published manifest
Secrets are referenced in agent specs with $secretRef markers:
{ "api_key" : { "$secretRef" : " OPENAI_API_KEY " } }
key: str # The secret key name
scope: str # "global", "shared", or "local"
description: str | None = None
Resolver ALQUIMIA_REGISTRY_SECRET_RESOLVERBackend EnvSecretResolverenv (default)Environment variables VaultSecretResolvervaultHashiCorp Vault KV v2
Scope Key pattern Example global{KEY}OPENAI_API_KEYshared{realm}_{KEY}abc123_OPENAI_API_KEYlocal{realm}_{assistant_id}_{KEY}abc123_mybot_OPENAI_API_KEY
Agent configurations are distributed as OCI artifacts:
Artifact type: application/vnd.alquimia.registry.v1
Layer media type: application/vnd.alquimia.registry.dist.v1+json
alquimia registry publish --agentspace-id default --tag v1.0.0
alquimia registry fetch --agentspace-id default --source ghcr.io/myorg/my-agents:v1.0.0
Registry data is encrypted at rest when ALQUIMIA_REGISTRY_KEY is set (added in 0.3.2). The storage layer uses AES-256-GCM via the cryptography library.
Feature Description Algorithm AES-256-GCM Key source ALQUIMIA_REGISTRY_KEY (base64-encoded 32-byte key)Key ID ALQUIMIA_REGISTRY_KEY_ID (stored in envelope for key rotation)Format JSON envelope: {"_enc": {"v": 1, "kid": "...", "nonce": "...", "ct": "..."}} Fallback If ALQUIMIA_REGISTRY_KEY is absent, storage operates in plaintext mode (backward compatible)
Existing unencrypted registries remain readable. New writes become encrypted as soon as ALQUIMIA_REGISTRY_KEY is configured.
python -c " import base64, secrets; print(base64.b64encode(secrets.token_bytes(32)).decode()) "
export ALQUIMIA_REGISTRY_KEY = " <base64-encoded-32-byte-key> "
export ALQUIMIA_REGISTRY_KEY_ID = " key-2024-01 "
Variable Default Description ALQUIMIA_REGISTRY_DIR~/.local/share/alquimiaLocal registry storage directory ALQUIMIA_LOCAL_SESSIONS_DIR$ALQUIMIA_REGISTRY_DIR/historySession persistence directory ALQUIMIA_REGISTRY_SECRET_RESOLVERenvSecret resolver backend ALQUIMIA_OCI_REGISTRY_DEFAULTghcr.ioDefault OCI registry ALQUIMIA_REGISTRY_KEYnullAES-256-GCM encryption key (base64-encoded 32-byte) ALQUIMIA_REGISTRY_KEY_IDnullKey ID for key rotation tracking ORAS_PLAIN_HTTPfalseUse plain HTTP for ORAS ORAS_INSECUREfalseSkip TLS verification VAULT_ADDR— Vault server URL VAULT_TOKEN— Vault authentication token VAULT_MOUNT_POINTsecretVault KV v2 mount point
Alquimia-ai/alquimia-core — src/alquimia/registry/registry.py, src/alquimia/registry/repo.py, src/alquimia/registry/secret.py