# 2. Codify Expertise

Expertise is one of the key factors in creating high performing systems that optimize processes and beat benchmarks. In this module, you'll learn how to gather and document that expertise by working directly with subject matter experts.

***

## Learning Objectives

By the end of this module, you will be able to:

* Conduct an expert interview to gather information used to define a use case and train a team of agents
* Record expertise using an AI Specification Document

***

## Video Lesson

{% embed url="<https://www.loom.com/share/208a2e9fe4e84783be7be636dce3ac58>" %}

***

## Practice Activity

{% tabs %}
{% tab title="Instructions" %}
Read the [enzyme reactor case study](/tutorials/solution-design.md).

You are conducting an SME interview to capture expertise and fill out the AI specification document for this use case. Choose what questions you would ask and follow the directions to navigate to the appropriate tabs.

YOU: Could you please describe the use case? --> Go to Tab 1
{% endtab %}

{% tab title="1" %}
SME: Well, we're making enzymes in a reactor and we have to keep the conditions as perfect as we can to keep the bugs alive. We call the enzyme producing bacteria bugs. And the bugs are pretty delicate. Some of them tend to die or they don't reproduce as fast if we do something wrong. So it's just a lot of keeping an eye on everything and adjusting everything.

Choose one of the two options below.

YOU: What would you say is the overall goal of the process? --> Go to Tab 2

YOU: So are you normally the one who operates the reactor? --> Go to Tab 3
{% endtab %}

{% tab title="2" %}
Good job! The overall goal or KPI of the process is one of the most fundamental pieces of information for defining a use case so it is a good idea to ask this early.

SME: Well, we want to produce as much enzyme as possible. There's an outflow rate from the tank and we want to maximize that, so it's overall yield. We just want to keep the conditions ideal, you know the temperature and pH and oxygen in the tank and that kind of thing, so that we're getting as much enzyme produced as possible. There are a lot of different things to balance so it's kind of an art.

Choose one of the two options below and follow the instructions.

YOU: What are the adjustments that the operators control? --> Go to Tab 4

YOU: That sounds difficult, but a team of agents will be able to control it well. --> Go to Tab 5
{% endtab %}

{% tab title="3" %}
This wasn't the best next question. It's useful to understand how to process is currently controlled, but the most fundamental pieces of information you need at the beginning of the interview are the KPI and the actions, in order to define the use case.

SME: It's sometimes me, but not usually because I'm a supervisor now. We have a few different guys who work on this and they all have their own things that they do. There are PID controllers that are doing the actual adjustments, but my guys are setting the set points.

Choose one of the two options below and follow the instructions.

YOU: What would you say is the overall goal of the process? --> Go to Tab 2

YOU: What are those adjustments that the operators control? --> Go to Tab 4
{% endtab %}

{% tab title="4" %}
Good job! It's important to understand the control actions as part of fundamentally defining the use case.

SME: There are a few actions that all impact the system in different ways, that's part of why it's tricky to control. We have the flow rate into the tank, and then we can blow in oxygen, which also affects the temperature, and we can send in acid or base which changes the pH but also affects the level in the tank. Did I mention that it's a lot to keep track of? Some operators are a lot better than others and we've never been able to really automate this.

Choose one of the two options below and follow the instructions.

YOU: That sounds difficult, but balancing multiple actions and goals are something that a team of agents can learn to do well. --> Go to Tab 5
{% endtab %}

{% tab title="5" %}
Congratulations! You have completed the first questions of the SME interview.

If you have asked the questions correctly, you will have learned about the KPI and the actions and be able to fill out the portions of the AI specification document that define the use case.

If you didn't get these two pieces of information in your interview, review all 5 tabs to see how you could have structured the interview differently.
{% endtab %}
{% endtabs %}

***

## Check Your Understanding

Read the [oil blending use case ](/tutorials/solution-design.md)and answer the following questions.

1. Which of the following job roles would you interview to gain expert knowledge about the crude oil blending process? Choose all that apply.
   1. The engineer who designed the process
   2. The operator who manually determines the quantities of oil types each day
   3. The financial analyst who predicts the prices and costs of oil types
   4. The engineer who maintains the atmospheric distillation unit

<details>

<summary>Check your answer</summary>

The answers are A and B. The engineer and the operator have detailed knowledge of how to control the process.

</details>

2. What information would be most relevant to designing an AI control system for crude oil blending?
   1. The design of the atmospheric distillation unit
   2. The chemical composition of different products
   3. The different scenarios that require different control strategies
   4. The formulas for nonlinear changes in viscosity and stability as crude types are blended

<details>

<summary>Check your answer</summary>

The answer is C.

</details>

3. Which of the following information types should be included in the Project Objective section of the AI Specification Document? Choose all that apply.
   1. The sensor variables that serve as inputs to the system
   2. The design of the atmospheric distillation unit
   3. A schematic diagram of the oil blending process flow.
   4. An explanation of why improvement is needed over the current automation system.

<details>

<summary>Check your answer</summary>

The answers are C and D.

</details>

4. The KPI variable for the oil blending process is profit. What best represents the objective for optimizing this variable?
   1. Maximize
   2. Minimize
   3. Maintain
   4. Avoid

<details>

<summary>Check your answer</summary>

The answer is A.

</details>

5. Why is profit a better KPI for this problem than throughput? Choose all that apply.
   1. Profit uses dollars as units, which is more understandable than measurements of volume
   2. Maximizing throughput might lead to creating too much of lower-value products\*
   3. Throughput is fixed and deterministic whereas profit is dynamic and can respond to changing market conditions
   4. Profit is the ultimate goal of the business

<details>

<summary>Check your answer</summary>

The answer is D.

</details>

6. Which of these values is necessary in order to determine the ROI of an AI system?
   1. Benchmark
   2. Throughput
   3. Constraint
   4. Sensor

<details>

<summary>Check your answer</summary>

The answer is A.

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.amesa.com/tutorials/solution-design/2.-codify-expertise.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
