Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FS-101 Add report director #31

Merged
merged 2 commits into from
Nov 26, 2024
Merged

FS-101 Add report director #31

merged 2 commits into from
Nov 26, 2024

Conversation

mic-smith
Copy link
Collaborator

Description

Create Report Director to handle file uploads

Changelog

  • Move file_upload_service to file_utils
  • Add report director which uses fle_utils and returns hardcode report string


update_scratchpad(result=file["content"])

report = "#Report on upload as markdown" # await report_agent.invoke(file["content"])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering if the director should be responsible for storing the report in the scratchpad, or if the agent should be doing it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably the director, though I don't think we have any reason to be using the scratch pad, so it's tempting to just remove completely for now.

Copy link
Collaborator

@IMladjenovic IMladjenovic Nov 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In terms of director vs Report Agent adding results to the scratchpad, I would lean towards the director doing this as aligns closer with the approach taken by the Chat Director and Chat Supervisor. The Chat Supervisor calls out to various agents to perform tasks and then analyses how good there responses are before accepting them and putting them on the scratch pad. This makes sense on the "Chat Flow" side because we are verifying Infer's abililty to respond to a question. On the "Report Flow" side of things, this doesn't really matter as much because there isn't any ambiguity in what we are doing, we have a clear intention to complete for the user with an orchestrated flow.

But, with the Chat Flow in mind, I'd be keen for the Report Director to work in a similar way and update the scratch pad itself. We don't currently plan to have a Report Supervisor because the flow is so straightforward, but if we begin to have more variables in this report creation process we may require a Report Supervisor to manage the preparation of data needed by the Report Agent to create the Report.

I don't mind whether we put the file on the scratch pad or not at the moment, but I would keep it in for now as we should hopefully be aiming towards introducing a "Sustainability Materiality Matrix" to the report creation. This will focus the report agent on the most important sustainability areas for that company that the report agent should focus on.
(The materiality matrix will look something like this: https://sasb.ifrs.org/wp-content/uploads/2021/11/MMap-2021.png but not SASB until we can establish a license to use it)

If we add this Matrix Agent then the flow will look like:

  1. Report Director puts the the file on the scratch pad
  2. Report Director calls the Materiality Agent to align the company to a industry and sector within that industry and then add the relevant materiality matrix onto the scratch pad
  3. Report Director calls the Report Agent. Report Agent knows that all the info it needs to create a report on the scratch pad.
  4. Report Agent creates report and returns to director who sends the report to the UI

Late note:
As the scratchpad gets cleared after each call, I think we will add the Report as part of the intent agent prompt along with the chat history.

@@ -0,0 +1,21 @@

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do we think about moving this into a src/directors/ folder and also add the current director.py renamed to chat_director.py as part of this ticket?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and if we rename the director, could be worth renaming the current supervisor to chat_supervisor.py

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, and renamed prompt file too to match. (director -> chat_director)


update_scratchpad(result=file["content"])

report = "#Report on upload as markdown" # await report_agent.invoke(file["content"])
Copy link
Collaborator

@IMladjenovic IMladjenovic Nov 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In terms of director vs Report Agent adding results to the scratchpad, I would lean towards the director doing this as aligns closer with the approach taken by the Chat Director and Chat Supervisor. The Chat Supervisor calls out to various agents to perform tasks and then analyses how good there responses are before accepting them and putting them on the scratch pad. This makes sense on the "Chat Flow" side because we are verifying Infer's abililty to respond to a question. On the "Report Flow" side of things, this doesn't really matter as much because there isn't any ambiguity in what we are doing, we have a clear intention to complete for the user with an orchestrated flow.

But, with the Chat Flow in mind, I'd be keen for the Report Director to work in a similar way and update the scratch pad itself. We don't currently plan to have a Report Supervisor because the flow is so straightforward, but if we begin to have more variables in this report creation process we may require a Report Supervisor to manage the preparation of data needed by the Report Agent to create the Report.

I don't mind whether we put the file on the scratch pad or not at the moment, but I would keep it in for now as we should hopefully be aiming towards introducing a "Sustainability Materiality Matrix" to the report creation. This will focus the report agent on the most important sustainability areas for that company that the report agent should focus on.
(The materiality matrix will look something like this: https://sasb.ifrs.org/wp-content/uploads/2021/11/MMap-2021.png but not SASB until we can establish a license to use it)

If we add this Matrix Agent then the flow will look like:

  1. Report Director puts the the file on the scratch pad
  2. Report Director calls the Materiality Agent to align the company to a industry and sector within that industry and then add the relevant materiality matrix onto the scratch pad
  3. Report Director calls the Report Agent. Report Agent knows that all the info it needs to create a report on the scratch pad.
  4. Report Agent creates report and returns to director who sends the report to the UI

Late note:
As the scratchpad gets cleared after each call, I think we will add the Report as part of the intent agent prompt along with the chat history.

@mic-smith mic-smith force-pushed the FS-101/report-director branch from 846cab6 to afd229b Compare November 25, 2024 16:42

update_scratchpad(result=file["content"])

report = "#Report on upload as markdown" # await report_agent.invoke(file["content"])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we supposed to have this bit of commented out code?
and i this report just a placeholder or something? what is it used for

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is the part where we will plug in the report agent once it's complete. For now, it just returns some placeholder markdown

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is just a sample response and to show where the report agent will be integrated. The placeholder report isn't used by anything yet.

@mic-smith mic-smith merged commit 4f0db2f into main Nov 26, 2024
4 checks passed
@mic-smith mic-smith deleted the FS-101/report-director branch November 26, 2024 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants