Skip to main content

AnyMsg

Self-hosted Telegram and WhatsApp archive for AI agents. A GoSync open-source project.

Collect messages and attachments once, then let agents search and read them through MCP or HTTP with separate credentials and account/chat permissions. Original files use SHA-256 deduplication; references to every source message stay separate.

Current version: 0.9.9 — experimental, PostgreSQL schema 21.

What works

  • Multiple Telegram and WhatsApp accounts, each with its own session and collection state.
  • PostgreSQL full-text search, including Russian word forms, people/usernames, chat/date/sender filters, nearby context and direct provider references.
  • Searchable file text, PDF/Office/table extraction, bounded OCR and optional audio transcription or image/document enrichment through local or API profiles.
  • Per-chat history coverage, collector errors and separate download/extraction/analysis states.
  • Scoped agent keys, independent acknowledgements, immutable review records and revision evidence.
  • Durable collection queues, storage admission, processing budgets and a shared heavy-job lock.
  • Encrypted streaming backup with integrity checks and quarantine restore tools.

Message sending is not implemented in this release. Reads do not mark messages as read in Telegram or WhatsApp. Empty search results do not prove complete history. Durable history-wave execution, cold-file eviction/rehydration and independent AI artifact reuse are planned. Optional cloud processing is off until explicitly configured.

Distribution

  • Python anymsg: server, operator CLI and HTTP client. Internal messaging_service imports, database names and migration checksums remain compatible.
  • npm anymsg: dependency-free JavaScript HTTP client and CLI for an existing server. It does not install PostgreSQL, Chromium or a second messenger session.
  • Source / Docker: server setup and explicit collector overlays in deploy/.

For a source installation with Python 3.13:

git clone https://github.com/GoSync-Inc/anymsg.git
cd anymsg
uv sync --group dev
uv run anymsg --help

Registry installation (Python 3.13):

pip install anymsg==0.9.9
npm install anymsg@0.9.9

Python installs the server/operator CLI and HTTP client; npm installs only the JavaScript HTTP client/CLI. Deployment prerequisites are in SETUP.md. Maintainer publication instructions are in RELEASING.md.

JavaScript client:

import { AnyMsgClient } from 'anymsg';
const client = new AnyMsgClient({
  baseUrl: 'https://messages.example.com',
  token: process.env.ANYMSG_TOKEN,
});
const result = await client.search({ query: 'contract', limit: 10 });

Python client:

import os
from anymsg import Client
with Client('https://messages.example.com', os.environ['ANYMSG_TOKEN']) as client:
    result = client.search(query='contract', limit=10)

Point a Streamable HTTP MCP client at https://messages.example.com/mcp and set Authorization: Bearer <agent key>. Use each agent's own scoped key. The server uses JSON POSTs; it does not provide a GET notification stream.

Operations and limits

The tested server stack is Linux amd64, Python 3.13, Node 24 for WhatsApp and PostgreSQL 18. Windows server execution is unsupported. Native host prerequisites include PostgreSQL tools for backups and Node/Chromium for WhatsApp; a Python wheel alone cannot provide those system services. Docker ARM support is not claimed.

Use separate deployments/databases for different owners. Multiple accounts in one installation do not create a tenant security boundary. Never run two clients against one provider session. History available to a linked WhatsApp device can be partial. The WhatsApp adapter uses unofficial whatsapp-web.js; it is not the WhatsApp Business API and can break or lead to account restrictions. Follow provider terms and use appropriately authorized account/chat scopes.

See ACCESS.md, SEARCH.md, FILE_INDEX.md, COLLECTORS.md, MEDIA_STORAGE.md, ENRICHMENT.md and BACKUP_STREAMING.md. Run synthetic tests only: CONTRIBUTING.md. Planned work and scope: ROADMAP.md.

License and security

MIT for original GoSync code. Dependencies retain their own licenses; see THIRD_PARTY_NOTICES.md and deploy/MOBY-LICENSE. Report vulnerabilities privately through GitHub security advisories, not by posting session data or tokens in an issue. See SECURITY.md.

Metadata

Release files for anymsg 0.9.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for anymsg 0.9.9
File Size Uploaded
anymsg-0.9.9.tar.gz 443.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for anymsg 0.9.9
File Interpreter ABI Platform
anymsg-0.9.9-py3-none-any.whl Python 3 none any Details

Total release size: 675.2 kB

Release files / anymsg-0.9.9.tar.gz

Download URL anymsg-0.9.9.tar.gz
Size 443.0 kB
Tags Source
SHA-256 checksum
How to use checksums
794b43c45a4660d6bfbf17438b446298cdd55ff268bdc38c231f05331221db2c
BLAKE2b-256 checksum
How to use checksums
593bc03733c0421d9979129828229c9e66d29fbeea674c22315ee3da94c0137f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release files / anymsg-0.9.9-py3-none-any.whl

Download URL anymsg-0.9.9-py3-none-any.whl
Size 232.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2fa84a9e2789811742402cd3b7283d6410d115ccf27601080ac1dc46e465c918
BLAKE2b-256 checksum
How to use checksums
e90de349474c6116f3196b215e0ca04ee94f607c3e46bf8d301d4c51fc97f73e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.9.9 This release

2 release files

0.9.8

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page