Skip to main content

A portable and componentized agent framework

Project description

psi-agent

中文 | English

A portable and componentized agent framework.

Introduction

psi-agent is built on two core principles:

  • Portability: Copy just the workspace directory to migrate your agent completely.
  • Componentization: Agents are assembled from independent components that communicate via Unix sockets, ensuring loose coupling.

Installation

Using uvx (Recommended)

For quick one-off usage without cloning the repository:

uvx psi-agent <component> <subcommand> [options...]
# e.g., uvx psi-agent session --workspace ./workspace ...

Using pip

pip install psi-agent

Using uv

uv add psi-agent

Quick Start

  1. Create a workspace directory with your tools and skills (or use an example from examples/):
mkdir -p workspace/{tools,skills,systems}

See examples/a-simple-bash-only-workspace/ for a minimal example, or examples/an-openclaw-like-workspace/ for a more complete setup.

  1. Start the session:
psi-agent session \
  --workspace ./workspace \
  --channel-socket ./channel.sock \
  --ai-socket ./ai.sock
  1. Start an AI provider (e.g., OpenAI-compatible):
psi-agent ai openai-completions \
  --session-socket ./ai.sock \
  --model <model-name> \
  --api-key <your-api-key> \
  --base-url <provider-api-url>  # e.g., https://openrouter.ai/api/v1
  1. Start a channel to interact with your agent session:
psi-agent channel repl --session-socket ./channel.sock

CLI Interfaces

psi-agent provides two CLI interfaces:

  1. Subcommand interface (preferred): psi-agent <component> <subcommand>

    • Works with uvx without cloning the repository
    • Single entry point, easier to discover
    • Examples: psi-agent ai openai-completions, psi-agent channel repl
  2. Standalone commands: psi-<component>-<subcommand>

    • Shorter to type
    • Useful in scripts
    • Examples: psi-ai-openai-completions, psi-channel-repl

Both interfaces are functionally identical. The subcommand interface is recommended for general use.

Components

psi-agent consists of four component types:

Component Purpose
psi-ai-* LLM provider adapters (OpenAI, Anthropic, etc.)
psi-session Agent runtime loop, handles messages and tool calls
psi-channel-* Message channels (REPL, Telegram, Feishu, etc.)
psi-workspace-* Workspace packaging and mounting tools

Available Commands

After installation, these commands are available:

Subcommand format (preferred):

  • psi-agent ai openai-completions - OpenAI-compatible completion server
  • psi-agent ai anthropic-messages - Anthropic messages server
  • psi-agent session - Agent session runtime
  • psi-agent channel repl - Interactive REPL interface
  • psi-agent channel cli - CLI channel interface
  • psi-agent channel telegram - Telegram bot channel
  • psi-agent workspace pack - Package workspace to squashfs
  • psi-agent workspace unpack - Extract squashfs to directory
  • psi-agent workspace mount - Mount squashfs as overlayfs
  • psi-agent workspace umount - Unmount workspace
  • psi-agent workspace snapshot - Create workspace snapshot

Standalone format (also available):

  • psi-ai-openai-completions
  • psi-ai-anthropic-messages
  • psi-session
  • psi-channel-repl
  • psi-channel-cli
  • psi-channel-telegram
  • psi-workspace-pack
  • psi-workspace-unpack
  • psi-workspace-mount
  • psi-workspace-umount
  • psi-workspace-snapshot

Documentation

For detailed documentation including workspace structure, tool development, and configuration, see CLAUDE.md.

License

GNU Affero General Public License v3.0 - see LICENSE.md for details.

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

psi_agent-0.0.1a20260502.tar.gz (569.6 kB view details)

Uploaded Source

Built Distribution

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

psi_agent-0.0.1a20260502-py3-none-any.whl (109.8 kB view details)

Uploaded Python 3

File details

Details for the file psi_agent-0.0.1a20260502.tar.gz.

File metadata

  • Download URL: psi_agent-0.0.1a20260502.tar.gz
  • Upload date:
  • Size: 569.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for psi_agent-0.0.1a20260502.tar.gz
Algorithm Hash digest
SHA256 9330176eec9e6267dd3391f23c293aba8cecc1a4a5289ab5201e2c232d65211c
MD5 b87508617d43cec25e76a16fea77d5a4
BLAKE2b-256 d0e6685568f3cdf4de5dbab7a72bc7d2f842c1b6d2499d869cdeb31d2418df64

See more details on using hashes here.

File details

Details for the file psi_agent-0.0.1a20260502-py3-none-any.whl.

File metadata

  • Download URL: psi_agent-0.0.1a20260502-py3-none-any.whl
  • Upload date:
  • Size: 109.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for psi_agent-0.0.1a20260502-py3-none-any.whl
Algorithm Hash digest
SHA256 e17fb9d6b3b53a1ef3d7cefe8c91ca2d9d4a662465db43ca7d7b1e6dc4ebe332
MD5 d390b2dc32163a2f5441f08c3dbe3fe8
BLAKE2b-256 7bd7ff8e538ff7371639f8f5fe12f3d03ce19299f6f2dd38fde51189e2c3b4ea

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