- Creating your first agent
- Example: Creating an agent for comprehensive price target analysis
- Monitoring agent status
- Retrieving agent output
- Example: Processing different output types
- Managing your agents
- Getting a specific agent
- Example: Finding an agent by ID
- Viewing all your agents
- Example: Finding agents by pattern matching
- Next steps
Create and manage agents (Deprecated)
Alfa agents are the core building blocks of your AI-powered workflow. In this guide, we’ll walk through the complete lifecycle of an agent using our API - from creation to retrieving results.
Creating your first agent
Creating an agent is simple - you just need to provide a clear prompt that describes what you want the agent to do.
For complex analyses, you can include placeholders like {doc} in your prompt to reference custom documents. See our Custom Documents guide for details.
Example: Creating an agent for comprehensive price target analysis
Monitoring agent status
After creating an agent, it will start processing your request in the background. You can check its status to know when it’s done.
The agent can be in one of the following states:
NOT_STARTED: The agent has been created but hasn’t begun processingRUNNING: The agent is actively working on your requestCOMPLETE: The agent has finished successfullyERROR: The agent encountered an error during processingCANCELLED: The processing was stopped before completionNO_RESULTS_FOUND: The agent completed but couldn’t find relevant results
Retrieving agent output
Once your agent has completed its work, you can retrieve the output.
Agent outputs can be of different types:
text: Plain text analysis and explanationstable: Structured data in tabular formatgraph: Visual representation of data as a line, bar, or pie chart
Example: Processing different output types
Managing your agents
Getting a specific agent
To retrieve basic details about a specific agent:
Example: Finding an agent by ID
Viewing all your agents
To get a list of all agents you’ve created and their basic details:
Example: Finding agents by pattern matching
Next steps
Now that you understand how to create and manage agents, you can:
- Learn how to schedule and automate your agents to run on a custom schedule
- Explore using custom documents with your agents
For production systems, always implement proper error handling and consider using exponential backoff for status polling to avoid rate limiting.
