Skip to content

Repository files navigation

CooMate - AI 认知参谋

一个基于对话的 AI 认知参谋,通过结构化提问引导用户自己找到答案。

核心理念

CooMate 不直接给答案。它通过 5 步结构化提问,引导你自己找到答案:

  1. 反问成立性 - 质疑问题本身是否成立
  2. 深挖追问 - 暴露隐藏的假设和情绪
  3. 复盘与情绪标记 - 识别防御、逃避和循环模式
  4. 多角度思考题 - 从不同维度探索问题
  5. 一个微型实验 - 给出下一分钟就能执行的行动

功能特性

  • 5 步结构化对话流程
  • 流式输出,实时显示 AI 思考过程
  • 支持多种场景:研究思考、创意发散、情感分析、决策分析
  • 会话保存与历史查看
  • 支持多种 LLM 提供商(MiniMax、OpenAI 兼容等)
  • 响应式设计,支持移动端

技术栈

前端:

  • Vue 3 + TypeScript
  • Vite
  • TailwindCSS
  • Pinia 状态管理

后端:

  • Python FastAPI
  • SQLAlchemy ORM
  • PostgreSQL
  • httpx 异步客户端

快速开始

前置要求

  • Python 3.9+
  • Node.js 18+
  • PostgreSQL

安装步骤

  1. 克隆项目
git clone <your-repo-url>
cd CooMate
  1. 安装后端依赖
pip install -r requirements.txt
  1. 安装前端依赖
cd apps/frontend
npm install
  1. 配置环境变量
cp .env.example .env
# 编辑 .env 文件,配置你的 API 密钥和数据库连接
  1. 初始化数据库
cd apps/backend
python -c "from database import init_db; init_db()"
  1. 启动服务

方式一:使用启动脚本(Windows)

start-dev.bat

方式二:手动启动

# 终端 1 - 后端
cd apps/backend
python -m uvicorn main:app --reload --host 0.0.0.0 --port 8266

# 终端 2 - 前端
cd apps/frontend
npm run dev
  1. 访问应用

项目结构

CooMate/
├── .env                    # 环境变量配置
├── .env.example           # 环境变量示例
├── .gitignore             # Git 忽略配置
├── start-dev.bat          # Windows 启动脚本
├── requirements.txt       # Python 依赖
├── package.json           # 根目录依赖
├── docs/                  # 文档
│   ├── DESIGN.md         # 设计文档
│   └── system_prompt.txt # AI 系统提示词
├── apps/
│   ├── backend/          # 后端服务
│   │   ├── main.py       # FastAPI 入口
│   │   ├── config.py     # 配置管理
│   │   ├── llm_client.py # LLM 调用客户端
│   │   ├── database.py   # 数据库管理
│   │   ├── auth.py       # 认证模块
│   │   ├── routers/      # API 路由
│   │   └── models/       # 数据模型
│   └── frontend/         # 前端应用
│       ├── src/
│       │   ├── components/ # Vue 组件
│       │   ├── stores/    # Pinia 状态管理
│       │   ├── services/  # API 服务
│       │   └── types/     # TypeScript 类型
│       └── index.html    # 入口文件
├── reference/            # 参考代码
└── sample/              # 示例代码

API 端点

聊天

  • POST /api/chat - 发送消息(流式响应)
  • GET /api/conversations - 获取会话列表
  • GET /api/conversations/{id} - 获取会话详情
  • DELETE /api/conversations/{id} - 删除会话

认证

  • POST /api/auth/register - 用户注册
  • POST /api/auth/login - 用户登录
  • POST /api/auth/guest - 游客登录
  • POST /api/auth/logout - 退出登录

配置说明

.env 文件中配置以下变量:

# LLM Provider
LLM_BASE_URL=https://api.minimaxi.com/anthropic
LLM_API_KEY=your-api-key
LLM_MODEL=MiniMax-M2.7
LLM_PROVIDER=minimax_anthropic

# Server
HOST=0.0.0.0
PORT=8266
DEBUG=true

# Database
DATABASE_URL=postgresql+psycopg://user:password@localhost:5432/coomate

贡献指南

欢迎提交 Issue 和 Pull Request!

  1. Fork 项目
  2. 创建功能分支 (git checkout -b feature/AmazingFeature)
  3. 提交更改 (git commit -m 'Add some AmazingFeature')
  4. 推送到分支 (git push origin feature/AmazingFeature)
  5. 开启 Pull Request

许可证

MIT License

联系方式

如有问题,请提交 Issue。

About

一个 AI 认知参谋,通过追问深挖、复盘觉察、多角度提问等方式,引导你独立思考、发现思维漏洞,适用于情感、创意、学习等多种场景。 / An AI cognitive companion that guides you to think deeper, find logic flaws, reframe problems, and explore multiple perspectives — for emotions, creativity, learning, and beyond.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages