# Agents, Abilities & Functions | EasyNet Docs Source: https://easynet.run/docs/aal/agents # Agents, Abilities & Functions Expose an entry point and keep implementation inside the agent. A public ability defines an externally callable capability. Private functions and skills organize internal implementation. A struct gives the result a named shape with explicit fields. ## Complete example Save the example as agents.aal agents.aal ``` struct Report score: Int verdict: String agent Tutorial is Agent private skill assessment fn verdict(score: Int) -> String effects() return if score >= 6 then "ready" else "revise" public ability run(score: Int) -> Report effects() return Report(score: score, verdict: self.assessment.verdict(score)) ``` [Download .aal](data:text/plain;charset=utf-8,struct%20Report%0A%20%20score%3A%20Int%0A%20%20verdict%3A%20String%0A%0Aagent%20Tutorial%20is%20Agent%0A%20%20private%0A%20%20%20%20skill%20assessment%0A%20%20%20%20%20%20fn%20verdict(score%3A%20Int)%20-%3E%20String%20effects()%0A%20%20%20%20%20%20%20%20return%20if%20score%20%3E%3D%206%20then%20%22ready%22%20else%20%22revise%22%0A%0A%20%20public%0A%20%20%20%20ability%20run(score%3A%20Int)%20-%3E%20Report%20effects()%0A%20%20%20%20%20%20return%20Report(score%3A%20score%2C%20verdict%3A%20self.assessment.verdict(score))%0A) ## Syntax explained Call a private skill method with self.assessment.verdict(...). Its result must satisfy the declared type. Report(...) constructs a struct with named fields. A record with the same fields is not the same nominal type. effects(...) bounds allowed effects, including indirect calls. effects() excludes thinking, memory writes and external tools. ## Build and run Terminal ``` cargo run --locked --bin aalc -- check agents.aal cargo run --locked --bin aalc -- build agents.aal -o agents.aalc cargo run --locked --bin aalc -- run agents.aalc \ --agent Tutorial --ability run \ --args '{"score":7}' \ --state-dir .aal-tutorial/agents --invocation agents-1 ``` Run with a fresh state directory. The returned value is shown below; the CLI also prints execution information. Expected result ``` {"score":7,"verdict":"ready"} ``` ## Try it yourself Set score to 4 and use a new invocation ID. Report should contain score: 4 and verdict: revise. [Language source and specification](https://github.com/Brain-Cell-Coding/Agent-Assembly-Language/blob/main/examples/research.aal)