liurenchaxin/jixia_academy/PROJECT_STRUCTURE.md

202 lines
7.4 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 稷下学宫AI辩论系统 - 项目结构
## 🏛️ 系统概述
**稷下学宫AI辩论系统**是一个融合中国传统文化与现代AI技术的智能辩论平台以八仙论道为核心通过记忆银行、ADK引擎和多智能体协作实现深度投资分析与哲学思辨。
## 📁 目录结构
```
jixia_academy/
├── core/ # 核心系统
│ ├── debate_system/ # 辩论系统引擎
│ │ ├── __init__.py
│ │ ├── main.py # 系统主入口
│ │ ├── agents/ # AI智能体
│ │ │ ├── __init__.py
│ │ │ ├── memory_enhanced_agent.py
│ │ │ └── baxian/ # 八仙角色定义
│ │ │ ├── __init__.py
│ │ │ ├── tieguaili.py # 铁拐李
│ │ │ ├── lvdongbin.py # 吕洞宾
│ │ │ ├── hexianggu.py # 何仙姑
│ │ │ ├── zhangguolao.py # 张果老
│ │ │ ├── lancaihe.py # 蓝采和
│ │ │ ├── hanzhongli.py # 汉钟离
│ │ │ ├── hanxiangzi.py # 韩湘子
│ │ │ ├── caoguojiu.py # 曹国舅
│ │ │ └── host.py # 太上老君主持人
│ │ ├── debates/ # 辩论模式实现
│ │ │ ├── __init__.py
│ │ │ ├── adk_memory_debate.py
│ │ │ ├── adk_turn_based_debate.py
│ │ │ └── swarm_debate.py
│ │ └── memory/ # 记忆系统已迁移至memory_bank
│ │ └── (legacy files)
│ │
│ ├── memory_bank/ # 记忆银行系统
│ │ ├── __init__.py
│ │ ├── base_memory_bank.py
│ │ ├── cloudflare_memory_bank.py
│ │ ├── vertex_memory_bank.py
│ │ ├── factory.py
│ │ └── schemas/
│ │ ├── __init__.py
│ │ └── memory_models.py
│ │
│ └── ai_engine/ # AI引擎
│ ├── __init__.py
│ ├── adk_integration.py
│ ├── gemini_client.py
│ └── openai_client.py
├── agents/ # 智能体系统
│ ├── baxian/ # 八仙论道系统
│ │ ├── __init__.py
│ │ ├── baxian_coordinator.py
│ │ ├── debate_flow.py
│ │ └── character_profiles/
│ │ ├── tieguaili.json
│ │ ├── lvdongbin.json
│ │ └── ...
│ ├── host/ # 主持人系统
│ │ ├── __init__.py
│ │ ├── taishanglaojun.py
│ │ └── debate_master.py
│ └── observers/ # 观察者和分析器
│ ├── __init__.py
│ ├── debate_analyzer.py
│ └── performance_tracker.py
├── integrations/ # 外部系统集成
│ ├── adk/ # Google ADK集成
│ │ ├── __init__.py
│ │ ├── adk_client.py
│ │ └── adk_config.py
│ ├── openbb/ # OpenBB金融数据集成
│ │ ├── __init__.py
│ │ ├── openbb_engine.py
│ │ ├── openbb_stock_data.py
│ │ └── providers/
│ ├── mongodb/ # MongoDB数据库集成
│ │ ├── __init__.py
│ │ ├── connection.py
│ │ ├── models.py
│ │ └── repositories/
│ └── cloudflare/ # Cloudflare Workers集成
│ ├── __init__.py
│ ├── kv_storage.py
│ └── worker_config.py
├── ui/ # 用户界面
│ ├── web/ # Web界面
│ │ ├── __init__.py
│ │ ├── index.html
│ │ ├── css/
│ │ ├── js/
│ │ └── assets/
│ ├── cli/ # 命令行界面
│ │ ├── __init__.py
│ │ ├── cli.py
│ │ └── commands/
│ └── streamlit/ # Streamlit应用
│ ├── __init__.py
│ ├── streamlit_app.py
│ ├── components/
│ └── tabs/
│ ├── adk_debate_tab.py
│ ├── ai_collaboration_tab.py
│ ├── openbb_tab.py
│ └── tianxia_tab.py
├── config/ # 配置管理
│ ├── __init__.py
│ ├── settings.py
│ ├── database.py
│ └── logging.py
├── data/ # 数据存储
│ ├── models/ # 预训练模型
│ ├── debates/ # 辩论记录
│ ├── logs/ # 系统日志
│ └── cache/ # 缓存数据
├── tests/ # 测试套件
│ ├── __init__.py
│ ├── unit/
│ ├── integration/
│ └── e2e/
├── docs/ # 文档系统
│ ├── api/ # API文档
│ ├── user/ # 用户指南
│ ├── architecture/ # 架构文档
│ └── examples/ # 使用示例
├── examples/ # 示例代码
│ ├── debates/
│ │ ├── adk_debate_example.py
│ │ ├── baxian_adk_gemini_debate.py
│ │ └── swarm_debate_example.py
│ ├── integrations/
│ │ ├── openbb_integration_demo.py
│ │ └── memory_bank_demo.py
│ └── api_usage/
│ └── rest_api_example.py
├── scripts/ # 部署和运维脚本
│ ├── install.sh
│ ├── setup.py
│ ├── start_debate.sh
│ └── deploy/
├── requirements.txt
├── pyproject.toml
├── README.md
└── LICENSE
```
## 🎯 核心模块说明
### 1. 辩论系统引擎 (core/debate_system/)
- **八仙论道**: 基于八卦理论的AI辩论系统
- **记忆增强辩论**: 集成记忆银行的智能辩论
- **轮流辩论**: ADK驱动的结构化辩论流程
### 2. 记忆银行系统 (core/memory_bank/)
- **Cloudflare KV**: 分布式键值存储
- **Vertex AI**: Google Cloud记忆管理
- **MongoDB**: 结构化数据存储
- **记忆工厂**: 统一记忆管理接口
### 3. 智能体系统 (agents/)
- **八仙角色**: 铁拐李、吕洞宾、何仙姑等8个AI角色
- **主持人**: 太上老君辩论主持
- **观察者**: 辩论分析和性能监控
### 4. 集成系统 (integrations/)
- **Google ADK**: 智能体开发套件
- **OpenBB**: 金融数据和分析
- **MongoDB**: 数据持久化
- **Cloudflare**: 边缘计算和存储
## 🚀 快速开始
```bash
# 安装依赖
pip install -r requirements.txt
# 启动八仙论道
python -m jixia_academy.core.main --mode baxian --topic "投资策略分析"
# 启动Streamlit界面
streamlit run jixia_academy/ui/streamlit/streamlit_app.py
```
## 📊 系统特色
- **文化传承**: 融合中国传统文化与现代AI
- **智能辩论**: 基于八卦理论的深度思辨
- **记忆增强**: 持续学习和知识积累
- **多模态交互**: CLI、Web、Streamlit多种界面
- **金融集成**: OpenBB专业金融数据分析