Skip to main content
Get started with Echo in 5 minutes.
1

Install

pip install echo-sdk
2

Set API Key

export OPENAI_API_KEY=sk-...
# or ANTHROPIC_API_KEY or GOOGLE_API_KEY
3

Create Agent

import asyncio
from echo import (
    GenericAgent, AgentConfig, LLMConfig,
    PersonaConfig, TaskConfig, ConversationContext,
    Message, MessageRole, TextMessage
)

# LLM configuration
llm_config = LLMConfig(
    provider="openai",
    model="gpt-4o-mini",
    temperature=0.2,
    max_tokens=2000,
)

# Agent configuration (persona + task = system prompt)
agent_config = AgentConfig(
    persona=PersonaConfig(
        role="Healthcare Assistant",
        goal="Help users with health queries",
        backstory="A knowledgeable medical AI assistant",
    ),
    task=TaskConfig(
        description="Answer health-related questions accurately",
        expected_output="Clear, helpful medical information",
    ),
)

async def main():
    agent = GenericAgent(
        agent_config=agent_config,
        llm_config=llm_config,
        tools=[],
    )

    context = ConversationContext()
    context.add_message(Message(
        role=MessageRole.USER,
        content=[TextMessage(text="What are symptoms of dehydration?")],
    ))

    result = await agent.run(context)
    print(result.llm_response.text)

asyncio.run(main())
4

Run

python my_agent.py

With Streaming

from echo import get_llm, StreamEventType

llm = get_llm(LLMConfig(provider="openai", model="gpt-4o-mini"))

async for event in llm.invoke_stream(context, system_prompt="You are helpful."):
    if event.type == StreamEventType.TEXT:
        print(event.text, end="", flush=True)
    elif event.type == StreamEventType.DONE:
        print("\n--- Done ---")

Next Steps