[Feat]: NoSQL (MongoDB) TaskStore / PushNotificationConfigStore backend — production-verified reference implementation available
Les mainteneurs répondent en général sous 3 jours
@ishymko y travaille déjà.
Depuis le 28/8/2026.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 45/100
Piste de recherche
L’issue propose d’ajouter un TaskStore et un PushNotificationConfigStore reposant sur MongoDB au SDK a2a-python. Commencez par examiner le DatabaseTaskStore existant dans l’extra a2a-sdk[sql] afin de comprendre l’interface et la sémantique. Examinez la définition proto de Task et la sérialisation. L’implémentation doit gérer le partitionnement par propriétaire, la pagination avec des filtres de curseur et les index TTL pour la rétention. Remplacez get_info_for_dispatch dans le store de configuration push par une version avec mémoïsation. Les tests doivent vérifier la persistance entre réplicas et le comportement de la pagination.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Summary
The SDK currently ships two TaskStore backends: InMemoryTaskStore and the SQLAlchemy-based DatabaseTaskStore (a2a-sdk[sql]). There is no supported path for document/NoSQL databases, even though task records are a natural fit for them. We built and deployed a MongoDB-backed TaskStore + PushNotificationConfigStore for a production A2A server (FastAPI, multi-replica) and would like to propose upstreaming a generic version — either as an optional extra (e.g. a2a-sdk[mongodb]) or as a documented reference implementation.
Why a document store fits this data
- Tasks are ephemeral, retention-bound records. They are written per request, re-read for a bounded window (
GetTask/ListTasks), and then expire. MongoDB TTL indexes handle retention natively (one index on anupdated_atfield); with SQL backends every deployment has to build its own cleanup job (cron /EVENTscheduler / partition rotation). - Many A2A server deployments already run a document store for conversation state, and adding a relational database + Alembic migrations solely for task persistence is a heavy dependency for what is a single-collection workload.
Implementation notes (lessons that may save others time)
We verified these against SDK 1.1.2 semantics; happy to carry them into a PR:
- Store the
Taskas serialized proto bytes, not ProtoJSON.Task.metadatais a protoStructwith arbitrary client-supplied keys — keys containing.or$become invalid MongoDB document keys afterMessageToDict. Storingtask.SerializeToString()as opaque bytes (plus a handful of extracted top-level fields for querying: owner,context_id,status.state,status.timestamp) is exact, round-trip safe, and resilient to unknown fields across SDK upgrades. - Owner partitioning parity. All reads/writes are scoped by
owner_resolver(context)(defaultresolve_user_scope), matchingInMemoryTaskStore— including refusing cross-owner access onget/delete. - Pagination matching in-memory semantics. Sort
(status.timestamp desc — nulls last, id desc); the page token (encode_page_token) is the id of the first item of the requested page (inclusive anchor), so the store re-resolves the anchor document to build a(timestamp, id)cursor filter; unknown tokens raiseInvalidParamsError. MongoDB's BSON ordering (Date > Nullunder descending sort) reproduces the in-memory null-handling exactly. get_info_for_dispatchmust be overridden on customPushNotificationConfigStoreimplementations (the base fallback silently drops notifications for authenticated owners — the docstring warns about this, but it is easy to miss). Since streaming turns call it once per emitted event, we front it with a short (5s) in-process memo keyed bytask_id, invalidated onset_info/delete_info.
The whole thing is ~200 lines for both stores. Deployed behind a FastAPI JSONRPC server; verified: task survives process restart and is served by a different replica, ListTasks cursor pagination over 100+ tasks, push configs dispatching across replicas.
Questions for maintainers
- Is there interest in an official NoSQL backend, and if so, would you prefer an optional extra (
a2a-sdk[mongodb], pymongo async client) or a documented recipe in the docs/examples? - If an extra: should it mirror
DatabaseTaskStore's constructor conventions (create_table→ensure_indexes,owner_resolverinjection), and should retention (TTL) be part of the contract or left to operators? - Would you want the same treatment for
PushNotificationConfigStorein the same PR?
If maintainers are open to it, we're happy to submit the PR with tests (the store semantics above are covered by a small in-memory fake collection in our suite; we can port those tests).
- Langage dominant
- Python
- Étoiles
- 2.2k
- Forks
- 518
- Merge moyen
- 3 j 19 h
- PR mergées (30 j)
- 43
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de a2aproject/a2a-python
-
[Bug]: `A2A-Version` validation ignores minor versions and the query parameterPeut-être pris @rohityan l’a pris il y a 58 jours. Ouvertecomponent: server status:awaiting response
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
a2aproject/a2a-python#1204 · 3 commentaires · 1 personne assignée ·
Les mainteneurs répondent en général sous 3 jours
-
[Bug]: REST task/request id sanitizationPeut-être pris @Linux2010 l’a pris il y a 117 jours. Ouvertemaintainers-only
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
a2aproject/a2a-python#805 · 1 commentaire ·
Les mainteneurs répondent en général sous 3 jours
-
Zero-downtime migration mode stores tasks without last_updatedPeut-être pris @ConnorMoss02 l’a pris aujourd’hui. Ouvertecomponent: server status:awaiting response
a2aproject/a2a-python#1371 · 1 commentaire · 1 personne assignée ·
Les mainteneurs répondent en général sous 3 jours
-
[Bug]: v0.3 JSON-RPC compat adapter returns -32603 for all A2A errors (e.g. TaskNotFound should be -32001)Peut-être pris @shwetangsinha0509 l’a pris aujourd’hui. Ouvertecomponent: server status:awaiting response
a2aproject/a2a-python#1368 · 2 commentaires · 1 personne assignée ·
Les mainteneurs répondent en général sous 3 jours
-
[Bug]: VersionedDatabaseTaskStore get() and delete() fail with "no such table" when initialize() was not calledPeut-être pris @cchinchilla-dev l’a pris il y a 1 jour. Ouvertecomponent: server status:awaiting response
a2aproject/a2a-python#1356 · 1 commentaire · 1 personne assignée ·
Les mainteneurs répondent en général sous 3 jours
Toutes les issues de a2aproject/a2a-python
Issues similaires
-
Python Volcengine provider returns failures instead of raising themPeut-être pris @Ricardo-M-L l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 79/100
agent-infra/sandbox#248 ·
-
Textractor leaves empty temporary files when remote retrieval failsPeut-être pris @HuaTNA l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
Les mainteneurs répondent en général sous 1 jour
-
test(bm_generation): pin the learning parameters and CPU sync shortcutPeut-être pris @iloveeyjafjalla l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
qboson/kaiwu-pytorch-plugin#1341 ·
Les mainteneurs répondent en général sous 2 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
elder-plinius/V3R1T4S#625 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
foxglove/mcap#1907 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour