> ## Documentation Index
> Fetch the complete documentation index at: https://agno-v2-codex-docs-audit-20260719-0149.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Product Copilots & Agents

> Serve agents across product surfaces with shared database-backed sessions and memory.

A product agent can serve chat, inline actions, background jobs, and messaging interfaces from one AgentOS. Configure a shared database when those surfaces need the same sessions or user memories.

```python copilot.py theme={null}
from agno.agent import Agent
from agno.db.postgres import PostgresDb
from agno.models.openai import OpenAIResponses
from agno.os import AgentOS

db = PostgresDb(db_url="postgresql+psycopg://ai:ai@localhost:5532/ai")

agent = Agent(
    name="Product Copilot",
    model=OpenAIResponses(id="gpt-5.5"),
    db=db,
    add_history_to_context=True,
    num_history_runs=5,
    enable_agentic_memory=True,
)

agent_os = AgentOS(agents=[agent], db=db)
app = agent_os.get_app()

if __name__ == "__main__":
    agent_os.serve(app="copilot:app", port=7777)
```

This configuration provides an HTTP API, persistent multi-turn history, and per-user memory. Authentication is disabled until you enable it. See [Serve as an API](/use-cases/product-agents/serve-as-an-api#auth) for JWT authorization and opt-in per-user isolation.

## The mental model

The agent runs in your AgentOS as a service. Every product surface is a client that calls it over HTTP.

| Surface                                           | How it reaches the agent                                                    |
| ------------------------------------------------- | --------------------------------------------------------------------------- |
| In-app copilot panel                              | `POST /agents/{agent_id}/runs` with `user_id` and a per-thread `session_id` |
| Inline action ("summarize this", "draft a reply") | The same endpoint, a short-lived `session_id`                               |
| Slack / Telegram / WhatsApp                       | An interface adapter maps the channel onto runs and sessions                |
| Backend event (webhook, cron)                     | A custom FastAPI route calling `agent.arun(...)`                            |

Stored memory can follow a user when surfaces call the same agent with the same `user_id` and database. Session history continues only when they also reuse the same `session_id`. Messaging interfaces usually create surface-specific session IDs.

## Guided paths

| You have                        | You want                                         | Start with                                                             |
| ------------------------------- | ------------------------------------------------ | ---------------------------------------------------------------------- |
| A B2B SaaS product              | JWT authentication and opt-in per-user isolation | [Serve as an API](/use-cases/product-agents/serve-as-an-api)           |
| Users in Slack or the browser   | The same agent where they already work           | [Interfaces](/use-cases/product-agents/interfaces)                     |
| Internal docs, Drive, databases | An agent grounded in external company data       | [Connecting your data](/use-cases/product-agents/connecting-your-data) |
| Multi-day user relationships    | Memory that persists per user across surfaces    | [Sessions and memory](/use-cases/product-agents/sessions-and-memory)   |

## Explore

<CardGroup cols={2}>
  <Card title="Serve as an API" icon="server" href="/use-cases/product-agents/serve-as-an-api">
    Turn the agent into an HTTP service with streaming, sessions, and auth.
  </Card>

  <Card title="Sessions and memory" icon="clock-rotate-left" href="/use-cases/product-agents/sessions-and-memory">
    Store multi-turn history and per-user memory in the configured database.
  </Card>

  <Card title="Connecting your data" icon="plug" href="/use-cases/product-agents/connecting-your-data">
    Give the agent access to Slack, Drive, databases, and MCP servers.
  </Card>

  <Card title="Interfaces" icon="comments" href="/use-cases/product-agents/interfaces">
    Connect Slack, Telegram, WhatsApp, and browser clients through interface adapters.
  </Card>
</CardGroup>

## Developer Resources

* [Runtime overview](/features/runtime)
* [Sessions](/sessions/overview)
* [Memory](/memory/overview)
* [Scout template](/deploy/templates/scout/overview)
