AGENTS / GITHUB / Memory_Skills
githubinferredactive

Memory_Skills

provenance:github:ZaneeYang/Memory_Skills

AdvisorMem: A personalized financial advisory agent with self-evolving memory, powered by LangGraph + Streamlit. Features adaptive retrieval, user profiling, skill abstraction, and feedback-driven memory evolution.

View Source ↗First seen 2mo agoNot yet hireable
README
# 智能投顾助手 Agent MVP

基于 **LangGraph + Streamlit** 的个性化记忆与自进化 MVP,对应 `research_proposal.md` 中的 AdvisorMem 思路。

## 系统架构

![Architecture of Personalized Financial Advisory Agent with Memory Retrieval and Self-Evolving Memory Update](architecure.png)

## 流程简述

1. **你与 LLM 对话**:每次提问前,会从记忆库根据你的问题做**自适应检索**,把抽象出的画像与技能注入上下文,再生成回复。
2. **显式反馈**:在界面上对某条助手回复点 **赞 👍 / 骂 👎**,对应方案里的 \(f_i \in \{+1, 0, -1\}\)。
3. **隐式反馈**:你的每句输入会经过**情绪分析**(另一路 LLM),得到 positive/negative/neutral,作为言语中的态度参与记忆更新。
4. **记忆进化**:另一个大模型根据「近期对话 + 赞/骂 + 言语情绪」**抽象并更新**用户画像与技能,写入本地记忆库;下次对话会检索到更新后的内容,实现**越聊越懂你**。

## 项目结构

```
memory/
├── app.py              # Streamlit 入口:对话 UI、赞/骂、侧边栏记忆展示
├── graph.py            # LangGraph 对话图:检索记忆 → 生成回复
├── llms.py             # 统一 LLM 入口(智谱 GLM / ChatZhipuAI)
├── memory_store.py     # 记忆存储(画像 + 技能),JSON 持久化
├── evolution.py        # 反馈驱动的记忆进化(调用 LLM 抽象)
├── sentiment.py        # 从用户言语推断情绪
├── config.py           # 配置(ZHIPUAI_API_KEY、模型名、存储路径)
├── requirements.txt
├── data/               # 自动创建,存放 memory.json
└── research_proposal.md
```

## 运行方式

1. 安装依赖:
   ```bash
   pip install -r requirements.txt
   ```

2. 配置环境变量(复制 `.env.example` 为 `.env` 并填写智谱 API Key):
   ```bash
   cp .env.example .env
   # 编辑 .env,填入 ZHIPUAI_API_KEY(在 https://open.bigmodel.cn 获取)
   ```

3. 启动 Streamlit:
   ```bash
   streamlit run app.py
   ```

4. 在浏览器中对话、对回复点赞/踩;侧栏会展示当前抽象出的「记忆」,可点击「立即根据当前对话与赞/骂更新记忆」手动触发进化。

## 与 research_proposal 的对应

| 提案概念 | MVP 实现 |
|----------|----------|
| 分层用户画像 (HPE) | `memory_store` 中的 `persona.explicit` / `persona.implicit`,由 `evolution` 中的 LLM 更新 |
| 条件化技能 (CSA) | `memory_store` 中的 `skills` 列表,由进化 LLM 从成功/失败对话中抽象 |
| 反馈驱动自我进化 | `evolution.run_evolution(recent_turns, feedbacks)`,结合赞/骂与言语情绪 |
| 个性化检索 | `memory_store.get_context_for_query(memory, query)`(MVP 为全量注入,可扩展为向量检索) |
| 对话生成 | LangGraph:`retrieve` → `generate`,生成时注入记忆上下文 |

后续可做:向量检索只注入相关技能、多用户/多 session、以及接入 FinAdvisorBench 做评估。

PUBLIC HISTORY

First discoveredMar 21, 2026

IDENTITY

inferred

Identity inferred from code signals. No PROVENANCE.yml found.

Is this yours? Claim it →

METADATA

platformgithub
first seenFeb 10, 2026
last updatedMar 16, 2026
last crawled17 days ago
version

README BADGE

Add to your README:

![Provenance](https://getprovenance.dev/api/badge?id=provenance:github:ZaneeYang/Memory_Skills)