Skip to main content

Slife

Terminal-based AI agent — a function-calling loop with minimum harness. Chat with an LLM that calls tools, remembers everything, and orchestrates other agents over MQTT.

┌─────────────────────────────────────────────────────────────┐
│  Terminal UI (Textual)                                      │
│  ────────────────────────────────────────────────────────── │
│  Agent Loop — LLM + Tools + Stream + Memory + A2A + Inbox  │
│  ┌───────────┬──────────┬───────────┬─────────────────────┐ │
│  │ MCP Proxy │ A2A Mesh │ Subagents │ Built-in Plugins    │ │
│  │ (gateway) │ (MQTT)   │ (workers) │ Memory · MCP · WX   │ │
│  └───────────┴──────────┴───────────┴─────────────────────┘ │
│  Permanent Memory — hybrid search (grep + FTS5 + semantic)  │
└─────────────────────────────────────────────────────────────┘

Install

Zero prerequisites. The install script auto-installs uv and Node.js if needed.

Install script (recommended)

macOS / Linux / WSL:

curl -fsSL https://raw.githubusercontent.com/juzcn/slife/main/install.sh | bash

Windows PowerShell:

powershell -ExecutionPolicy Bypass -Command "irm https://raw.githubusercontent.com/juzcn/slife/main/install.ps1 | iex"

Try without installing

uvx --from git+https://github.com/juzcn/slife.git slife

Update

Re-run the install script — it auto-preserves optional packages (llama-cpp-python, sentence-transformers) from the previous install.

Uninstall

# macOS / Linux / WSL
curl -fsSL https://raw.githubusercontent.com/juzcn/slife/main/uninstall.sh | bash

# Windows PowerShell
powershell -ExecutionPolicy Bypass -Command "irm https://raw.githubusercontent.com/juzcn/slife/main/uninstall.ps1 | iex"

Uninstall removes the binaries. User data (~/.slife/, ~/.credstore/) is listed but not removed — delete manually for a full reset.

Quick Start

credstore set-password              # first time only — encrypted backup
credstore set DEEPSEEK_API_KEY       # store API key (masked input)
slife

The default config ships with pre-configured MCP servers: filesystem + shell, code search, web fetch, search APIs.

How It Works

Slife is a function-calling loop: you type → the LLM decides what tools to call → Slife executes them → the LLM responds → repeat.

You: "Find all TODO comments and create GitHub issues for them"
  → LLM calls search_content("TODO")
  → LLM calls github__create_issue(...) for each one
  → LLM: "Created 7 issues. All linked above."

Every turn is permanently recorded. On restart, recent conversations are restored.

Configuration

Two-layer model — secrets in OS keyring, config in JSON5:

Layer Storage Contents
Secrets OS keyring (credstore) API keys, tokens — encrypted at OS level
Config ~/.slife/slife.json5env: ${VAR} references + non-secret values
env: {
  DEEPSEEK_API_KEY: "${DEEPSEEK_API_KEY}",   // → resolved from keyring at runtime
}

models: {
  providers: {
    deepseek: {
      base_url: "https://api.deepseek.com",
      api_key: "${DEEPSEEK_API_KEY}",
      models: [{ model: "deepseek-v4-pro", name: "DeepSeek V4 Pro", reasoning: true }],
    },
  },
},
active_model: "deepseek/deepseek-v4-pro",

Secrets never reach the LLM context. All tool output is sanitized before reaching the model — API key patterns are auto-masked.

Features

Tools

All unified as OpenAI function definitions. The LLM sees no difference between categories.

Nine native categories — one .py file per category in slife/tools/, auto-discovered:

Category File Tools
System system.py check_os_info, check_shells, check_workspace, check_embedding, check_wechat, system_health
Execution exec.py execute_shell, run_python_script, install_python_package
Skills skill.py check_skills_dir, list_skills, use_skill, add_skill, remove_skill, skill_set
CLI cli.py cli_check_installed, cli_add_tool, cli_remove_tool, cli_list_tools, cli_set_tool
REST API rest_api.py rest_api_add, rest_api_remove, rest_api_list, rest_api_set
A2A a2a.py 13 tools — agent discovery, task routing, subagent lifecycle, broadcast
Config config.py config_env_set, config_env_get, config_env_remove, native_tool_set
Credentials credentials.py credential_check, inject_credential, uninject_credential
Meta meta.py list_tools, check_async, cancel_async, clear_context

Five managed categories (MCP / Skills / CLI / REST API / Native) support a standard list / add / remove / set surface. All set tools share (name: str, enabled: bool).

Plus built-in Memory plugin (memory_search, memory_open, …).

Memory — Always On

Every conversation turn is permanently recorded. Hybrid search across four modes:

Mode Best for
grep Exact strings — error messages, file paths, code
fts5 Topic / keyword search with ranked snippets
hybrid Semantic recall (FTS5 + vec0 vector search, RRF merge)
time Browse by date

Embedding backends: local GGUF (BGE-M3, ~300 MB, offline), HuggingFace transformers, or OpenAI-compatible API. Keyword search works without any embedding backend.

Plugins

Three built-in plugins run as independent processes on Streamable HTTP transport:

Plugin Role
slife-mcp Gateway for external MCP servers (stdio + HTTP)
slife-memory Diary database with hybrid search
slife-wechat Bidirectional WeChat via iLink ClawBot

External MCP servers (filesystem, fetch, search, any OpenAPI spec) are configured in slife.json5 and auto-connected at startup. Third-party MCP servers need no Slife SDK — any stdio or HTTP MCP server works.

A2A — Agent-to-Agent

Two transports, one interface:

Transport Use case
MQTT Remote peers over Mosquitto broker
HTTP Streamable Direct agent-to-agent
Subagent Local child processes (always available)

Unified inbox serializes human, WeChat, MQTT, and subagent messages through a single queue.

Progressive Disclosure

Not all tools are in every request. Three categories use lightweight summaries before loading full tool schemas:

Category Browse Load
Memory memory_search memory_open
Skills list_skills use_skill
MCP mcp_list_servers / mcp_list_tools mcp_set_disclosure("eager")

Keyboard Shortcuts

Key Action
Ctrl+C (in input) Quit
Ctrl+C (elsewhere) Copy
Esc Cancel agent loop
Ctrl+L Focus input
Home / End Scroll to top / bottom

CLI

Flag Description
--agent <id> Agent identity — memory isolation key + A2A mesh name (default: slife)

Optional Extras

Extra Enables
slife[gguf] Local GGUF embeddings (offline)
slife[transformer] HuggingFace transformer embeddings (~2 GB)
slife[embeddings] Both of the above

Linux / macOS — builds from source (C compiler is standard on these platforms):

uv tool install "slife[gguf]" --reinstall

Windows — no C++ compiler by default. Install the pre-built wheel directly into slife's venv (does NOT reinstall slife):

Pick the wheel that matches your setup:

Your setup Wheel Notes
No compiler, any GPU or none v0.3.34-vulkan Safest — uses Vulkan if GPU present, falls back to CPU
NVIDIA GPU + CUDA 12 v0.3.34-cu132 CUDA 12.x
NVIDIA GPU + CUDA 11 v0.3.34-cu125 CUDA 11.x
AMD GPU v0.3.34-hip-radeon ROCm
$py=((uv tool list --show-paths 2>$null|sls 'slife v'|Out-String)-replace'.*\((.*?)\).*','$1\Scripts\python.exe').Trim();uv pip install --python $py "llama-cpp-python @ https://github.com/abetlen/llama-cpp-python/releases/download/v0.3.34-vulkan/llama_cpp_python-0.3.34-py3-none-win_amd64.whl"

First use — download a GGUF model and enable it:

curl -LO https://huggingface.co/ChristianAzinn/bge-m3-gguf/resolve/main/bge-m3-Q4_K_M.gguf

Then launch slife and tell it: enable local embeddings with bge-m3-Q4_K_M.gguf

Development

git clone https://github.com/juzcn/slife.git
cd slife
uv sync --all-extras

uv run credstore set-password        # first time
uv run credstore set DEEPSEEK_API_KEY
uv run slife

Dev mode auto-detects: data files stay in the project directory. Production installs use ~/.slife/.

# Run tests
uv run pytest

# With coverage
uv run pytest --cov=slife --cov=credstore --cov-report=term-missing

Architecture

Slife is a minimum-harness agent. The harness only does what the LLM physically cannot: execute tools, maintain conversation state, stream responses, persist memory. Everything else — reasoning, planning, tool selection, error recovery — is the LLM's job.

See DESIGN.md for the full architecture: agent loop, tool system, plugin contract, MCP gateway, memory database, A2A mesh, credential security model, and project structure.

License

MIT

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

slife-0.3.23.tar.gz (241.3 kB view details)

Uploaded Source

Built Distribution

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

slife-0.3.23-py3-none-any.whl (259.8 kB view details)

Uploaded Python 3

File details

Details for the file slife-0.3.23.tar.gz.

File metadata

  • Download URL: slife-0.3.23.tar.gz
  • Upload date:
  • Size: 241.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for slife-0.3.23.tar.gz
Algorithm Hash digest
SHA256 38e984e08e00e3c85f406000232a74b70366099ce167e58ad6694a1c2b009b36
MD5 279491ff0ce81bd577c239c96b1cbcab
BLAKE2b-256 14dd2da852fe425ba20ec2b11d94159ef41ef73d471d73d080ff000495847cf3

See more details on using hashes here.

File details

Details for the file slife-0.3.23-py3-none-any.whl.

File metadata

  • Download URL: slife-0.3.23-py3-none-any.whl
  • Upload date:
  • Size: 259.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for slife-0.3.23-py3-none-any.whl
Algorithm Hash digest
SHA256 ab11c42086a6fea2781e128116f7289389d66a68d364ca4de1c6bf7f43a0dd83
MD5 f1683b72de2b10fdc78e95a60b2c9986
BLAKE2b-256 6c09e9afa15533d1b70cd2f5c962550c2e2f05fe0aec58244c15c83c5c03560d

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 Sentry Error logging StatusPage Status page