Skip to content

[DO NOT MERGE - PoC] feat: support open agent discovery under shared base URL via API Catalog #109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

ognis1205
Copy link
Contributor

@ognis1205 ognis1205 commented May 26, 2025

Description

Thank you for opening a Pull Request!
Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

Note:
This PR is currently not ready to be merged as it temporarily uses types.py generated from a personal fork of the schema repository. This will be replaced with an official schema source once it becomes available or is upstreamed.

While this PR is primarily intended as a PoC/demo implementation, if google/A2A#642 is considered meaningful and accepted by the community, we may consider merging this implementation more formally into the project.

Some checks (e.g., Check Spelling, Lint Code Base) are currently failing, but since this PR is primarily for PoC/demonstration purposes, these issues are not critical at this stage. They will be addressed within this PR.

TODO

  • Complete SDK implementation
  • Add example usage
  • Write test cases

Fixes N/A 🦕

@ognis1205 ognis1205 changed the title feat(schema): support open agent discovery under shared base URL via API Catalog (WIP) feat: support open agent discovery under shared base URL via API Catalog (WIP) May 26, 2025
@ognis1205 ognis1205 force-pushed the poc/agent-catalog branch from 2aa4a5c to 2bdc4f8 Compare May 28, 2025 02:35
@ognis1205 ognis1205 changed the title feat: support open agent discovery under shared base URL via API Catalog (WIP) feat: support open agent discovery under shared base URL via API Catalog May 28, 2025
@ognis1205 ognis1205 marked this pull request as ready for review May 28, 2025 23:51
@ognis1205 ognis1205 requested a review from a team as a code owner May 28, 2025 23:51
@ognis1205 ognis1205 force-pushed the poc/agent-catalog branch from 746d5b3 to 55ae0e3 Compare May 31, 2025 23:30
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move this demo into the a2a-samples repo? https://github.com/google-a2a/a2a-samples

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion!

As noted in the PR, this is currently a PoC and includes temporary implementations of A2AStarletteRouteBuilder and A2AStarletteBuilder within this working branch. These are used to support the example shown here.

I've kept the example in this repo for now to keep everything self-contained and demonstrable in one place. That said, if the upstream proposal is accepted, I'm happy to migrate the example to the a2a-samples.

Appreciate the feedback—please let me know if you'd prefer an early move regardless of the upstream status. Thanks again!

@@ -1058,6 +1142,21 @@ class SetTaskPushNotificationConfigSuccessResponse(BaseModel):
"""


class AgentCatalog(BaseModel):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change will need to be approved in the A2A specification. https://github.com/google-a2a/A2A

This file is the current source of truth https://github.com/google-a2a/A2A/blob/main/types/src/types.ts

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @holtskinner , thank you for the review!

Just a quick reminder: as mentioned in the PR description, this is a PoC and currently uses a temporary types.py generated via datamodel-codegen from a personal fork of the schema repository. This setup is only intended to demonstrate what integration might look like, and will be updated once the schema is finalized and available upstream.

To make this intent clearer, I’ll update the PR title accordingly as well. Thanks again for taking the time to look through it!

@ognis1205 ognis1205 changed the title feat: support open agent discovery under shared base URL via API Catalog [DO NOT MERGE - PoC] feat: support open agent discovery under shared base URL via API Catalog Jun 2, 2025
ognis1205 added 11 commits June 4, 2025 05:03
@ognis1205 ognis1205 force-pushed the poc/agent-catalog branch from 6e86e78 to 293dc75 Compare June 3, 2025 20:04
ognis1205 added 2 commits June 4, 2025 06:00
Signed-off-by: Shingo OKAWA <[email protected]>
@yangzhengzhiroy
Copy link

yangzhengzhiroy commented Jun 4, 2025

I was exploring shared domain and this is right on time, thanks!

If I understand correctly, this change requires agent catalog definition to have multiple agent card info into one catalog for agent discovery. Since this requires changes on a2a.json, will it be easier to adopt this feature by keeping the same schema with separate well-known locations, {base-url}/{agent-identifier}/.well-known/agent.json? Though this requires one agent.json per each agent, it may help to push this feature more smoothly.

@ognis1205
Copy link
Contributor Author

Hi @yangzhengzhiroy, thank you for your comment!

Your understanding is mostly correct. While "API Catalog" might sound a bit grand, the idea is to support Open Discovery by exposing a list of agent endpoints via a /.well-known/agent-catalog endpoint. So as you pointed out, if we want to adopt this as part of the A2A protocol, it would indeed require changes to the a2a.json schema.

One small clarification: according to the RFC for Well-Known URIs, the .well-known path must reside at the root level of the origin. That means {base-url}/{agent-identifier}/.well-known/agent.json would not be valid. Instead, a path like {base-url}/{agent-identifier}/path/to/agent.json would be more appropriate (the actual path can be arbitrary outside of .well-known).

I'd really appreciate it if you could also take a look at this discussion and share your thoughts there!

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.

4 participants