Move demo video to repository root
本作品面向第三届中国研究生操作系统开源创新大赛暨开放原子大赛操作系统专项赛应用创新方向第 9 题,构建了一个面向多智能体协作的低开销通信、状态传递与共享记忆运行时原型。
系统实现 Planner、Retriever、Executor、Critic、Summarizer 五类 Agent,重点解决多 Agent 协作中的长上下文重复传输、状态表达低效、跨任务经验无法复用等问题。
核心能力:
action
params
result
state_ref
memory_refs
StatePacket
state_id
MemoryCell
text
structured
memory
增强点:
推荐环境:
仓库根目录只保留 README.md 和 code/。所有代码、配置、脚本和赛题文档都放在 code/ 下,运行命令前先进入代码目录:
README.md
code/
cd code
运行前先生成统一配置文件:
cp configs/runtime.env.example configs/runtime.env
后续所有需要修改的参数都在 configs/runtime.env 中配置,不需要改代码。
configs/runtime.env
API 配置位置:
# configs/runtime.env LLM_BASE_URL="https://api.example.com/v1" LLM_API_KEY="sk-..." LLM_MODEL="gpt-4o-2024-05-13"
如果使用自己的 OpenAI-compatible 服务,只需要把上面三个字段改成自己的接口地址、API Key 和模型名。离线可复现实验不需要填写 API。
常用实验参数也在同一个配置文件中修改:
# configs/runtime.env TASK_FILE="configs/tasks_15_rounds.json" MODES="text structured memory" REPEATS=3 PROVIDER="offline" TRANSPORT="unix" LIVE_TASK_FILE="configs/tasks_15_rounds.json" LIVE_MODES="text structured memory" LIVE_REPEATS=1
在 openEuler 原生环境中安装依赖并运行离线可复现实验:
bash scripts/install_openeuler.sh bash scripts/run_all_benchmarks.sh
输出结果:
results/benchmark_summary.csv results/benchmark_summary.json reports/comparison.md runtime/*/liteagent.db
验证 openEuler 原生运行证据:
bash scripts/run_native_openeuler_full.sh
输出日志:
logs/native_openeuler_run.log logs/env.txt
在支持 Docker 的机器上运行 openEuler 容器实验:
bash scripts/run_in_openeuler_docker.sh
logs/openeuler_docker_run.log
单独运行 memory 模式:
python -m liteagent_memory run \ --mode memory \ --provider offline \ --transport unix \ --task-file configs/tasks_15_rounds.json \ --output results/memory_mode.json
接入 OpenAI-compatible 在线模型时,先确认 configs/runtime.env 中的 API 配置已经填写,然后运行:
bash scripts/run_full_live_api.sh
在线模型实验输出:
results_live/benchmark_summary.csv results_live/benchmark_summary.json reports_live/comparison.md logs/full_live_api.log
小规模真实 API 演示曾在 openEuler 容器中运行,核心指标如下:
GitLink 文件列表右侧显示的 Add LiteAgent Memory LLM solution、Unify runtime configuration 等文字是 Git 提交说明,表示该文件最近一次是在哪次提交中被修改的,不是文件用途说明。下面是仓库中主要文件的用途。
Add LiteAgent Memory LLM solution
Unify runtime configuration
code/README.md
code/.dockerignore
code/.gitignore
code/Dockerfile
code/pyproject.toml
pip install -e .
code/requirements_openeuler.txt
code/requirements_ui.txt
code/configs/config.json
code/configs/knowledge_base.json
code/configs/runtime.env.example
code/configs/runtime.env
code/configs/tasks_10_rounds.json
code/configs/tasks_15_rounds.json
code/doce/第三届中国研究生操作系统开源创新大赛暨开放原子大赛操作系统专项赛赛题.docx
code/liteagent_memory/__init__.py
code/liteagent_memory/__main__.py
python -m liteagent_memory
code/liteagent_memory/agents.py
code/liteagent_memory/cli.py
code/liteagent_memory/llm_provider.py
code/liteagent_memory/memory_store.py
code/liteagent_memory/models.py
code/liteagent_memory/protocol.py
code/liteagent_memory/report.py
code/liteagent_memory/runtime.py
code/liteagent_memory/sandbox.py
code/liteagent_memory/state_store.py
code/liteagent_memory/transport.py
code/liteagent_memory/utils.py
code/liteagent_memory/vectorizer.py
code/scripts/check_topic_alignment.sh
code/scripts/clean_runtime.sh
code/scripts/collect_env.sh
logs/env.txt
code/scripts/docker_entrypoint_openeuler.sh
code/scripts/install_openeuler.sh
code/scripts/pull_docker_rootfs.py
code/scripts/run_all_benchmarks.sh
code/scripts/run_demo.sh
code/scripts/run_full_live_api.sh
results_live/
reports_live/
code/scripts/run_in_openeuler_docker.sh
code/scripts/run_in_openeuler_proot.sh
code/scripts/run_live_llm_demo.sh
code/scripts/run_native_openeuler_full.sh
code/scripts/run_tests.sh
code/scripts/verify_final_artifacts.py
code/tests/test_smoke.py
code/ui/app.py
版权所有:中国计算机学会技术支持:开源发展技术委员会 京ICP备13000930号-9 京公网安备 11010802047560号
LiteAgent-Memory-LLM
作品简介
本作品面向第三届中国研究生操作系统开源创新大赛暨开放原子大赛操作系统专项赛应用创新方向第 9 题,构建了一个面向多智能体协作的低开销通信、状态传递与共享记忆运行时原型。
系统实现 Planner、Retriever、Executor、Critic、Summarizer 五类 Agent,重点解决多 Agent 协作中的长上下文重复传输、状态表达低效、跨任务经验无法复用等问题。
核心能力:
action、params、result、state_ref、memory_refs等字段替代大段自然语言透传。StatePacket将语义向量写入 mmap 文件,Agent 间只传递state_id。MemoryCell,支持摘要、证据、标签、复用次数和质量评分。text、structured、memory三种模式,对比通信字符数、估算 token、状态传递、记忆命中率、LLM 调用和端到端耗时。增强点:
运行说明
推荐环境:
仓库根目录只保留
README.md和code/。所有代码、配置、脚本和赛题文档都放在code/下,运行命令前先进入代码目录:运行前先生成统一配置文件:
后续所有需要修改的参数都在
configs/runtime.env中配置,不需要改代码。API 配置位置:
如果使用自己的 OpenAI-compatible 服务,只需要把上面三个字段改成自己的接口地址、API Key 和模型名。离线可复现实验不需要填写 API。
常用实验参数也在同一个配置文件中修改:
在 openEuler 原生环境中安装依赖并运行离线可复现实验:
输出结果:
验证 openEuler 原生运行证据:
输出日志:
在支持 Docker 的机器上运行 openEuler 容器实验:
输出日志:
单独运行 memory 模式:
接入 OpenAI-compatible 在线模型时,先确认
configs/runtime.env中的 API 配置已经填写,然后运行:在线模型实验输出:
小规模真实 API 演示曾在 openEuler 容器中运行,核心指标如下:
文件说明
GitLink 文件列表右侧显示的
Add LiteAgent Memory LLM solution、Unify runtime configuration等文字是 Git 提交说明,表示该文件最近一次是在哪次提交中被修改的,不是文件用途说明。下面是仓库中主要文件的用途。根目录文件
README.mdcode/code/README.mdcode 根目录
code/.dockerignorecode/.gitignorecode/Dockerfilecode/pyproject.tomlpip install -e .。code/requirements_openeuler.txtcode/requirements_ui.txtconfigs
code/configs/config.jsoncode/configs/knowledge_base.jsoncode/configs/runtime.env.examplecode/configs/runtime.env后可配置 API 地址、Key、模型名、任务文件、运行模式、重复次数和输出目录。code/configs/tasks_10_rounds.jsoncode/configs/tasks_15_rounds.jsondoce
code/doce/第三届中国研究生操作系统开源创新大赛暨开放原子大赛操作系统专项赛赛题.docxliteagent_memory
code/liteagent_memory/__init__.pycode/liteagent_memory/__main__.pypython -m liteagent_memory方式启动命令行入口。code/liteagent_memory/agents.pycode/liteagent_memory/cli.pycode/liteagent_memory/llm_provider.pycode/liteagent_memory/memory_store.pycode/liteagent_memory/models.pycode/liteagent_memory/protocol.pycode/liteagent_memory/report.pycode/liteagent_memory/runtime.pycode/liteagent_memory/sandbox.pycode/liteagent_memory/state_store.pycode/liteagent_memory/transport.pycode/liteagent_memory/utils.pycode/liteagent_memory/vectorizer.pyscripts
code/scripts/check_topic_alignment.shcode/scripts/clean_runtime.shcode/scripts/collect_env.shlogs/env.txt。code/scripts/docker_entrypoint_openeuler.shcode/scripts/install_openeuler.shcode/scripts/pull_docker_rootfs.pycode/scripts/run_all_benchmarks.shcode/scripts/run_demo.shcode/scripts/run_full_live_api.shconfigs/runtime.env并输出results_live/与reports_live/。code/scripts/run_in_openeuler_docker.shcode/scripts/run_in_openeuler_proot.shcode/scripts/run_live_llm_demo.shcode/scripts/run_native_openeuler_full.shcode/scripts/run_tests.shcode/scripts/verify_final_artifacts.pytests 和 ui
code/tests/test_smoke.pycode/ui/app.py