Skip to main content
Agent Stack is an open platform to help you discover, run, and compose AI agents from any framework. This tutorial demonstrates how to consume agents from the Agent Stack and expose agents built in BeeAI Framework to the Agent Stack. Prerequisites
  • Agent Stack installed and running locally
  • BeeAI Framework installed with pip install beeai-framework[agentstack]

Consuming from the platform (client)

The AgentStackAgent class allows you to connect to any agent hosted on the Agent Stack. This means that you can interact with agents built from any framework! Use AgentStackAgent when:
  • You’re connecting specifically to the Agent Stack services.
  • You want forward compatibility for the Agent Stack, no matter which protocol it is based on.
Here’s a simple example that uses the built-in chat agent:
Usage in Workflow You can compose multiple Agent Stack agents into advanced workflows using the BeeAI framework’s workflow capabilities. This example demonstrates a research and content creation pipeline: In this example, the GPT Researcher agent researches a topic, and the Podcast creator takes the research report and produces a podcast transcript. You can adjust or expand this pattern to orchestrate more complex multi-agent workflows.
Python
Use agent from the remote Agent Stack If you want to integrate an agent from a remote server with authorization, you must first obtain a JWT auth token, and then create a remote agent and set its required parameters.
Python
or create a custom client:
Python

Exposing to the platform (server)

The AgentStackServer class exposes an agent or any other runnable (tool/chat model, …) to the Agent Stack. It gets automatically registered to the platform and allows you to access and use the agents directly in the platform. Key Features:
  • easy to expose (deploy) the current application to the production-ready environment
  • built-in trajectory, forms integration, LLM inference support, …
  • easy to extend and debug
Agent Stack supports only one entry per server. To register more, you need to spawn more servers.
You can use the platform to do LLM inference by using the AgentStackChatModel(...) class.

Configuration

Server The server’s behavior can be influenced via attributes listed in AgentStackServerConfig class (host, port, self registration, …). Internally the server preserves every conversation, the custom strategy can be used by implementing the base MemoryManager class.
Python
Agent The agent’s meta information is inferred from its metadata (the agent.meta property). However, this information can be overridden during agent registration. See the following example.
Python

Customization

The Agent Stack has a concept of extensions that enable access to external services and UI components via dependency injection. The framework internally uses the following extensions:
  • Form Extension: for displaying prompts and other checks (for instance when using AskPermissionRequirement)..
  • Trajectory Extension: for showing agent’s intermediate steps throughout the execution
The current entries are listed in the BaseAgentStackExtensions class.
Custom Extensions The following implementation demonstrates an agent that conducts an internet search and provides an answer to the given question, with inline citations. It does so by leveraging the Citation Extension, which is managed by the PlatformCitationMiddleware class.
Learn more about the Middleware concept.
The AgentStackContext.get() can be called from anywhere if the code is running inside the given context.

Platform RAG Agent

You can use the Vector Store Search Tool to query the platform-native vector store service and leverage the platform-provided embedding service.