---
agent:
  instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://segmentstream.com/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

# Apps and agents

A workspace app and its company agent can act on the same records with the caller’s permissions.

## Build the app

In the starter app, trace the Leads screen from app/src/app/(signed-in)/leads/ to its ontology call. Put validation and permission checks in that action. A member can then make the same permitted change from a screen or from chat. When porting an existing app, start with one screen and check both an allowed and a denied action.

[Migrate an existing app](https://segmentstream.com/docs/migrate-an-existing-app)

[ ](https://segmentstream.com/docs/migrate-an-existing-app)· [App SDK](https://segmentstream.com/docs/sdk/app)

## Configure the company agent

Define its instructions in agent/agent/instructions.md and its model and channels in agent/segmentstream.json. Try a question about a known record in the app’s signed-in chat. Compare the response with the record and inspect the action log. A production messaging channel also needs a configured connection and a way to identify its members.

The company agent as its agent/ folder declares it: the channels it is live on and whether each works, the models it uses and the deployment it runs.

[Launch and test a company agent](https://segmentstream.com/docs/launch-a-company-agent)

[ ](https://segmentstream.com/docs/launch-a-company-agent)· [Agent SDK](https://segmentstream.com/docs/sdk/agent)

[Read as Markdown ↗](https://segmentstream.com/docs/apps-and-agents.md)
