Skip to content

Integrate datalib as the default personal-data store for agents#246

Draft
qi-imbue wants to merge 4 commits into
mainfrom
mngr/datalib-integration
Draft

Integrate datalib as the default personal-data store for agents#246
qi-imbue wants to merge 4 commits into
mainfrom
mngr/datalib-integration

Conversation

@qi-imbue

@qi-imbue qi-imbue commented Jul 8, 2026

Copy link
Copy Markdown

What

Makes datalib (the frankweiler tools) the default way Minds agents retrieve, search, and import the user's own personal data -- past chat conversations, Slack, email, GitHub, Notion, contacts -- into a local searchable mirror. Mirrors the mechanism that makes latchkey the default for outbound authenticated requests: a Claude Code skill + environment wiring + a binary installed into the image.

Changes

  • .agents/skills/datalib/SKILL.md (new) -- the core deliverable. Its description makes the agent reach for it whenever the user asks about their own history. Teaches the agent to search the local store over its HTTP API (127.0.0.1:8731/api/search) or the qmd index, and to import/refresh sources with frankweiler-sync. Credentials flow through the existing latchkey gateway; the skill defers to the latchkey skill for the permission handshake.
  • scripts/setup_system.sh -- installs the fully-static musl frankweiler-sync / frankweiler-http binaries (v0.16.0) via datalib's install.sh with FRANKWEILER_LIBC=musl, so they run as-is regardless of the base image's libc. Version pinned; install.sh fetched at the pinned tag for a reproducible build.
  • .mngr/settings.toml -- sets FRANKWEILER_ROOT=/mngr/datalib: on the persistent /mngr volume so it survives restarts, but deliberately outside /mngr/code (git workspace) and runtime/ so the large doltlite + qmd store does not ride the runtime-backup git branch.
  • CLAUDE.md -- steers agents to the skill for questions about the user's history.

Auth: no new plumbing

frankweiler-sync shells out to its own latchkey, which reads the LATCHKEY_GATEWAY* env vars Minds already injects -- so web-API syncs route through the same gateway and permission dialog the user already approves for Slack/GitHub/etc. No LATCHKEY_CURL wiring needed (the binary auto-locates its shim as a sibling).

MVP scope / known limitation

Reliable through the Minds gateway: Slack, GitHub, Notion, email (Google Takeout .mbox). Not reliable: Cloudflare-walled sources (claude_api, chatgpt_api) -- inside Minds, latchkey routes through its gateway and bypasses datalib's Chrome-impersonating curl shim, so Cloudflare challenges them. The skill tells the agent this and to prefer an on-disk export for that data.

Open questions for review

  • data_root location. /mngr/datalib persists per-workspace and is not part of the runtime git backup (too large). A future iteration could add targeted backup of just the precious raw/ stores, or move to the "local datalib over a gateway" model.
  • Retrieval server lifecycle. The skill starts frankweiler-http on demand. A services.toml-supervised background service would be cleaner but needs to tolerate an empty data root -- deferred.
  • Sensitivity. datalib accumulates high-value private data; the skill flags it as private + untrusted, but making it a default for autonomous agents warrants a policy pass (lethal-trifecta exposure).

Testing

Not yet exercised end-to-end. Plan: just minds-start -> create a Docker agent (rebuilds the image, exercising the musl binary install) -> ask it to mirror + search a Slack channel and confirm the skill auto-invokes, the sync runs through the latchkey permission dialog, and a query returns.

🤖 Generated with Claude Code

qi-imbue and others added 4 commits July 8, 2026 17:02
Add a `datalib` skill plus provisioning so Minds agents mirror and search
the user's own data (Slack, email, GitHub, Notion, chat history) via the
frankweiler tools, authenticating through the existing latchkey gateway.

- .agents/skills/datalib/SKILL.md: search the local mirror over its HTTP
  API / qmd index; import & refresh sources with frankweiler-sync.
- scripts/setup_system.sh: install frankweiler-sync / frankweiler-http
  (pinned via FRANKWEILER_VERSION).
- .mngr/settings.toml: FRANKWEILER_ROOT=/mngr/datalib (persistent,
  non-git-backed data root).
- CLAUDE.md: steer agents to the skill for questions about their history.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The previous one-liner backgrounded the whole health-check-or-start list,
so a query could race the server coming up. Start in the background only
on a failed health check, then poll until it accepts connections.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
v0.16.0 publishes fully-static *-unknown-linux-musl tarballs; select them
via FRANKWEILER_LIBC=musl so the frankweiler binaries run as-is regardless
of the base image's libc. Pin the version (and fetch install.sh at that
tag) for a reproducible image build.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Verified against the real v0.16.0 musl binaries in the FCT base image:
frankweiler-sync reads $FRANKWEILER_CONFIG (or --config), not the old
FRANKWEILER_ROOT env from the v0.9-era Docker image. The data root is that
file's parent dir. Point settings.toml at /mngr/datalib/config.yaml and have
the skill derive DATA_ROOT via `dirname "$FRANKWEILER_CONFIG"`. Config schema,
the system/qmd/index.sqlite path, <name>/rendered_md/ tree, and the
/api/health + /api/search HTTP surface all confirmed unchanged on v0.16.0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant