# Ask an Expert

Send a profession and a question; a ChatGPT agent answers the way that professional would.

- Page: https://perceivo.ai/examples/ask-an-expert
- JSON: https://perceivo.ai/registry/example/ask-an-expert.json
- Kind: example
- Revision: 2 (published 2026-10-19, produced 2026-10-19)
- Previous revision 1 (published 2026-10-11): https://perceivo.ai/registry/example/ask-an-expert/r1.json
- Repository: https://github.com/ConceptBuilderAI/perceivo/tree/v1.0.0/examples/orchestrations/ask-an-expert

## Validation

- SDK: rc 0 at 2026-10-19T14:34:04Z, revision 8b1e0f6ac1d9b07ec9f693eec0672e467432efe4
- Platform: rc 0 at 2026-10-12T00:08:43Z, dms bundle_validation.validation_errors+validate_component@d7eb31176, revision d7eb3117642ac5cca246060039215e64b5a439fb

## Secrets

- `OPENAI_API_KEY` (openai): The Expert agent calls ChatGPT with your key.

## Download

- ask-an-expert.zip: https://perceivoprodpublicmedia.blob.core.windows.net/media/packages/ask-an-expert/r4/ask-an-expert.zip
  sha256 c47d9cf942741123a488108972ab75d43d636403d89be2ffd92e596a60106cf5

## Packages

- Ask an Expert (orchestration, ask-an-expert.cborchestration.json): https://perceivoprodpublicmedia.blob.core.windows.net/media/packages/ask-an-expert/r2/ask-an-expert.cborchestration.json
  sha256 13311d3f4b5872ba692dff921807425789062fe4af20327415f7749ba6fb62c5

## At home

1. Download the example folder and open a terminal in it.

2. Install the Perceivo SDK and Jupyter.

```sh
pip install "perceivo==1.0.0" notebook
```

3. Put your OpenAI API key in OPENAI_API_KEY (PowerShell: $env:OPENAI_API_KEY = "<your key>").

```sh
export OPENAI_API_KEY=<your key>
```

4. Open the notebook and run the cells top to bottom.

```sh
jupyter notebook run.ipynb
```

## Command line

1. Install the Perceivo SDK.

```sh
pip install "perceivo==1.0.0"
```

2. Get the examples and open this one.

```sh
git clone --branch v1.0.0 --depth 1 https://github.com/ConceptBuilderAI/perceivo.git && cd perceivo/examples/orchestrations/ask-an-expert
```

3. Put your OpenAI API key in OPENAI_API_KEY (PowerShell: $env:OPENAI_API_KEY = "<your key>").

```sh
export OPENAI_API_KEY=<your key>
```

4. Check the orchestration and its components.

```sh
perceivo validate orchestration .
```

5. Run it with the sample request.

```sh
perceivo run orchestration . --input-file input.json
```

## Transcript

[0:00] Perceivo Examples: Ask an Expert
[0:06] In this short video, we're going to look at Ask an Expert.
[0:09] It's a simple, three-component orchestration that takes two strings: a question, and a profession.
[0:16] The agent component takes that question and changes the prompt, so the chat model answers like someone in that profession.
[0:23] We're also going to return the response as a conversation log entry, so we can see the answer without digging through the logs.
[0:31] This is a pretty basic orchestration, but don't forget to bind your secret before you try to run it.
[0:37] This agent is looking for an OpenAI API key.
[0:41] We just happen to have one.
[0:43] And if you're doing this in the SDK, you declare the secret in the agent's YAML,
[0:48] read it in your code with perceivo.secrets.get,
[0:52] and on your machine, it comes from an environment variable, or your .env file, with that same name.
[0:58] On the platform, binding does the matching for you.
[1:03] The expert calls OpenAI's API, so your organization also needs an outbound route to api.openai.com.
[1:11] To check, go to Security, then Access Control, then Outbound.
[1:16] Here's the route for api.openai.com.
[1:19] If yours isn't there, click Add Route, and enter the host, port 443, and HTTPS.
[1:27] Routes belong to your whole organization, so you only add each one once.
[1:32] Now let's run it, and see what happens.
[1:35] I'm going to ask why bridges have expansion joints.
[1:39] And I think I'd like my answer from a structural engineer.
[1:42] OK, let's give it a try.
[1:44] This is a pretty quick orchestration... and there we go. All finished.
[1:52] The panel on the right of the runner has a few tabs.
[1:56] Click on Conversation, and there's our entry.
[1:59] Bridges have expansion joints to handle natural movement. Perfect!
[2:05] We also pass the response to the end component, and its snapshot in the logs shows the same answer.
[2:12] Like all the examples, you can find the source code in our open-source SDK repository on GitHub.
