Readit News logoReadit News
Posted by u/yompal 10 months ago
Show HN: Agents.json – OpenAPI Specification for LLMsgithub.com/wild-card-ai/a...
Hey HN, we’re building an open specification that lets agents discover and invoke APIs with natural language, built on the OpenAPI standard. agents.json clearly defines the contract between LLMs and API as a standard that's open, observable, and replicable. Here’s a walkthrough of how it works: https://youtu.be/kby2Wdt2Dtk?si=59xGCDy48Zzwr7ND.

There’s 2 parts to this:

1. An agents.json file describes how to link API calls together into outcome-based tools for LLMs. This file sits alongside an OpenAPI file.

2. The agents.json SDK loads agents.json files as tools for an LLM that can then be executed as a series of API calls.

Why is this worth building? Developers are realizing that to use tools with their LLMs in a stateless way, they have to implement an API manually to work with LLMs. We see devs sacrifice agentic, non-deterministic behavior for hard-coded workflows to create outcomes that can work. agents.json lets LLMs be non-deterministic for the outcomes they want to achieve and deterministic for the API calls it takes to get there.

We’ve put together some real examples if you're curious what the final output looks like. Under the hood, these LLMs have the same system prompt and we plug in a different agents.json to give access to different APIs. It’s all templatized.

- Resend (https://demo.wild-card.ai/resend)

- Google Sheets (https://demo.wild-card.ai/googlesheets)

- Slack (https://demo.wild-card.ai/slack)

- Stripe (https://demo.wild-card.ai/stripe)

We really wanted to solve real production use cases, and knew this couldn’t just be a proxy. Our approach allows you to make API calls from your own infrastructure. The open-source specification + runner package make this paradigm possible. Agents.json is truly stateless; the client manages all memory/state and it can be deployed on existing infra like serverless environments.

You might be wondering - isn’t OpenAPI enough? Why can’t I just put that in the LLM’s context?

We thought so too, at first, when building an agent with access to Gmail. But putting the API spec into LLM context gave us poor accuracy in tool selection and in tool calling. Even with cutting down our output space to 5-10 endpoints, we’d see the LLMs fail to select the right tool. We wanted the LLM to just work given an outcome rather than having it reason each time which series of API calls to make.

The Gmail API, for example, has endpoints to search for threads, list the emails in a thread, and reply with an email given base64 RFC 822 content. All that has to happen in order with the right arguments for our agent to reply to a thread. We found that APIs are designed for developers, not for LLMs.

So we implemented agents.json. It started off as a config file we were using internally that we slowly started adding features to like auth registration, tool search, and multiple API sources. 3 weeks ago, Dharmesh (CTO of Hubspot) posted about the concept of a specification that could translate APIs for LLMs. It sounded a lot like what we already had working internally and we decided to make it open source. We built agents.json for ourselves but we’re excited to share it.

In the weeks since we’ve put it out there, agents.json has 10 vetted API integrations (some of them official) and more are being added every day. We recently made the tool search and custom collection platform free for everyone so it’s even easier for devs to scale the number of tools. (https://wild-card.ai)

Please tell us what you think! Especially if you’re building agents or creating APIs!

thomasfromcdnjs · 10 months ago
I've been following agents.json for a little while. I think it has legs, and would love to see some protocol win this space soon.

Will be interesting to see where the state/less conversation goes, my gut tells me MCP and "something" (agent.json perhaps) will co-exist. My reasoning being purely organisational, MCP focuses on a lot more, and there ability to make a slimmed down stateless protocol might be nigh impossible.

---

Furthermore, if agents.json wants to win as a protocol through early adoption, the docs need to be far easier to grok. An example should be immediately viewable, and the schema close by. The pitch should be very succinct, the fields in the schema need to have the same amount of clarity at first glance. Maybe a tool, that anyone can paste their OpenAPI schema into, and it gets passed to an LLM to generate a first pass of what their agents.json could look like.

---

The OpenAPI <> agents.json portability is a nice touch, but might actually be overkill. OpenAPI is popular but it never actually took over the market imo. If there is added complexity to agents.json because of this, I'd really question if it is worth supporting it. They don't have to be 100% inoperable, custom converters could manage partial support.

---

A lot of people are using agentic IDE's now, would be nice if agent.json shared a snippet with instructions on how to use it, where to find docs and how to pull a list and/or search the registry that people can just drop straight into Windsurf/Cursor.

yompal · 10 months ago
1) Thanks for being a part of the journey! We also want something that works for us as agent developers. We didn't feel like anything else was addressing this problem and felt like we had to do it ourselves.

We love feedback! This is our first time doing OSS. I agree - MCP and agents.json are not mutually exclusive at all. They solve for difference clients.

2) Agreed. Something we're investing in soon is a generic SDK that can run any valid agents.json. That means the docs might getting a revamp soon too.

3) While many API services may not use OpenAPI, their docs pages often do! For example, readme.com lets you export your REST API docs as OpenAPI. As we add more types of action sources, agents.json won't be 1:1 with OpenAPI. In that way, we left the future of agents.json extensible.

4) Great idea! I think this would be so useful

thomasfromcdnjs · 10 months ago
interoperable*
winkle · 10 months ago
In what ways is the agents.json file different from an OpenAPI Arazzo specification? Is it more native for LLM use? Looking at the example, I'm seeing similar concepts between them.
yompal · 10 months ago
We've been in touch with Arazzo after we learned of the similarities. The long-term goal is to be aligned with Arazzo. However, the tooling around Arazzo isn't there today and we think it might take a while. agents.json is meant to be more native to LLMs, since Arazzo serves other use cases than LLMs.

To be more specific, we're planning to support multiple types of sources alongside REST APIs, like internal SDKs, GraphQL, gRPC, etc.

winkle · 10 months ago
Thanks, that's helpful. I agree there are many other sources REST APIs where this would be helpful. Outside of that I would be interested in understanding the ways where Arazzo takes a broader approach and doesn't really fit an LLM use case.
melvinmelih · 10 months ago
This is interesting but why do you make it so hard to view the actual agents.json file? After clicking around in the registry (https://wild-card.ai/registry) for 10 minutes I still haven't found one example.
yompal · 10 months ago
That's a good point. I'll add a download button to the registry. The agents.json are also available here https://github.com/wild-card-ai/agents-json/tree/master/agen...

EDIT: updated

melvinmelih · 10 months ago
Great, thanks!
pritambarhate · 10 months ago
yompal · 10 months ago
Yup. The specification is under Apache 2.0 and the Python package is under AGPL.

The full licenses can be found here: https://docs.wild-card.ai/about/licenses

cruffle_duffle · 10 months ago
AGPL is a great way to prevent people from adopting it.
bberenberg · 10 months ago
Cool idea but seems to be dead on arrival due to licensing. Would love to have the team explain how anyone can possibly adopt their agpl package into their product.
yompal · 10 months ago
A couple people have mentioned some relevant things in this thread. This SDK isn't meant to be restrictive. This can be implemented into other open-source frameworks as a plugin(ie. BrowserUse, Mastra, LangChain, CrewAI, ...). We just don't want someone like AWS flip this into a proxy service.

Some have asked us to host a version of the agents.json SDK. We're torn on this because we want to make it easier for people to develop with agents.json but acting as a proxy isn't appealing to us and many of the developers we've talked to.

That said, what do you think is the right license for something like this? This is our first time doing OSS.

Onawa · 10 months ago
favorited · 10 months ago
Sounds like the spec is Apache 2.0. The Python package is AGPLv3, but the vast majority of the code in there looks to be codegen from OpenAPI specs. I'd imagine someone could create their own implementation without too much headache, though I'm just making an educated guess.
froggertoaster · 10 months ago
Echoing this - is there a commericialization play you're hoping to make?
luke-stanley · 10 months ago
This could be more simple, which is a good thing, well done!

BTW I might have found a bug in the info property title in the spec: "MUST provide the title of the `agents.json` specification. This title serves as a human-readable name for the specification."

yompal · 10 months ago
It now reads "MUST provide the title of the `agents.json` specification file. ..." Thanks for the heads up!
sidhusmart · 10 months ago
How does this compare to llms.txt? I think that’s also emerging as a sort of standard to let LLMs understand APIs. I guess agents.json does a better packaging/ structural understanding of different endpoints?
yompal · 10 months ago
llms.txt is a great standard for making website content more readable to LLMs, but it doesn’t address the challenges of taking structured actions. While llms.txt helps LLMs retrieve and interpret information, agents.json enables them to execute multi-step workflows reliably.
alooPotato · 10 months ago
Can some help me understand why agents can't just use APIs documented by an openapi spec? Seems to work well in my own testing but I'm sure I'm missing something.
yompal · 10 months ago
LLMs do well with outcome-described tools and APIs are written as resource-based atomic actions. By describing an API as a collection of outcomes, LLMs don't need to re-reason each time an action needs to be taken.

Also, when an OpenAPI spec gets sufficiently big, you face a need-in-the-haystack problem https://arxiv.org/abs/2407.01437.

alooPotato · 9 months ago
This was insightful. The re-reasoning part makes sense. So basically, MCP should be a dumbed down version of your API that accomplishes a few tasks really well. It ha to be a subset of what your API could do because if it wasn't, it either end up being just as generic as your API or the combinatorial explosion of possible use cases would be too large.
thomasfromcdnjs · 10 months ago
Does anyone have any pro tips for large tool collections? (mine are getting fat)

Plan on doing a two layered system mentioned earlier, where the first layer of tool calls is as slim as they can be, then a second layer for more in depth tool documentation.

And/or chunking tools and creating embeddings and also using RAG.

ahamilton454 · 10 months ago
I can agree this is a huge problem with large APIs, we are doing it with twilios api and it’s rough