Difference between actor vs. agent

Does anyone have a good explanation between an actor vs. agent?

Since an actor can communicate with other actors with the use of messaging, in theory, we can use actors in each canister to communicate with another actor in another canister.

If so, why would we need to use an agent?

1 Like

In the ICP ecosystem an actor is a canister/smart contract. The canisters can send messages between each other using the protocol, which is what Motoko, the Rust CDK, or other CDKs like Azle offer. An agent (instantiated through e.g. @dfinity/agent or the ic-agent crate) is used from outside of the ICP to talk to the actors/canisters using the HTTP interface described in the spec.

2 Likes