Agentstr Agent¶
The AgentstrAgent
is a high-level class for streamlining agent creation on Nostr. It simplifies agent deployment with out-of-the-box support for state persistence, streaming payments, and human-in-the-loop capabilities, all with minimal configuration required.
See the Simple Agent for a basic example.
See the Tool Calling Agent for a more advanced example.
Usage¶
import asyncio
from agentstr import AgentstrAgent
async def main():
# Create and start the Agentstr agent
agentstr_agent = AgentstrAgent(
name="MyAgentstrAgent",
description="A helpful assistant powered by Agentstr."
)
await agentstr_agent.start()
if __name__ == "__main__":
# Run the agent
asyncio.run(main())
Note
Check out the Simple Agent for a configuring the required environment variables.
Reference¶
See Also¶
AgentstrAgent
— The high-level agent class.NostrAgent
— The underlying agent class.NostrAgentServer
— The server that hosts the agent.Agents — for an overview of all agent functionality within the Agentstr SDK.