How can I use API endpoints to retrieve and display agent data in my own UI?

Hello everyone!

I’m trying to build my own custom UI and use the Solace Agent Mesh app as the backend.

Right now, the only way I can access agent interactions is by connecting directly to the Solace Broker and subscribing to topics such as:

{namespace}/a2a/v1/agent/request/>
{namespace}/a2a/v1/agent/response/>
{namespace}/a2a/v1/gateway/response/>

This lets me receive the live agent communication flow but it isn’t persistent because I can’t create or manage sessions using the available REST APIs.

When I try to access endpoints like:

GET /api/v1/sessions/{session_id}/tasks/{task_id}

I get:

{
  "message": "Resource not found with path ...",
  "validationDetails": null
}

Is there an officially supported way to create and retrieve session, task, and agent data entirely through API endpoints, without relying on SSE streams or broker subscriptions, so that I can integrate everything directly into my own UI?

Hi @Shereen,

Can you elaborate more on what you’re trying to do with your app? Are you trying to build something that uses Solace Agent Mesh or are you trying to build something that helps observe/monitor it?

If the prior you might want to look at using the REST gateway. I think that might give you what you need. solace-agent-mesh-core-plugins/sam-rest-gateway at main · SolaceLabs/solace-agent-mesh-core-plugins · GitHub

1 Like

Hello Marc thank you for your response!

I built a multi agent SAM application but I want to use my own custom UI to interact with it therefore I’m looking for a way to easily create sessions, chat and maintain conversations through my UI, I’ll check the documentation you sent.

Hi Shereen !

Great to see you are using Soalce agent mesh for different use-cases. To answer your questions there a couple of things you can do. Interacting with Solace Agent Mesh happens through Gateways. Which means you can access agents interactions and dynamic workflows through sending prompts to the framework. There are several gateways you can take advantage of including

  • Built-in: for example, the WebUI Gateway is built-in into the SAM framework
  • Custom: REST Gateway, Event Mesh, Slack, Webhook… etc

Note that custom Gateways are either built from scratch or downloaded via plugins. You can see a list of example custom gateways here solace-agent-mesh/examples/gateways at main · SolaceLabs/solace-agent-mesh · GitHub

You can read more about the Gateway architecture here Gateways | Solace Agent Mesh

Now regarding your original ask of building your own session, tasks, and artifacts services - its not a trivial task since you have to handle these components on your end. For example, here is how the webUI gateway is implemented solace-agent-mesh/src/solace_agent_mesh/gateway/http_sse at main · SolaceLabs/solace-agent-mesh · GitHub and this is how you call the module directly from your agent yaml configuration solace-agent-mesh/examples/gateways/webui_gateway_example.yaml at main · SolaceLabs/solace-agent-mesh · GitHub . This custom WebUI gateway also manages observability through topic subscriptions and SSEs

You can still build your own custom UI with REST components to trigger events on a running SAM instance…

If you can provide more details on how you would like to use SAM as a backend to your custom UI it might be helpful to bring you to the right direction

1 Like

Hi Tamimi,

Thank you so much for the detailed and helpful response!

I think the links you shared will cover everything I need to get started, I’ll go through them in detail and if I run into anything else I’ll add it to this post.

Really appreciate your time and thorough explanation!