@baimingtao/lbs-agent
v2.0.39
Published
Leaving Blank Space Agent — 多 Agent 编排框架
Downloads
5,773
Maintainers
Readme
LBS Agent
LBS Agent 是一个自主 Agent 运行时系统。当前仓库的正式架构已经收口为五层:
application/:composition root + application servicesruntime/:runtime kernel(LLM / context / memory / orchestration / perception)interfaces/:CLI / API / gateway / web 入口extensions/:skills 与 optional MCP catalogstools/:tool runtime、skill/mcp provider、执行基础设施
legacy 顶层包(如 app/、core/、cli/)目前仅作为 compatibility shim 保留,不再是正式实现目录。
5 分钟上手
安装 / 启动
git clone <repo>
cd lbs-agent
pip install -r requirements.txt # 或 poetry install
python lbs.py --help也可以继续使用顶层入口:
python lbs.py --help配置 LLM Provider
python lbs.py llm inspect
python lbs.py models
python lbs.py config模型与 agent 内置配置位于:
runtime/core/llm/registry/models.yamlruntime/core/sub_agents/agents.yaml
第一次跑 Agent
python lbs.py run "say hello"
python lbs.py run-agent code "write fizzbuzz in python"多 Agent 编排
python lbs.py run-agent research "调研 Hermes 和 LBS 的区别"
python lbs.py run-agent summary "总结上一条结果"当前架构
1. application/
application/container.py:系统装配根application/runtime_factory.py:构建单 agent runtime configapplication/services/:use-case services(model / agent / orchestration / session / cron / tool / interactive / gateway / skill / mcp)
2. runtime/
runtime/core/:ModelRouter、provider、sub-agent registryruntime/context/:context builder / manager / trimming / compressionruntime/memory/:session store、working memory、long-term memory、task contractsruntime/orchestration/:Orchestrator、AgentLoop、scheduler、verificationruntime/perception/:intent / entity / input preprocess
3. interfaces/
interfaces/cli/_impl/:CLI 命令实现interfaces/api/_impl/server.py:FastAPI 服务interfaces/gateway/_impl/:gateway adaptersinterfaces/web/frontend/:前端interfaces/web/legacy_web/:历史 web 资源承接区
4. extensions/
extensions/skills/builtin/extensions/skills/optional/extensions/mcps/optional/
5. tools/
tools/tool/:ToolRuntime、tool policy、tool registrytools/skill/:skill registry / providertools/mcp/:MCP registry / provider infra
依赖方向
正式依赖方向应保持:
interfaces -> application -> runtime
tools -----^ -> tools infra
extensions (asset catalogs, loaded by runtime/tools when needed)约束:
interfaces/不直接依赖 runtime internalsruntime/不反向 importapplication/legacy shim只做兼容转发,不承载真实逻辑
常用命令
lbs models
lbs model list [--config]
lbs model switch <provider> <model>
lbs model health [provider]
lbs llm inspect
lbs llm validate [--json]
lbs llm diagnostics [--json]
lbs llm route <agent>
lbs agents
lbs tools inspect
lbs tools list [--agent name]
lbs tools profiles
lbs skills list
lbs skills view <name>
lbs skill list
lbs skill sources
lbs skill sync <repo> [alias]
lbs mcp list
lbs sessions list
lbs sessions show <id>
lbs sessions export <id> <out>
lbs sessions report [id]
lbs workers list
lbs workers show <id>
lbs cron list
lbs run "<task>"
lbs run-agent <name> "<task>"编程 API
Container
from application.container import AgentSystemContainer
from config.config import AppConfig
container = AgentSystemContainer(config=AppConfig())
container.session_service().list_sessions(limit=10)
container.model_service().inspect_llm()
container.build_orchestrator()Orchestrator
result = container.build_orchestrator().run_agent_sync(
agent_name="code",
task="write hello world",
context="",
session_id="",
)
print(result.success, result.content)开发
focused tests
python -m pytest tests/architecture/ -v
python -m pytest tests/test_app_services_boundary.py tests/test_server_api.py -q目录收口说明
目录大迁移已完成;当前剩余 legacy 顶层目录主要用于 import compatibility。后续收尾以:
- 缩小 shim 表面积
- 让测试与文档全面直连新路径
- 最终删除不再需要的 legacy 目录 为主。
