Metadata-Version: 2.4
Name: myxagent
Version: 0.3.38
Summary: Independent AI Agent with Persistent First-Person Memory and Multi-User Interaction
Author-email: ZJun <zhangjun310@live.com>
Project-URL: Repository, https://github.com/ZJCODE/xagent
Project-URL: Issues, https://github.com/ZJCODE/xagent/issues
Project-URL: Homepage, https://github.com/ZJCODE/xagent#readme
Keywords: ai,agent,openai,chatbot,async
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastapi>=0.116.1
Requires-Dist: pydantic>=2.11.7
Requires-Dist: uvicorn>=0.35.0
Requires-Dist: openai>=1.98.0
Requires-Dist: anthropic>=0.116.0
Requires-Dist: langfuse<5,>=4.14.2
Requires-Dist: cryptography>=42.0.0
Requires-Dist: httpx>=0.28.0
Requires-Dist: requests>=2.32.0
Requires-Dist: trafilatura>=2.0.0
Requires-Dist: lxml[html-clean]>=5.0.0
Requires-Dist: lark-oapi>=1.5.5
Requires-Dist: qrcode[pil]>=7.4.2
Requires-Dist: pillow>=10.0.0
Requires-Dist: posthog>=3.6.0
Requires-Dist: pyyaml>=6.0.2
Requires-Dist: python-multipart>=0.0.20
Requires-Dist: readchar>=4.2.1
Requires-Dist: rich>=13.9.4
Requires-Dist: sounddevice>=0.5.0
Requires-Dist: soniox<3,>=2.8
Requires-Dist: python-socks>=2.4.0
Requires-Dist: tenacity>=9.1.2
Requires-Dist: watchdog>=6.0.0
Requires-Dist: websockets>=14.0
Dynamic: license-file

# xAgent

[![Python](https://img.shields.io/badge/Python-3.10%2B-blue.svg)](https://www.python.org/)
[![License](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)

xAgent is a local-first AI agent platform that gives each agent its own identity, memory, workspace, and ongoing life.

Interact with your agents through the terminal, Web UI, voice, Feishu, or Weixin, and manage them from a unified interactive launcher.

## Features

- **Local-first** — Agent data is stored on your own machine.
- **Independent agents** — Each agent has its own identity, memory, diary, workspace, skills, tasks, logs, and channel state.
- **Multiple interfaces** — Use xAgent from the terminal, Web UI, voice, Feishu, or Weixin.
- **Unified management** — Create, configure, and manage agents from one interactive launcher.
- **External execution** — Connect hardware or software devices to the Agent API and call their declared capabilities through one generic tool.

## Requirements

- Python 3.10 or later

## Installation

### Install with the official script

```bash
curl -fsSL https://raw.githubusercontent.com/ZJCODE/xagent/main/install.sh | bash
```

### Install with pip

```bash
pip install myxagent
```

## Getting Started

After installation, launch xAgent with:

```bash
xagent
```

The interactive launcher will guide you through creating and managing your agents.

Each Agent runs one persistent core. The public API starts by default; Feishu,
Weixin and Voice connect only when requested:

```bash
xagent run --agent atlas       # foreground
xagent start --agent atlas     # background
xagent channel feishu connect --agent atlas
xagent channel feishu disconnect --agent atlas
xagent status --agent atlas
xagent logs --agent atlas --follow
xagent restart --agent atlas
xagent stop --agent atlas
```

In the terminal launcher, use **Runtime → Start**, then **Channel → API / Feishu /
Weixin / Voice → Connect / Disconnect**. Each channel shows its actual state;
**Refresh** updates the available actions, and configuration remains accessible
when the Agent is stopped. You can also use **Channels → Connect / Disconnect**
in the Web client or the channel commands above.
Restart restores channels that were connected, connecting or reconnecting,
including Voice. Channels disabled in the new configuration are skipped;
disconnected or failed channels stay offline, including a manually disconnected API.
Stop then Start uses API-only startup; `channels.api.enabled: false`
keeps the public API offline too. An explicit `--channels api,feishu` overrides
the default startup or restored connections for one launch. CLI and local Web chat use the same core, even
with the public API disconnected.
Restart drains accepted work without waiting for a new diary-generation model call;
ordinary Stop still attempts final diary maintenance. Configuration and identity
edits take effect after restart. Interrupted tasks
with uncertain execution or delivery wait for review instead of replaying.
See [runtime operation and recovery](docs/runtime-core.md) for details and validation.

For external devices, pair them in Agent → Devices without editing configuration
or restarting the Agent. All chat users can discover and use paired devices. Devices
connect to `/ws/devices/{device_id}` on its existing API port and declare
their own capabilities; Agent calls use one generic `device` tool. Chat remains
on `/ws/chat`, with its existing protocol. There is no additional service to start.
See [device execution and protocol](docs/device-execution.md) for pairing,
protocol details, and a runnable software device example.

## Updating

Update xAgent without changing how it was installed:

```bash
xagent update
```

## Local Data

All xAgent data is stored locally in:

```text
~/.xagent/
```

Agent-specific data is stored under:

```text
~/.xagent/agents/
```

## Uninstallation

If xAgent was installed with the official installation script:

```bash
uv tool uninstall myxagent
```

If xAgent was installed with pip:

```bash
pip uninstall myxagent
```

Uninstalling the CLI does not delete data stored under:

```text
~/.xagent/
```

Remove that directory manually only when you no longer need your local agent data.

## License

xAgent is released under the [MIT License](LICENSE).
