Project Liorium
- 模块:
liorium.core/liorium.vfs/liorium.realm_base/liorium.core_tool/liorium.core_tool_realm/liorium.agent/liorium.memory/liorium.skills/liorium.mcp/liorium.todo_realm/liorium.provider/liorium.cli - 安装:
pip install "liorium[all]"只要框架运行时用pip install liorium;单独选装见下 - 仓库:https://github.com/liwusen/liorium-framework
文档
文档入口:docs/README.md
| 文档 | 内容 |
|---|---|
docs/GUIDE.md |
安装、最小 Agent、事件表、中断/注入、压缩与成本、多 Agent 并发 |
docs/API.md |
API 介绍 |
docs/EXTENDING.md |
自定义 Realm / Middleware / 调度参数(priority / FLAG)/ model_factory / 工具 |
docs/MEMORY.md |
记忆自系统 |
docs/ARCHITECTURE.md |
架构介绍 |
命令行:安装后先配置
pip install "liorium[all]"
liorium-cli setup # 交互式:provider / 记忆系统(也支持 setup providers add …)
liorium-cli setup show # 配置一览(密钥打码)
liorium-cli setup doctor # 体检:文件 / key / 目录 / 依赖
liorium-cli # 进入 REPL;/setup 也能配
配置在 ~/.liorium/:providers.json(provider + 密钥,0600)与 config.json
(默认模型 / 思考 / 记忆 / 技能 / UI)。两个文件都可以不存在——新机器第一次运行会建空骨架
并进入「未配置」模式,不会因为缺配置起不来。详见
packages/liorium-cli/README.md。
例子: 最小 Agent
import asyncio
from pathlib import Path
from liorium.agent import AgentSpec, Limits, LioriumAgent
def make_chat_model(label: str):
from langchain_openai import ChatOpenAI
provider, model = label.split("::", 1)
return ChatOpenAI(model=model, base_url="https://api.deepseek.com", api_key="...")
async def main() -> None:
agent = LioriumAgent(
spec=AgentSpec(
id="main",
inbox_dir=Path("agents/main"),
model="deepseek::chat",
prompt_sources=("AGENT.md", "ROLE.md", "COREMEMORY.md"),
limits=Limits(context_window=128_000, max_turns=200),
),
model_factory=make_chat_model,
)
await agent.start() # 不调模型(计划 §F7)
try:
async for event in agent.run("今天出门要带伞吗?"):
print(event.to_dict()) # start / delta / reasoning_delta / tool_* / done
finally:
await agent.close()
asyncio.run(main())
- 叫停 =
await agent.interrupt(reason="user_stop")+ 一个新的run()(两个回合)。 - 运行中补充信息 =
await agent.inject([ContextItem(source="trigger:desktop", text="开始下雨了")]), 永不打断,在下一个安全点物化成独立 user 消息。 - 热重载 =
await agent.apply(new_spec):只重建指纹变化的部件;失败保留旧部件。 - 清空对话 =
await agent.reset_dialog()(纯状态写入,不调模型;同时清空state_scope="conversation"的 realm 状态)。
Metadata
Release files for liorium 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| liorium-0.1.1.tar.gz | 328.7 kB | With provenance | Details for liorium-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| liorium-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for liorium-0.1.1-py3-none-any.whl |
Total release size: 731.1 kB
Release files / liorium-0.1.1.tar.gz
| Download URL | liorium-0.1.1.tar.gz |
|---|---|
| Size | 328.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
29afff1c357c9ebed16815880ab51bd446e673d35972fd68ebc037ecc26c5135
|
|
BLAKE2b-256 checksum How to use checksums |
daade28844905b62ba4c5121317a4c09db815289ec83ad83e364abb1129a5d5d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.
Transparency logRelease files / liorium-0.1.1-py3-none-any.whl
| Download URL | liorium-0.1.1-py3-none-any.whl |
|---|---|
| Size | 402.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9f16ad37d5af26001a30ed47a5a4745e07caa524cb1183017c87a1d1eacd06fe
|
|
BLAKE2b-256 checksum How to use checksums |
e8cdaaf8560613b9c2d375c734cd8d9b47fce351ee418f74384fb7475be23c83
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.
Transparency logSecurity for liorium 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for liorium-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.