X Archive Daemon

X Archive Daemon

Archives posts from X into a local SQLite database and provides tools for semantic analysis and natural language search. It enables agents to manage low-cost data ingestion and retrieve relevant posts using local embeddings and topic labeling.

Category
访问服务器

README

X Archive Daemon

Kisa aciklama: X uzerinden post toplayan, bunlari yerel SQLite arsivine yazan ve MCP ile ajanlara kullandiran daemon tabanli bir arsivleme ve akilli arama projesi.

X Archive Daemon archives posts from X into a local SQLite database, exposes them through a daemon-first architecture, and optionally adds a local semantic analysis layer for smarter retrieval.

Install First

If you work with coding agents, the easiest setup flow is:

  1. Give the repository link to the agent.
  2. Ask the agent to install dependencies.
  3. Ask the agent to create the local secret file.
  4. Ask the agent to start the daemon and the MCP bridge.

Manual setup:

npm install

Create .secrets/x.json:

{
  "authMode": "bearer_token",
  "bearerToken": "YOUR_X_BEARER_TOKEN"
}

Start the daemon:

npm run daemon:start

Start the MCP bridge:

npm run mcp:start

What This Project Does

This project has three layers:

  • ingest
    • fetch posts from X
    • store them in SQLite
  • analysis
    • optional
    • adds local embeddings, topic labels, and educational scoring
  • semantic search
    • searches analyzed posts locally
    • gives the agent a small, relevant candidate set

Scenario:

  • ingest = put boxes into storage
  • analysis = attach labels to the boxes
  • semantic search = find the right boxes quickly

Architecture

  • daemon
    • the real execution engine
    • exposes:
      • GET /health
      • GET /tools
      • POST /invoke
  • MCP
    • thin stdio bridge for agents
    • exposes the same tools to the model
  • SQLite
    • stores posts, scopes, sync runs, billing estimates, and optional analysis results

Core Features

1. Smart, low-cost ingest

The system avoids paying twice for the same coverage.

Example:

  • first you fetch the latest 50
  • later you ask for the latest 100
  • it does not re-fetch the first 50
  • it fetches only the missing 50

This works for:

  • latest N timeline
  • latest N original posts
  • exact repeated date windows
  • exact repeated search queries

2. Original posts by default

When a user generically says "fetch posts" or "archive tweets", the default tool is:

  • ingest.accounts.original_backfill

This excludes:

  • replies
  • retweets
  • quote tweets

That keeps the archive cleaner and cheaper.

3. Media URLs are stored, files are not downloaded

If a post contains images:

  • files are not downloaded
  • only mediaUrls are stored

This keeps disk and network usage low.

4. Optional analysis layer

Analysis is off by default.

That means:

  • you can archive posts without analyzing them
  • you can analyze the same archive later
  • old and newly ingested posts are both supported

5. Local semantic search

Once analysis exists, you can search with natural language prompts like:

  • "teaching posts about coding"
  • "monolith vs microservices"
  • "backend and architecture advice"

The system then:

  • searches the analyzed local archive
  • scores candidates locally
  • lets the agent work on a narrow, relevant subset

Tool Groups

  • sources.accounts.resolve
  • ingest.accounts.backfill
  • ingest.accounts.original_backfill
  • ingest.accounts.sync
  • ingest.search.backfill
  • archive.posts.list
  • archive.posts.search
  • archive.posts.semantic_search
  • archive.accounts.list
  • archive.accounts.get
  • archive.billing.summary
  • analysis.posts.run
  • analysis.labels.list
  • archive.insights.summary

MCP also exposes:

  • system.daemon.start

Risk Model

safe-read

  • read-only
  • does not change X or the local archive

operator-write

  • writes into the local SQLite archive
  • may consume X API credits
  • does not create, delete, like, reply, or DM on X

Note:

  • analysis.posts.run is also operator-write
  • but it does not consume X API credits
  • it only writes local analysis data and uses CPU

Performance Reference

Measured system:

  • Apple Silicon M4 mini
  • 16 GB RAM
  • local embedding model on CPU

Measured analysis speed:

  • 900 posts = about 30.69s
  • 100 posts = about 3.41s
  • 980 posts = about 33.42s expected total

Important:

  • this is not a large generative LLM benchmark
  • this is local tagging + embedding + semantic retrieval preparation

Local Model

The current analysis layer uses one small local model:

  • sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2

Its role is:

  • post embeddings
  • label-description embeddings
  • query embeddings
  • similarity-based tagging
  • semantic retrieval

This layer does not generate final answers. It builds a local meaning layer on top of the archive.

How Analysis Works

When analysis runs, each post gets signals such as:

  • educational score
  • matched labels
  • topic scores
  • reply/noise/technical flags

Tagging is based on:

  • rule-based signals
  • embedding similarity
  • a fixed label catalog with descriptions

Label Catalog

The repository includes a versioned label catalog with Turkish descriptions.

Examples:

  • software_architecture
  • monolith_vs_microservices
  • backend_api
  • database_sql
  • database_indexing
  • caching
  • distributed_systems
  • testing_qa
  • clean_code
  • code_review
  • security_appsec
  • authentication_authorization
  • ci_cd_release
  • ai_assisted_coding
  • vibe_coding
  • prompting_for_engineering
  • technical_decision_making

Quick Start

Check daemon health:

curl http://127.0.0.1:3200/health

List available tools:

curl http://127.0.0.1:3200/tools

Estimate original-post ingest:

curl -X POST http://127.0.0.1:3200/invoke \
  -H 'content-type: application/json' \
  -d '{
    "tool": "ingest.accounts.original_backfill",
    "input": {
      "username": "sampleauthor",
      "searchMode": "recent",
      "targetCount": 100,
      "estimateOnly": true
    }
  }'

Run local analysis:

curl -X POST http://127.0.0.1:3200/invoke \
  -H 'content-type: application/json' \
  -d '{
    "tool": "analysis.posts.run",
    "input": {
      "username": "sampleauthor",
      "limit": 200,
      "onlyUnanalyzed": true
    }
  }'

Run semantic search:

curl -X POST http://127.0.0.1:3200/invoke \
  -H 'content-type: application/json' \
  -d '{
    "tool": "archive.posts.semantic_search",
    "input": {
      "username": "sampleauthor",
      "query": "teaching posts about coding",
      "educationalOnly": true,
      "limit": 10
    }
  }'

Model Packaging Note

The repository is public and safe to clone, but the local model files are not stored in git history because of GitHub file size limits.

The codebase is public-ready. Model packaging is handled separately from normal git push history.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选