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.8 — 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. Internalmessaging_serviceimports, 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
The built wheel also installs outside the checkout. Registry publishing requires maintainer account setup; see 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.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| anymsg-0.9.8.tar.gz | 442.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| anymsg-0.9.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 675.1 kB
Release files / anymsg-0.9.8.tar.gz
| Download URL | anymsg-0.9.8.tar.gz |
|---|---|
| Size | 442.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d0def2910c05d6860e4ea5bd9912dcdaae147e0e99f77b9c1ebe7d0acbce97ee
|
|
BLAKE2b-256 checksum How to use checksums |
ed1310b1ec56c160bce7a672fae046e420488578e4925a1bb53877a0aa1c2d71
|
| 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 logRelease files / anymsg-0.9.8-py3-none-any.whl
| Download URL | anymsg-0.9.8-py3-none-any.whl |
|---|---|
| Size | 232.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dad60261f2e056fddf7b10695ef2b86918b95b61fde903c5ffb66aecd905e304
|
|
BLAKE2b-256 checksum How to use checksums |
89290548ad88618729c8eb06545ad92c5f9b30b3e17f69ec858c83ee3eb7356e
|
| 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