diff --git a/docs/core-components-2.md b/docs/core-components-2.md deleted file mode 100644 index 2c63f56977..0000000000 --- a/docs/core-components-2.md +++ /dev/null @@ -1,72 +0,0 @@ -The AEA framework consists of several core components, some required to run an AEA and others optional. - -In Core Components - Part 1 we described the common components each AEA uses. In this page, we will look at more advanced components. - -## Required components used by AEAs - -### Decision Maker - -Decision Maker of an AEA - -The `DecisionMaker` can be thought of as a `Wallet` manager plus "economic brain" of the AEA. It is responsible for the AEA's crypto-economic security and goal management, and it contains the preference and ownership representation of the AEA. The decision maker is the only component with access to the `Wallet`'s private keys. - -You can learn more about the decision maker here. In its simplest form, the decision maker acts like a `Wallet` with `Handler` to react to messages it receives from the skills. - -### Wallet - -The `Wallet` contains the private-public key pairs used by the AEA. Skills do not have access to the wallet, only the decision maker does. - -The agent has two sets of private keys, as configured in the `aea-config.yaml`: - -- `private_key_paths`: This is a dictionary mapping identifiers to the file paths of private keys used in the AEA. For each identifier, e.g. `fetchai`, the AEA can have one private key. The private keys listed here are available in the `Decision Maker` and the associated public keys and addresses are available in all skills. The AEA uses these keys to sign transactions and messages. These keys usually hold the AEAs funds. -- `connection_private_key_paths`: This is a dictionary mapping identifiers to the file paths of private keys used in connections. For each identifier, e.g. `fetchai`, the `Multiplexer` can have one private key. The private keys listed here are available in the connections. The connections use these keys to secure message transport, for instance. - -It is the responsibility of the AEA's user to safe-guard the keys used and ensure that keys are only used in a single AEA. Using the same key across different AEAs will lead to various failure modes. - -Private keys can be encrypted at rest. The CLI commands used for interacting with the wallet allow specifying a password for encryption/decryption. - -### Identity - -The `Identity` is an abstraction that represents the identity of an AEA in the Open Economic Framework, backed by public-key cryptography. It contains the AEA's addresses as well as its name. - -The identity can be accessed in a `Skill` via the `AgentContext`. - -## Optional components used by AEAs - -### Contracts - -Contracts of an AEA - -`Contracts` wrap smart contracts for third-party decentralized ledgers. In particular, they provide wrappers around the API or ABI of a smart contract. They expose an API to abstract implementation specifics of the ABI from the `Skills`. - -`Contracts` usually contain the logic to create contract transactions and make contract calls. - -`Contracts` can be added as packages. For more details on `Contracts` also read the `Contract` guide here. - -## Putting it together - -Taken together, the core components from this section and the first part provide the following simplified illustration of an AEA: - -Simplified illustration of an AEA - -## Next steps - -### Recommended - -We recommend you continue with the next step in the 'Getting Started' series: - -- How AEAs talk to each other - Interaction protocols - -### Relevant deep-dives - -Understanding the decision maker is vital to developing a goal oriented and crypto-economically safe AEA. You can learn more about the `DecisionMaker` in the following section: - -- Decision Maker - - -Understanding `Contracts` is important when developing AEAs that make commitments or use smart contracts for other purposes. You can learn more about the `Contracts` agents use in the following section: - -- Contracts - - -
diff --git a/docs/index.md b/docs/index.md deleted file mode 100644 index f852eab46f..0000000000 --- a/docs/index.md +++ /dev/null @@ -1,62 +0,0 @@ - -The AEA framework provides the tools for creating Autonomous Economic Agents (AEA). - -## What are AEAs? - -We define an autonomous economic agent or AEA as: - -> An intelligent agent acting on an owner's behalf, with limited or no interference, and whose goal is to generate economic value for its owner. - - - -An AEA represents an individual, organisation or object and looks after its interests. AEAs act independently of constant input from their owner and autonomously execute actions to achieve their prescribed goals. Their purpose is to create economic value for you, their owner, in clearly defined domains. AEAs have a wide range of application areas and we provide demo guides to highlight examples of their use cases. - -### What is not an AEA - -* Any agent: AEAs' purpose is to generate economic value in a multi-stakeholder environment with competing incentives between agents. They represent humans, organisations or objects. -* APIs or sensors which do not have agency. -* Smart contracts which do not display any proactiveness and are purely reactive to external requests (=contract calls and transactions). -* Artificial General Intelligence (AGI). AEAs can have a very narrow, goal directed focus involving some economic gain and can have a very simple logic. - -
-

Note

-

In the rest of the documentation, unless specified otherwise, we use the terms AEA and agent interchangeably to refer to AEA as defined above.

-
- -## What is the AEA Framework? - -The AEA framework is a development suite, currently implemented in Python, which equips you with an efficient and accessible set of tools for building and running AEAs. The framework is modular, extensible, and composable. It attempts to make agent development as straightforward an experience as possible, similar to web development using popular web frameworks. - -AEAs achieve their goals with the help of a search & discovery service for AEAs -- the simple Open Economic Framework (sOEF) -- a decentralized agent communication system -- the Agent Communication Network (ACN) -- and using Fetch.ai's blockchain as a financial settlement and commitment layer. AEAs can also be integrated with third-party blockchains, such as Ethereum. - - -## Why build with the AEA Framework? - -The AEA framework provides the developer with a number of features, which combined cannot be found anywhere else: - -* The peer-to-peer agent communication network (ACN) allows your AEAs to interact with all other AEAs over the public internet. -* The search and discovery system sOEF allows your AEAs to find other AEAs. -* The AEA registry enables code sharing and re-use by providing a space in which AEAs or their individual components may be shared. -* The framework's crypto and ledger APIs make it possible for AEAs to interact with blockchains. -* The contract packages enable AEAs to interact with smart contracts in Fetch.ai and other third-party decentralised ledgers. - - -## Next steps - -To get started developing your own AEA, check out the getting started section. - -To learn more about some of the distinctive characteristics of agent-oriented development, check out the guide on agent-oriented development. - -If you would like to develop an AEA in a language different to Python then check out our language agnostic AEA definition. - -If you want to run a demo, check out the demo guides. - - -## Help us improve - -
-

Note

-

This developer documentation is a work in progress. If you spot any errors please open an issue on Github or contact us in the developer Discord channel.

-
- -
diff --git a/docs/core-components-1.md b/docs/introduction/core-concepts/core-components.md similarity index 70% rename from docs/core-components-1.md rename to docs/introduction/core-concepts/core-components.md index 2ded1b513d..45fcc542bd 100644 --- a/docs/core-components-1.md +++ b/docs/introduction/core-concepts/core-components.md @@ -1,13 +1,9 @@ -The AEA framework consists of several core components, some required to run an AEA and others optional. +The AEA framework consists of several core components. The following sections discuss the inner workings of the AEA framework and how it calls the code in custom packages (see inversion of control and a helpful comparison here). Whilst it is in principle possible to use parts of the framework as a library, we do not recommend it. -## The elements each AEA uses - ### Envelope -Envelope of an AEA - `AEA` objects communicate asynchronously via `Envelopes`. An `Envelope` is the core object with which agents communicate. It is a vehicle for `Messages` with five attributes: @@ -36,7 +32,7 @@ An `Envelope` is the core object The framework provides one default `Protocol`, called `default` (current version `fetchai/default:1.1.6`). This `Protocol` provides a bare-bones implementation for an AEA `Protocol` which includes a `DefaultMessage` class and associated `DefaultSerializer` and `DefaultDialogue` classes. -Additional `Protocols`, for new types of interactions, can be added as packages. For more details on `Protocols` you can read the protocol guide. To learn how you can easily automate protocol definition, head to the guide for the protocol generator. +Additional `Protocols`, for new types of interactions, can be added as packages. For more details on `Protocols` you can read the protocol guide. To learn how you can easily automate protocol definition, head to the guide for the protocol generator. [ADD LINK] Protocol specific `Messages`, wrapped in `Envelopes`, are sent and received to other agents, agent components and services via `Connections`. @@ -46,22 +42,18 @@ A `Connection` wraps an The framework provides one default `Connection`, called `stub` (current version `fetchai/stub:0.21.2`). It implements an I/O reader and writer to send `Messages` to the agent from a local file. -Additional `Connections` can be added as packages. For more details on `Connections` read the `Connection` guide . +Additional `Connections` can be added as packages. For more details on `Connections` read the `Connection` guide . [ADD LINK] An AEA runs and manages `Connections` via a `Multiplexer`. ### Multiplexer -Multiplexer of an AEA - The `Multiplexer` is responsible for maintaining (potentially multiple) `Connections`. It maintains an `InBox` and `OutBox`, which are, respectively, queues for incoming and outgoing `Envelopes` from the perspective of `Skills`. ### Skill -Skills of an AEA - `Skills` are the core focus of the framework's extensibility as they implement business logic to deliver economic value for the AEA. They are self-contained capabilities that AEAs can dynamically take on board, in order to expand their effectiveness in different situations. A `Skill` encapsulates implementations of the three abstract base classes `Handler`, `Behaviour`, `Model`, and is closely related with the abstract base class `Task`: @@ -77,7 +69,7 @@ For instance, an AEA which is trading goods, could subscribe to more than one `S The framework places no limits on the complexity of `Skills`. They can implement simple (e.g. `if-this-then-that`) logic or be complex (e.g. a deep learning model or reinforcement learning agent). -The framework provides one default `Skill`, called `error`. Additional `Skills` can be added as packages. For more details on `Skills` head over to the `Skill` guide . +The framework provides one default `Skill`, called `error`. Additional `Skills` can be added as packages. For more details on `Skills` head over to the `Skill` guide . [ADD LINK] ### Agent loop @@ -89,29 +81,41 @@ The `AgentLoop` performs a The `AgentLoop` and `Multiplexer` are decoupled via the `InBox` and `OutBox`, and both are maintained by the `Runtime`. -## Next steps +### Decision Maker + +The `DecisionMaker` can be thought of as a `Wallet` manager plus "economic brain" of the AEA. It is responsible for the AEA's crypto-economic security and goal management, and it contains the preference and ownership representation of the AEA. The decision maker is the only component with access to the `Wallet`'s private keys. + +You can learn more about the decision maker here. In its simplest form, the decision maker acts like a `Wallet` with `Handler` to react to messages it receives from the skills. + +### Wallet + +The `Wallet` contains the private-public key pairs used by the AEA. Skills do not have access to the wallet, only the decision maker does. + +The agent has two sets of private keys, as configured in the `aea-config.yaml`: -### Recommended +- `private_key_paths`: This is a dictionary mapping identifiers to the file paths of private keys used in the AEA. For each identifier, e.g. `fetchai`, the AEA can have one private key. The private keys listed here are available in the `Decision Maker` and the associated public keys and addresses are available in all skills. The AEA uses these keys to sign transactions and messages. These keys usually hold the AEAs funds. +- `connection_private_key_paths`: This is a dictionary mapping identifiers to the file paths of private keys used in connections. For each identifier, e.g. `fetchai`, the `Multiplexer` can have one private key. The private keys listed here are available in the connections. The connections use these keys to secure message transport, for instance. -We recommend you continue with the next step in the 'Getting Started' series: +!!! warning -- AEA and web frameworks + It is the responsibility of the AEA's user to safeguard the keys used and ensure that keys are only used in a single AEA. Using the same key across different AEAs will lead to various failure modes. -### Relevant deep-dives +Private keys can be encrypted at rest. The CLI commands used for interacting with the wallet allow specifying a password for encryption/decryption. -Most AEA development focuses on developing the `Skills` and `Protocols` necessary for an AEA to deliver against its economic objectives. +### Identity -Understanding `Protocols` is core to developing your own agent. You can learn more about the `Protocols` agents use to communicate with each other and how they are created in the following section: +The `Identity` is an abstraction that represents the identity of an AEA in the Open Economic Framework, backed by public-key cryptography. It contains the AEA's addresses as well as its name. -- Protocols +The identity can be accessed in a `Skill` via the `AgentContext`. -Most of an AEA developer's time is spent on `Skill` development. `Skills` are the core business logic components of an AEA. Check out the following guide to learn more: +### Contracts -- Skills +`Contracts` wrap smart contracts for third-party decentralized ledgers. In particular, they provide wrappers around the API or ABI of a smart contract. They expose an API to abstract implementation specifics of the ABI from the `Skills`. -In most cases, one of the available `Connection` packages can be used. Occasionally, you might develop your own `Connection`: +`Contracts` usually contain the logic to create contract transactions and make contract calls. -- Connections +`Contracts` can be added as packages. For more details on `Contracts` also read the `Contract` guide here. -
+!!! note + Contracts are an optional element of the Framework. diff --git a/mkdocs.yml b/mkdocs.yml index 5f42ec3d1a..f3b542630c 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -13,7 +13,9 @@ theme: strict: true nav: - - Introduction: 'index.md' + - Introduction: + - AEA Framework core concepts: + - Core components: 'introduction/core-concepts/core-components.md' - Version: 'version.md' - Upgrading: 'upgrading.md' - Concepts: @@ -40,10 +42,8 @@ nav: - Weather skills: 'weather-skills.md' - Development - Beginner: - AEA quick start: 'quickstart.md' - - Core components - Part 1: 'core-components-1.md' - AEA and web frameworks: 'aea-vs-mvc.md' - Build your first skill - search & discovery: 'skill-guide.md' - - Core components - Part 2: 'core-components-2.md' - How AEAs talk to each other - interaction protocols: 'interaction-protocol.md' - Trade between two AEAs: 'generic-skills-step-by-step.md' - Development setup: 'development-setup.md'