Backstory: search your data exports locally

io.github.magna-nz由 GitHub 账号 magna-nz 发布v1.1.0更新于 Oct 24, 2026

Search your Google, Telegram, Spotify and Instagram exports locally. Fully offline.

概览

AI 生成的概览

本地 MCP 服务器,将 Google、Telegram、Spotify 和 Instagram 的数据导出索引成可搜索的时间线,供助手查询。

可以做什么
按关键词或语义搜索统一时间线,支持日期、来源和数量过滤,并按时间顺序列出事件(search_timeline)。按 id 获取完整事件记录,包括指回来源的指针(get_events)。跨来源按名称查找人物或地点(lookup_entity)。取出某个日期范围内的全部事件,供助手总结(summarize_period)。列出已导入的来源及各自事件数(list_sources)。
适用场景
适合已下载个人数据导出、希望助手跨这些数据回答问题(例如上次给某人发消息是什么时候、旅行中查过哪家店),同时不想把数据上传到任何地方的情况。
运行要求
通过 .NET 10 SDK 在本机以本地进程运行,可安装为全局 dotnet 工具或从源码构建;支持 Linux、macOS 和 Windows。需先用命令行工具导入导出数据。数据库位于 BACKSTORY_DB 路径或主目录下的默认文件夹。可选的语义搜索需一次性下载约 90 MB 的模型。
安装前请注意
数据库包含高度私密的数据,如消息、搜索和位置历史,应保护好该 SQLite 文件并避免提交。唯一的网络访问是可选的模型下载。导入和监视功能会自动读取下载目录中的文件。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Backstory: search your data exports locally,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Backstory

Search all your data exports in one place. It runs entirely on your own computer, and nothing ever leaves your PC.

[CI] [NuGet] [Downloads] [.NET] [MCP] [Glama] [Platforms] [License: MIT] [Docs]

You can download your data from Google, Telegram, and most other services. The problem is what you get back: a pile of JSON and CSV files that are nearly impossible to read. Backstory pulls those exports into one local database and lets you search across all of them at once. You can search from the command line or connect it to an AI assistant over MCP.

Nothing is sent to the cloud. Your data stays in a SQLite file on your machine. That is the main reason this tool exists, since this is the most personal data you have.

Contents

What it can do

  • Import exports from Google, Telegram, Spotify, and Instagram.
  • Search everything as one timeline, by meaning or by keyword.
  • Match the same person or place across different sources.
  • Answer questions from an AI agent, like "when did I last message Sarah about dinner?".
  • Show you how to export your data, then import it automatically when it finishes downloading.
  • Report a benchmark so you can see how well the search actually works.

Sources

Each source is a small adapter that turns an export into events. Here is what works today and what each one pulls in.

SourceWhat it importsHow to export it
Google TakeoutSearch history, YouTube history, saved places, location historybackstory fetch google
TelegramMessages, contactsbackstory fetch telegram
SpotifyListening history, podcasts, searchesbackstory fetch spotify
InstagramDirect messages, posts, comments, searchesbackstory fetch instagram

Adding a new source means writing one adapter. Nothing else changes.

Quick start

You need the .NET 10 SDK. It runs on Linux, macOS, and Windows.

Install as a global tool:

bash
dotnet tool install -g Backstory

Or build from source today:

bash
git clone https://github.com/magna-nz/backstory && cd backstorydotnet build Backstory.slnx -c Release

Get your data in. Backstory shows you how to export it, then imports it for you when it lands in your Downloads folder:

bash
backstory fetch google      # or: telegrambackstory watch

You can also point it at a file or zip yourself. Takeout zips are unpacked for you, including the multi-part ones:

bash
backstory import ~/Downloads/takeout-20240101.zipbackstory import ~/Downloads/telegram-export/result.json

Then search:

bash
backstory search "dinner plans with sarah"backstory search "trip to japan" --from 2023-01-01

Use it from an AI agent

Backstory speaks MCP, so any MCP client (Claude and others) can query your timeline. Start the server:

bash
backstory serve

Register it with one command:

bash
claude mcp add backstory -- backstory serve

Or add it to your MCP config directly:

json
{  "mcpServers": {    "backstory": { "command": "backstory", "args": ["serve"] }  }}

Now you can ask the agent things like "what was that ramen place I looked up in Tokyo?" and it searches across both your Google and Telegram data to answer.

How it works

Every export format is messy in its own way, so a small adapter handles each one and converts it into the same shape: events on a timeline, plus the people and places they mention. From there everything works the same. Storage is SQLite with a full-text index for keywords and a vector index for meaning. A search runs both and combines the results.

mermaid
flowchart TD    TG["Telegram<br/>result.json"]:::src    GT["Google Takeout<br/>JSON / CSV"]:::src
    TG --> AD    GT --> AD
    AD["Adapters<br/><i>parse and normalize</i>"]:::ingest    NR["Normalizer<br/><i>events and entities</i>"]:::ingest    ER["Entity resolution<br/><i>link people and places</i>"]:::ingest    AD --> NR --> ER
    ER --> FTS[("SQLite + FTS5<br/>timeline, keyword")]:::store    ER --> VEC[("Vector index<br/>meaning")]:::store
    FTS --> HQ    VEC --> HQ    HQ["Search<br/><i>keyword + meaning</i>"]:::query
    HQ --> CLI["CLI"]:::iface    HQ --> MCP["MCP server"]:::iface
    classDef src fill:#FAECE7,stroke:#993C1D,color:#4A1B0C;    classDef ingest fill:#EEEDFE,stroke:#534AB7,color:#26215C;    classDef store fill:#E1F5EE,stroke:#0F6E56,color:#04342C;    classDef query fill:#E1F5EE,stroke:#0F6E56,color:#04342C;    classDef iface fill:#F1EFE8,stroke:#5F5E5A,color:#2C2C2A;

There is a full technical writeup at magna-nz.github.io/backstory and in SPEC.md.

Commands

CommandWhat it does
fetch google|telegram|spotify|instagramShow how to export your data, and open the page
watch [--dir <path>]Import exports automatically as they download to ~/Downloads
import <path>Import an export (file, folder, or Takeout zip)
search "<query>"Search the timeline. Filters: --from --to --source --limit
timelineList events in time order, with the same filters
entity "<name>"Look up a person or place
statsCounts by source and type, and the embedder in use
serveRun the MCP server
model fetchDownload the semantic search model (optional, one time)
evalRun the benchmark

The database lives at $BACKSTORY_DB, or ~/.backstory/backstory.db by default.

Search quality

There are two ways to turn text into vectors, and you can switch between them:

  • Hashing (default). No setup, fully offline, matches on the words that appear. Good enough to get started.
  • ONNX MiniLM. Real semantic search that matches on meaning. Run backstory model fetch once (about 90 MB) and Backstory uses it automatically. This is what lets a search for "japan vacation" find a message about a "flight to Tokyo".

You can measure the difference yourself with backstory eval. It loads sample data and reports two numbers: how much of the data was parsed, and how often the right event shows up in the top five search results.

EmbedderData parsedRight answer in top 5
Hashing (default)100%87.5%
ONNX MiniLM100%100%

MCP tools

ToolWhat it returns
search_timelineRanked events for a natural-language query
get_eventsFull event records by id, including a pointer to the source
lookup_entityA person or place by name
summarize_periodEvery event in a date range, for the agent to summarize
list_sourcesThe sources imported and how many events each has

Privacy

Everything runs locally and there is no telemetry. The only time Backstory touches the network is when you run backstory model fetch to download the search model, and that step is optional. Your data never leaves your machine. The .gitignore is set up so a database or an export can't be committed by accident.

License

MIT. See LICENSE. Built on the ModelContextProtocol SDK, ONNX Runtime, and all-MiniLM-L6-v2.

来源:README.md,提交 9822d4f

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.1.0最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分