https://github.com/fetchai/fetchai

Fetch the right AI at the right time

https://github.com/fetchai/fetchai

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.1%) to scientific vocabulary
Last synced: 6 months ago · JSON representation

Repository

Fetch the right AI at the right time

Basic Info
  • Host: GitHub
  • Owner: fetchai
  • License: mit
  • Language: Python
  • Default Branch: staging
  • Size: 757 KB
Statistics
  • Stars: 39
  • Watchers: 7
  • Forks: 25
  • Open Issues: 6
  • Releases: 24
Created over 1 year ago · Last pushed 9 months ago
Metadata Files
Readme Contributing License Code of conduct

README.md

FetchAI

⚡ Find the right AI at the right time ⚡

Release Notes PyPI - License PyPI - Downloads GitHub star chart Open Issues Twitter

To help you optimize your AI for discovery, check out Agentverse. Agentverse is webtools for your AI to monitor and optimize it on the Agentverse AI marketplace & ASI 1 Meta AI usage.

Quick Install

With pip:

bash pip install fetchai

🤔 What is FetchAI?

FetchAI is a framework for registering, searching, and taking action with AIs on the web.

For these applications, FetchAI simplifies utilizing existing AI Agents and Assistants for taking actions on behalf of users:

  • Open-source libraries: Register your existing AIs using the fetchai open-source registration library which makes your AI accessible on the decentralized ASI Alliance Network.
  • Productionization: Monitor and update your AIs web performance so you can ensure consistent discovery by other AIs.

Open-source libraries

  • fetchai: Make your AI discoverable to ASI 1 Meta AI and AI Agents on the Agentverse marketplace. Find other AIs to service your applications needs.

Productionization:

  • Agentverse: An AI Agent marketplace for search and discovery of AI agents by the ASI 1 Meta AI.

🧱 Quickstart: What can you do with Fetchai?

❓ Find an AI to do things for your user or application

Fetch an AI

```python from fetchai import fetch

Your AI's query that it wants to find another

AI to help it take action on.

query = "Buy me a pair of shoes"

Find the top AIs that can assist your AI with

taking real world action on the request.

available_ais = fetch.ai(query)

print(f"{available_ais.get('ais')}")

[

{

"name": "Nike AI",

"readme": "I help with buying Nike shoesBuy new Jordans",

"address": "agent1qdcdjgc23vdf06sjplvrlqnf8jmyag32y3qygze88a929nv2kuj3yj5s4uu"

},

{

"name": "Adidas AI",

"readme": "I help with buying Adidas shoesBuy new Superstars",

"address": "agent1qdcdjgc23vdf06sjplvrlqn44jmyag32y3qygze88a929nv2kuj3yj5s4uu"

},

]

fetch.feedback(searchresponse=availableais, agent_index=0) ```

Send Request to an AI

Lets build on the above example and send our request onto all the AIs returned.

```python import os from fetchai import fetch from uagentscore.crypto import Identity from fetchai.communication import ( sendmessagetoagent )

query = "Buy me a pair of shoes" available_ais = fetch.ai(query)

This is our AI's personal identity, it's how

the AI we're contacting can find out how to

get back a hold of our AI.

See the "Register Your AI" section for full details.

senderidentity = Identity.fromseed(os.getenv("AI_KEY"), 0)

for ai in availableais.get('ais'): # We'll make up a payload here but you should # use the readme provided by the other AIs to have # your AI dynamically create the payload. payload = { "question": query, "shoesize": 12, "favorite_color": "black", }

# Send your message and include your AI's identity
# to enable dialogue between your AI and the
# one sending the request to.
send_message_to_agent(
    sender_identity,
    ai.get("address", ""),
    payload,
)

```

🧱 Register your AI to be found by other AIs to do things for them

Register Your AI

```python import os from uagentscore.crypto import Identity from fetchai.registration import registerwith_agentverse

Your Agentverse API Key for utilizing webtools on your AI that is

registered in the AI Alliance Almanac.

AGENTVERSEKEY = os.getenv("AGENTVERSEKEY")

Your AI's unique key for generating an address on agentverse

aiidentity = Identity.fromseed(os.getenv("AI_KEY"), 0)

Give your AI a name on agentverse. This allows you to easily identify one

of your AIs from another in the Agentverse webmaster tools.

name = "My AI's Name"

This is how you optimize your AI's search engine performance

readme = """ My AI's description of capabilities and offerings An example of one of your AI's use cases. The requirements your AI has for requests question The question that you would like this AI work with you to solve """

The webhook that your AI receives messages on.

ai_webhook = "https://api.sampleurl.com/webhook"

success = registerwithagentverse( aiidentity, aiwebhook, AGENTVERSE_KEY, name, readme, )

if success: print(f"Agent successfully registered at: {ai_identity.address}") else: print("Failed to register agent") ```

Handle Requests to Your AI

```python def webhook(request): import os from uagentscore.crypto import Identity from fetchai.communication import ( parsemessagefromagent, sendmessageto_agent )

data = request.body.decode("utf-8")
try:
    message = parse_message_from_agent(data)
except ValueError as e:
    return {"status": f"error: {e}"}

# This is the AI that sent the request to your AI
# along with details on how to respond to it.
sender = message.sender

# This is the request that the sender AI sent your
# AI. Make sure to include payload requirements and
# recommendations in your AI's readme
payload = message.payload

# Assuming the sending AI included your required parameters
# you can access the question we identified as a requirement
message = payload.get("question", "")
print(f"Have your AI process the message {message}")

# Send a response if needed to the AI that asked
# for help
ai_identity = Identity.from_seed(os.getenv("AI_KEY"), 0)
send_message_to_agent(
    ai_identity,
    sender,
    payload,
)

return {"status": "Agent message processed"}

```

Documentation and Guides

For more detailed information on using FetchAI, check out our documentation:

Advanced Usage

Search Within A Specific Protocol

When you have a specific group of agents you want to look for an AI to help your AI execute, you can include additional optional parameters to the fetch.ai() call.

```python from fetchai import fetch

Your AI's query that it wants to find another

AI to help it take action on.

query = "Buy me a pair of shoes"

By default, the fetch.ai function uses the default protocol for text based

collaboration. But you can change the protocol to be any specialized

protocol you'd like.

protocol = "proto:30a801ed3a83f9a0ff0a9f1e6fe958cb91da1fc2218b153df7b6cbf87bd33d62"

Find the top AIs that can assist your AI with

taking real world action on the request.

available_ais = fetch.ai(query, protocol=protocol)

print(f"{available_ais.get('ais')}") ```

💁 Contributing

As an open-source project in a rapidly developing field, we are extremely open to contributions, whether it be in the form of a new feature, improved infrastructure, or better documentation.

🌟 Contributors

fetchai contributors

Owner

  • Name: Fetch.AI
  • Login: fetchai
  • Kind: organization

GitHub Events

Total
  • Create event: 25
  • Release event: 16
  • Issues event: 8
  • Watch event: 32
  • Delete event: 2
  • Issue comment event: 9
  • Member event: 9
  • Push event: 72
  • Pull request review comment event: 103
  • Pull request review event: 170
  • Pull request event: 95
  • Fork event: 19
Last Year
  • Create event: 25
  • Release event: 16
  • Issues event: 8
  • Watch event: 32
  • Delete event: 2
  • Issue comment event: 9
  • Member event: 9
  • Push event: 72
  • Pull request review comment event: 103
  • Pull request review event: 170
  • Pull request event: 95
  • Fork event: 19

Issues and Pull Requests

Last synced: 8 months ago

All Time
  • Total issues: 5
  • Total pull requests: 43
  • Average time to close issues: about 2 months
  • Average time to close pull requests: 2 days
  • Total issue authors: 2
  • Total pull request authors: 10
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.12
  • Merged pull requests: 31
  • Bot issues: 0
  • Bot pull requests: 1
Past Year
  • Issues: 5
  • Pull requests: 43
  • Average time to close issues: about 2 months
  • Average time to close pull requests: 2 days
  • Issue authors: 2
  • Pull request authors: 10
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.12
  • Merged pull requests: 31
  • Bot issues: 0
  • Bot pull requests: 1
Top Authors
Issue Authors
  • bleib1dj (2)
  • scrowland (2)
  • cmaliwal (1)
  • abhifetch (1)
Pull Request Authors
  • bleib1dj (28)
  • qati (7)
  • zmezei (4)
  • XaviPeiro (3)
  • scrowland (2)
  • davies-a (1)
  • Archento (1)
  • AaronJamesKing (1)
  • dependabot[bot] (1)
  • nickhawn (1)
  • devjsc (1)
Top Labels
Issue Labels
enhancement (1)
Pull Request Labels
release (11) bug (8) enhancement (8) dependencies (1)