Your agent can leverage certain features of the platform to achieve the best possible user experience. When you yield specific content types from your agent, the BeeAI platform automatically renders them with appropriate visual representations.

Markdown Support

When you yield text content, the BeeAI platform automatically renders it as Markdown, providing rich formatting capabilities.
yield "This text can be **bold** or _italic_"

Supported Markdown Features

  • Headers, lists, and text formatting - Create structured content with headings, bullet points, and emphasis
  • Code blocks with syntax highlighting - Display code snippets with proper syntax highlighting
  • Tables and structured data - Present data in organized table formats
  • Links and images - Include hyperlinks and visual content

File Attachments

When you yield a FilePart, the GUI renders it as an attachment to the conversation, making it easy for users to access and download files.
yield FilePart(file=FileWithUri(uri="https://www.ibm.com/us-en", mime_type="text/html", name="IBM Website"))

GUI Extensions

The BeeAI platform leverages the A2A extensions concept, which allows you to easily extend message metadata in specific formats that the GUI can render in specialized ways. GUI extensions are simple to use. You just need to inject the extension into your agent’s function signature:
import os
from typing import Annotated

from a2a.types import (
    Message,
)
from beeai_sdk.server import Server
from beeai_sdk.server.context import Context
from beeai_sdk.a2a.extensions import TrajectoryExtensionServer, TrajectoryExtensionSpec

server = Server()

@server.agent()
async def example_agent(
    input: Message, context: Context, trajectory: Annotated[TrajectoryExtensionServer, TrajectoryExtensionSpec()]
):
    """Polite agent that greets the user"""

    yield trajectory.trajectory_metadata(
        title="What did I do?",
        content="User greeted me, I should reply with a greeting.",
    )
    yield "Hello there!"


def run():
    server.run(host=os.getenv("HOST", "127.0.0.1"), port=int(os.getenv("PORT", 8000)))


if __name__ == "__main__":
    run()

Available Extensions

The BeeAI platform currently supports two types of GUI extensions:

Trajectory Visualization

The platform provides built-in trajectory visualization to show the step-by-step process of agent execution. This helps users understand how your agent processes information and makes decisions.
1

Inject the extension

Add the trajectory extension to your agent’s function signature:
from beeai_sdk.a2a.extensions import TrajectoryExtensionServer, TrajectoryExtensionSpec

@server.agent()
async def example_agent(
    input: Message, context: Context, trajectory: Annotated[TrajectoryExtensionServer, TrajectoryExtensionSpec()]
):
2

Yield trajectory metadata

Use the injected trajectory reference to yield trajectory information:
yield trajectory.trajectory_metadata(
    title="What did I do?",
    content="User greeted me, I should reply with a greeting.",
)

Sources & Citations

For agents that reference external sources, the platform provides built-in citation components that help users verify information and access source materials.
1

Inject the citation extension

Add the citation extension to your agent’s function signature:
from beeai_sdk.a2a.extensions import CitationExtensionServer, CitationExtensionSpec

@server.agent()
async def example_agent(
    input: Message, context: Context, citation: Annotated[CitationExtensionServer, CitationExtensionSpec()]
):
2

Yield citation information

Use the injected citation reference to provide source information:
yield citation.message(
    text="According to recent studies...",
    citation_start_index=0,
    citation_end_index=10,
    citation_url="https://www.ibm.com/us-en",
    citation_title="IBM Research",
    citation_description="The study from 1997 demonstrates...",
)