◉ Pulse
Jade3551 avatar
#52 today

Jade3551/Sora-mem

Python AI #ai-companion #capacitor #fastapi #long-term-memory

A self-hosted, private-first LLM companion and memory assistant.

Created Jul 1, 2026
Stars
18
Today
+18
Forks
2
Quality
70/100
Momentum
16

README

Fetched from GitHub on Nov 7, 2026, 1:31 AM UTC · README.md

View original on GitHub

Third-party content — Open Source Pulse is not the owner of this repository.

This README belongs to Jade3551/Sora-mem and its contributors. We fetch it directly from the project’s public GitHub repository and display it for reference only. All text, code, images and trademarks remain the property of their respective authors. See the repository for its license terms. Copyright / takedown policy.

Sora-mem

一个自建的、带长期记忆的 AI 伴侣。前后端全套开源,包括 Web 端、Android(Capacitor)壳、Chrome 侧边栏扩展。

⚠️ 本仓库只开源代码。不提供托管服务、不提供任何形式的免费部署。如果想跑起来,你需要自己准备 VPS + 域名 + SSL 证书,按下面的步骤搭。

功能一览

  • 💬 会话流式对话,支持多模态识图
  • 🧠 长期记忆系统:向量检索 + 热度衰减 + 自动整合合并
  • 📖 共读模式:并排读书 + 划线批注 + 页内讨论
  • 📓 自动日记(日 / 周 / 月三档)
  • 🎨 Artifact 画布:HTML/Markdown/代码文件版本化 + 隔离子域预览沙箱
  • 🕰️ 会话内上下文窗口自适应压缩
  • 📱 Capacitor Android App(复用同一份前端代码)
  • 🧩 Chrome 侧边栏插件:一键读当前网页给 Sora

技术栈

  • 后端:Python 3.11+、FastAPI、PostgreSQL 16 + pgvector、SQLAlchemy 2、APScheduler
  • 前端:React 19、Vite、TypeScript
  • 移动:Capacitor 6(Android)
  • LLM:默认走硅基流动 SiliconFlow(OpenAI 兼容接口),可自换任意 OpenAI 兼容供应商

目录结构

Sora-mem/
├─ backend/              后端 FastAPI 服务
│  ├─ app/               路由 / 模型 / 服务 / 调度器
│  ├─ scripts/           一次性迁移脚本
│  ├─ migrations/        Alembic 迁移
│  ├─ requirements.txt
│  └─ .env.example       环境变量样例(复制为 .env)
├─ frontend/             React + Vite 前端
│  ├─ src/
│  ├─ android/           Capacitor Android 工程
│  ├─ package.json
│  └─ .env.example       前端环境变量样例
├─ chrome-extension/     Chrome 侧边栏扩展
├─ deploy/               部署参考(自己按需改)
│  ├─ nginx/
│  └─ systemd/
├─ ops/                  运维脚本(健康检查 / 备份 / 恢复)
├─ dr/                   数据库 schema 参考
├─ LICENSE               MIT
└─ README.md

本地开发

后端

cd backend
python -m venv venv
source venv/bin/activate            # Windows: venv\Scripts\activate
pip install -r requirements.txt

cp .env.example .env                # 编辑 .env,至少填 DATABASE_URL / SECRET_KEY / DEEPSEEK_API_KEY

# 建库(本机 PostgreSQL 里)
createdb sora_db
psql sora_db -c "CREATE EXTENSION IF NOT EXISTS vector;"

# 建表 + 首个 admin 账户
PYTHONPATH=. python scripts/create_first_user.py

# 启动
PYTHONPATH=. uvicorn app.main:app --reload --host 0.0.0.0 --port 8000

前端

cd frontend
npm install
cp .env.example .env.local          # 编辑,指向本地后端
npm run dev                         # http://localhost:5173

Chrome 扩展

  1. 编辑 chrome-extension/sidepanel.js 顶部的 SORA_ORIGIN 改成自己的 Sora 前端地址
  2. 编辑 chrome-extension/sidepanel.html 里 iframe 的 src
  3. Chrome → 扩展程序 → 打开开发者模式 → 加载已解压的扩展程序 → 选 chrome-extension/ 目录

Android App

cd frontend
npm run build
npx cap sync android
# Android Studio 打开 frontend/android/ 打 APK

生产部署(要点)

这是提示,不是保姆教程。默认你已经会 nginx + systemd + PostgreSQL。

  1. VPS:Debian/Ubuntu,装好 Python 3.11+、Node 20+、PostgreSQL 16、pgvector、nginx、certbot
  2. 域名 + SSL:主域 your-domain.com,Artifact HTML 预览建议独立子域 sandbox.your-domain.com(隔离脚本执行)
  3. 改 deploy/nginx/* 里的 your-domain.example 为你的域名,放到 /etc/nginx/sites-available/,certbot 签证书
  4. 改 deploy/systemd/* 里的路径和域名,放到 /etc/systemd/system/
  5. backend/.env:PUBLIC_BASE_URL=https://your-domain.com、CORS_ORIGINS=https://your-domain.com,capacitor://localhost
  6. frontend/.env.production:VITE_API_BASE_URL=https://your-domain.com/api、VITE_ARTIFACT_SANDBOX_ORIGIN=https://sandbox.your-domain.com

安全提醒

  • .env 已在 .gitignore 里,永远别提交真实密钥
  • 生产 SECRET_KEY 用 openssl rand -hex 32 生成
  • Chrome 扩展、Android 网络白名单里的域名请务必改成你自己的
  • Android 包名默认 com.example.sora,如果你想上架必须改成你拥有的域名反写

License

MIT License,见 LICENSE。

说明

本项目是个人为自己搭的 AI 伴侣,代码里保留了一些"我"的口吻和 Sora 的人设默认值——你完全可以在设置里改。

Rendered by GitHub from the repository’s README. Scroll to read the full file.
First trending

Jul 18, 2026

first spotted on the list

Best rank

#52

highest position reached

Appearances

2

times on the trending list

Quality score

70

out of 100

Momentum

16

trend strength indicator

Star velocity

0.14

stars per day since creation

Activity — last 60 days

daily counts, collected every 6 hours
  • Stars
  • Forks
  • Merged PRs
  • Issues
  • Closed issues

Collecting activity data since launch — check back in a few days.

Star history

total stars per snapshot
171819Jade3551/Sora-mem · Jul 18, 7 AM UTC: 18 starsJade3551/Sora-mem · Jul 18, 9 AM UTC: 18 stars7:22 AM8:16 AM9:09 AM

Rank history

position on trending · lower is better
#1#50#55#60#65#70#75#80Jul 18, 7 AM UTC: rank #77Jul 18, 9 AM UTC: rank #527:22 AM8:16 AM9:09 AM

3D card for your website

Live HTML card with a glass surface and pointer tilt. Paste the iframe on any website.

<iframe src="https://www.notionpulse.cc/embed/Jade3551/Sora-mem" width="420" height="240" style="border:0;max-width:100%;background:transparent" loading="lazy" title="Jade3551/Sora-mem — trending on Open Source Pulse"></iframe>

Stars badge

Show current stars in your README or profile. Auto-updates every 6 hours.

Jade3551/Sora-mem stars badge
Markdown
[![Jade3551/Sora-mem](https://www.notionpulse.cc/api/badge/Jade3551/Sora-mem.svg)](https://www.notionpulse.cc/repo/Jade3551/Sora-mem)
HTML
<a href="https://www.notionpulse.cc/repo/Jade3551/Sora-mem"><img src="https://www.notionpulse.cc/api/badge/Jade3551/Sora-mem.svg" alt="Jade3551/Sora-mem stars badge" /></a>

Repository of the Day

#52 Repository of the Day

Repository of the Week

#52 Repository of the Week

Repository of the Month

#52 Repository of the Month