Skip to main content

atulya-embed

Atulya embedded CLI — a living algorithm for machine intelligence (MI), with local memory operations and automatic daemon management.

This package provides a simple CLI for storing and recalling memories using Atulya's memory engine. It automatically manages a background daemon for fast operations - no manual server setup required.

How It Works

atulya-embed uses a background daemon architecture for optimal performance:

  1. First command: Automatically starts a local daemon (first run downloads dependencies and loads ML models - can take 1-3 minutes)
  2. Subsequent commands: Near-instant responses (~1-2s) since daemon is already running
  3. Auto-shutdown: Daemon automatically exits after 5 minutes of inactivity

The daemon runs on localhost:8888 and uses an embedded PostgreSQL database (pg0) - everything stays local on your machine.

Installation

pip install atulya-embed
# or with uvx (no install needed)
uvx atulya-embed --help

Quick Start

# Interactive setup (configures default profile)
atulya-embed configure

# Or set your LLM API key manually
export OPENAI_API_KEY=sk-...

# Store a memory (bank_id = "default")
atulya-embed memory retain default "User prefers dark mode"

# Recall memories
atulya-embed memory recall default "What are user preferences?"

All commands use the "default" profile unless you specify a different one with --profile or ATULYA_EMBED_PROFILE.

Commands

configure

Configure the default profile or create/update named profiles:

# Interactive setup for default profile
atulya-embed configure

# Create/update named profile with single command
atulya-embed configure --profile my-app \
  --env ATULYA_EMBED_LLM_PROVIDER=openai \
  --env ATULYA_EMBED_LLM_API_KEY=sk-xxx

# Create/update named profile interactively
atulya-embed configure --profile staging

This will:

  • Let you choose an LLM provider (OpenAI, Groq, Google, Ollama)
  • Configure your API key
  • Set the model and memory bank ID
  • Start the daemon with your configuration

memory retain

Store a memory:

atulya-embed memory retain default "User prefers dark mode"
atulya-embed memory retain default "Meeting on Monday" --context work
atulya-embed memory retain myproject "API uses JWT authentication"

memory recall

Search memories:

atulya-embed memory recall default "user preferences"
atulya-embed memory recall default "upcoming events"

Use -o json for JSON output:

atulya-embed memory recall default "user preferences" -o json

memory reflect

Get contextual answers that synthesize multiple memories:

atulya-embed memory reflect default "How should I set up the dev environment?"

bank list

List all memory banks:

atulya-embed bank list

profile

Manage configuration profiles:

# List all profiles with status
atulya-embed profile list

# Show current active profile
atulya-embed profile show

# Set active profile (persists across commands)
atulya-embed profile set-active my-app

# Clear active profile (revert to default)
atulya-embed profile set-active --none

# Delete a profile
atulya-embed profile delete my-app

daemon

Manage the background daemon:

atulya-embed daemon status    # Check if daemon is running
atulya-embed daemon start     # Start the daemon
atulya-embed daemon stop      # Stop the daemon
atulya-embed daemon logs      # View last 50 lines of logs
atulya-embed daemon logs -f   # Follow logs in real-time
atulya-embed daemon logs -n 100  # View last 100 lines

Configuration

Interactive Setup

Run atulya-embed configure for a guided setup that saves to ~/.atulya/embed.

Environment Variables

Variable Description Default
ATULYA_EMBED_PROFILE Profile name to use (overrides active profile) None (uses default profile)
ATULYA_EMBED_LLM_API_KEY LLM API key (or use OPENAI_API_KEY) Required
ATULYA_EMBED_LLM_PROVIDER LLM provider (openai, groq, google, ollama) openai
ATULYA_EMBED_LLM_MODEL LLM model gpt-4o-mini
ATULYA_EMBED_BANK_ID Default memory bank ID (optional, used when not specified in CLI) default
ATULYA_EMBED_API_URL Use external API server instead of starting local daemon None (starts local daemon)
ATULYA_EMBED_API_TOKEN Authentication token for external API (sent as Bearer token) None
ATULYA_EMBED_API_DATABASE_URL Database URL for daemon pg0://atulya-embed
ATULYA_EMBED_DAEMON_IDLE_TIMEOUT Seconds before daemon auto-exits when idle 300

Using an External API Server:

To connect to an existing Atulya API server instead of starting the local daemon:

export ATULYA_EMBED_API_URL=http://your-server:8000
export ATULYA_EMBED_API_TOKEN=your-api-token  # Optional, if API requires auth
atulya-embed memory recall default "query"

Custom Database:

To use an external PostgreSQL database instead of the embedded pg0 database (useful when running as root or in containerized environments):

export ATULYA_EMBED_API_DATABASE_URL=postgresql://user:password@localhost:5432/dbname
atulya-embed daemon start

Note: All banks share a single database. Bank isolation happens within the database via the bank_id parameter passed to CLI commands.

Configuration Profiles

Profiles let you maintain multiple independent configurations (e.g., different API endpoints, LLM providers, or projects). Each profile runs its own daemon on a unique port (8889-9888).

The Default Profile:

When you run atulya-embed configure without specifying a profile, it configures the "default" profile. This uses the backward-compatible configuration at ~/.atulya/embed and runs on port 8888.

Creating Named Profiles:

# Create a profile with single command
atulya-embed configure --profile my-app \
  --env ATULYA_EMBED_LLM_PROVIDER=openai \
  --env ATULYA_EMBED_LLM_API_KEY=sk-xxx \
  --env ATULYA_EMBED_LLM_MODEL=gpt-4o-mini

# Create a profile interactively
atulya-embed configure --profile staging

Using Profiles:

# Option 1: Environment variable (recommended for apps)
ATULYA_EMBED_PROFILE=my-app atulya-embed memory retain default "text"

# Option 2: CLI flag
atulya-embed --profile my-app memory recall default "query"

# Option 3: Set as active (persists across commands)
atulya-embed profile set-active my-app
atulya-embed memory recall default "query"  # Uses my-app profile

# Clear active profile (revert to default)
atulya-embed profile set-active --none

Profile Management:

# List all profiles with status
atulya-embed profile list

# Show active profile
atulya-embed profile show

# Delete a profile
atulya-embed profile delete my-app

Profile Resolution Priority:

  1. ATULYA_EMBED_PROFILE environment variable (highest)
  2. --profile CLI flag
  3. Active profile from ~/.atulya/active_profile file
  4. Default profile (lowest)

Note: If a profile is specified but doesn't exist, the command will fail with an error. Profiles must be explicitly created using atulya-embed configure --profile <name>.

Files

Default Profile:

Path Description
~/.atulya/embed Configuration file for default profile
~/.atulya/daemon.log Daemon logs for default profile
~/.atulya/daemon.lock Daemon lock file (PID) for default profile

Named Profiles:

Path Description
~/.atulya/profiles/<name>.env Configuration file for profile
~/.atulya/profiles/<name>.log Daemon logs for profile
~/.atulya/profiles/<name>.lock Daemon lock file (PID) for profile
~/.atulya/profiles/metadata.json Profile metadata (ports, timestamps)
~/.atulya/active_profile Active profile name (when set with profile set-active)

Use with AI Coding Assistants

This CLI is designed to work with AI coding assistants like Claude Code, Cursor, and Windsurf. Install the Atulya skill:

npx skills add https://github.com/eight-atulya/atulya --skill atulya-docs

This will configure the LLM provider and install the skill to your assistant's skills directory.

Troubleshooting

Daemon won't start:

# Check logs for errors
atulya-embed daemon logs

# Stop any stuck daemon and restart
atulya-embed daemon stop
atulya-embed daemon start

Slow first command: This is expected - the first command needs to download dependencies, start the daemon, and load ML models. First run can take 1-3 minutes depending on network speed. Subsequent commands will be fast (~1-2s).

Change configuration:

# Re-run configure (automatically restarts daemon)
atulya-embed configure

License

Apache 2.0

Release files for atulya-embed 0.8.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for atulya-embed 0.8.7
File Size Uploaded
atulya_embed-0.8.7.tar.gz 33.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for atulya-embed 0.8.7
File Interpreter ABI Platform
atulya_embed-0.8.7-py3-none-any.whl Python 3 none any Details

Total release size: 60.9 kB

Release files / atulya_embed-0.8.7.tar.gz

Download URL atulya_embed-0.8.7.tar.gz
Size 33.2 kB
Tags Source
SHA-256 checksum
How to use checksums
10ff539678a875f52b1345d44360eac61ec5fe80be53749f83eef937a8ffef40
BLAKE2b-256 checksum
How to use checksums
614532df6728827a01e873e8647123d619cb9263a93b6333686a06dc5b08a2b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / atulya_embed-0.8.7-py3-none-any.whl

Download URL atulya_embed-0.8.7-py3-none-any.whl
Size 27.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a5b7289012a45c45160d1d38f6dacc4996f64e11de5595389261e40708bc237f
BLAKE2b-256 checksum
How to use checksums
eff3fff8913c6b6ed592ebcb0093f71e54aeb046c42152ec9436cb50acf2945c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

0.8.7 This release

2 release files

0.8.6

2 release files

0.8.5

2 release files

0.8.4

2 release files

0.8.3

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page