# Serve and embed (/use-cases/deep-research/serve-and-embed)



Serve the research workflow with AgentOS to make it available to Slack, scheduled jobs, dashboards, and backend services. Register the individual analysts, research teams, and workflow in one runtime.

These are composition examples adapted from the [Investment Team application](https://github.com/agno-agi/investment-team). Follow its [clone, database, credentials, and research-loading setup](https://github.com/agno-agi/investment-team#quick-start) for a complete application. Its [`agents/`](https://github.com/agno-agi/investment-team/tree/main/agents), [`teams/`](https://github.com/agno-agi/investment-team/tree/main/teams), and [`workflows/`](https://github.com/agno-agi/investment-team/tree/main/workflows) define the components referenced here; [`agents/settings.py`](https://github.com/agno-agi/investment-team/blob/main/agents/settings.py) supplies shared knowledge and paths.

Import those components into your application module, or define your own before composing them. The application uses Gemini; the OpenAI variants on these pages require `uv pip install "agno[openai]"` and `OPENAI_API_KEY` as well. Shared knowledge/storage still needs the application's database and embedding-provider setup. Prose context, analyst-output variables, and local archives must be supplied by your application.

```python
from agno.os import AgentOS
from db import get_postgres_db  # Investment Team application helper

agent_os = AgentOS(
    db=get_postgres_db(),
    agents=[market_analyst, financial_analyst, risk_officer, committee_chair],
    teams=[coordinate_team, broadcast_team],
    workflows=[investment_workflow],
)
app = agent_os.get_app()

if __name__ == "__main__":
    agent_os.serve(app="main:app", port=8000)
```

Every registered agent, team, and workflow gets a run endpoint. Sessions are served from a shared `/sessions` router, filterable by component and session type. A surface calls the workflow for the auditable review or a team for an open-ended question, with the same request shape.

```bash
curl -X POST http://localhost:8000/workflows/investment-workflow/runs \
  -F 'message=Run a full review on NVDA' \
  -F 'user_id=pm@fund.com' \
  -F 'session_id=q4-review' \
  -F 'stream=false'
```

## Delivery surfaces [#delivery-surfaces]

| Surface          | Shape                                                                        |
| ---------------- | ---------------------------------------------------------------------------- |
| Slack channel    | An analyst asks "review NVDA"; the pipeline replies in-thread with the memo  |
| Scheduled review | A cron runs the workflow nightly on a watchlist and posts the decisions      |
| Dashboard        | A widget triggers a review and renders the structured decision               |
| Backend gate     | A pipeline calls the workflow before a position changes and blocks on a PASS |

[Customer-facing agents](/use-cases/product-agents/serve-as-an-api), [data agents](/use-cases/data-agents/serve-and-embed), and research systems use the same AgentOS run endpoints. Each surface selects the registered component that matches the request.

## Choose an entry point [#choose-an-entry-point]

| Caller wants                   | Hit                                                              |
| ------------------------------ | ---------------------------------------------------------------- |
| The decision of record         | The `Workflow` (explicit control flow, inspectable step results) |
| An open-ended question         | A coordinate `Team`                                              |
| An independent multi-view read | A broadcast `Team`                                               |

One AgentOS exposes all three. The surface chooses the shape per request.

## Scheduled research [#scheduled-research]

Use an AgentOS schedule to run a watchlist review at a fixed interval. Each run produces the workflow's memos and decisions for the team.

AgentOS ships the scheduler. Keep the explicit `db` on the AgentOS instance above, install `uv pip install "agno[os,postgres]"`, and add `scheduler=True` to that constructor. The scheduler starts only when AgentOS has a database; component databases alone do not configure it. Start the app and register a cron against the workflow's run endpoint with `ScheduleManager`. See [Scheduling](/features/scheduling).

## Next steps [#next-steps]

| Task                           | Guide                                              |
| ------------------------------ | -------------------------------------------------- |
| Add Slack or a browser surface | [Interfaces](/use-cases/product-agents/interfaces) |
| Lock down the endpoints        | [Security and auth](/features/security-and-auth)   |

## Developer Resources [#developer-resources]

* [Serve as an API](/features/api)
* [AgentOS cookbook](https://github.com/agno-agi/agno/tree/main/cookbook/05_agent_os)
* [Scheduling](/features/scheduling)
