Skip to content
Merged
Show file tree
Hide file tree
Changes from 152 commits
Commits
Show all changes
153 commits
Select commit Hold shift + click to select a range
4d7fa5d
react frontend first commit
Fr4nc3 May 17, 2025
728649e
prototype components
Fr4nc3 May 17, 2025
128edcd
api services implementation
Fr4nc3 May 17, 2025
548ddfa
clean up implementation
Fr4nc3 May 19, 2025
0af3eb5
add plan page
Fr4nc3 May 28, 2025
f9943be
add steplist
Fr4nc3 May 28, 2025
35743b0
coral csa cto
Fr4nc3 May 29, 2025
134388b
add new details components and using coral layout
Fr4nc3 May 29, 2025
68b3ee2
update the tasklist
Fr4nc3 May 30, 2025
12ffa58
creating the homepage
Fr4nc3 May 30, 2025
6bae550
create task service layer to convert the api resutls
Fr4nc3 Jun 2, 2025
4658baf
update npm library remove unused tsx files
Fr4nc3 Jun 3, 2025
d215aec
add vite remoev react-scripts
Fr4nc3 Jun 3, 2025
3622ba6
Merge remote-tracking branch 'upstream/main' into feature/ui-ux-refresh
Fr4nc3 Jun 3, 2025
a034c60
remove unuse code and api call updated
Fr4nc3 Jun 4, 2025
f74aeb8
clean up api service
Fr4nc3 Jun 4, 2025
1fa5e22
homepage functionality updated
Fr4nc3 Jun 4, 2025
0d976aa
homepage working version
Fr4nc3 Jun 4, 2025
b346495
update return home page button
Fr4nc3 Jun 5, 2025
b4d690b
update homepage button back
Fr4nc3 Jun 5, 2025
32f43df
clean up left panel
Fr4nc3 Jun 5, 2025
a65686c
API call for plan page
Fr4nc3 Jun 5, 2025
a594987
update coral from enunsoo 1.0.0
Fr4nc3 Jun 6, 2025
9967321
clean up homepage
Fr4nc3 Jun 9, 2025
9a319bd
in progress docker changes
marktayl1 Jun 9, 2025
186e49d
working planpage components
Fr4nc3 Jun 9, 2025
cb6c53b
plan details configuration
Fr4nc3 Jun 9, 2025
a251bb7
loading fixed
Fr4nc3 Jun 9, 2025
91f0a3e
Plan chat inclusion
Fr4nc3 Jun 10, 2025
3dc18e3
update structure for planpage
Fr4nc3 Jun 10, 2025
9abc03d
add icon for step actions
Fr4nc3 Jun 10, 2025
14d6170
use chatinput from enunsoo
Fr4nc3 Jun 10, 2025
3c696b3
clean up app color
Fr4nc3 Jun 10, 2025
9a514e8
css review
Fr4nc3 Jun 10, 2025
8ffad16
add back button
Fr4nc3 Jun 10, 2025
7e4149e
left panel css clean up
Fr4nc3 Jun 10, 2025
c50a0ee
panel right actions css
Fr4nc3 Jun 10, 2025
f5a2f18
Update TaskService.tsx
Fr4nc3 Jun 11, 2025
d594245
button functionality
Fr4nc3 Jun 11, 2025
10cd605
enable disable chat for plan
Fr4nc3 Jun 11, 2025
8f5697c
add python requirements for frontendserver
Fr4nc3 Jun 11, 2025
3927cb5
getting the plan messages
Fr4nc3 Jun 11, 2025
74cec74
update plan clarification behavior
Fr4nc3 Jun 11, 2025
5d8b6bf
Delete README.md
Fr4nc3 Jun 11, 2025
634492e
Update PlanPanelLeft.tsx
Fr4nc3 Jun 11, 2025
71c0b4e
Update Chat.tsx
Fr4nc3 Jun 11, 2025
ff8f8a8
Update PlanChat.tsx
Fr4nc3 Jun 11, 2025
50a1ea6
Update frontend_server.py
Fr4nc3 Jun 11, 2025
4074a5e
Update TaskDetails.tsx
Fr4nc3 Jun 11, 2025
13b0f38
task details
Fr4nc3 Jun 11, 2025
ebc5660
Update PlanChat.tsx
Fr4nc3 Jun 11, 2025
a385c2e
deployment docker changes
marktayl1 Jun 11, 2025
d3ccaf3
Merge branch 'feature/ui-ux-refresh' of https://github.com/microsoft/…
marktayl1 Jun 11, 2025
d796cbf
Kickoff 🚀
Jun 12, 2025
7bd72ae
Update PlanChat.tsx
Fr4nc3 Jun 12, 2025
5b94578
clean up home
Fr4nc3 Jun 12, 2025
9005e73
toast functionality
Fr4nc3 Jun 12, 2025
b9f590a
planchanges
Fr4nc3 Jun 12, 2025
847bcf7
Merge remote-tracking branch 'upstream/ui-ux-refresh_eunsoo' into fea…
Fr4nc3 Jun 12, 2025
d5daff5
remove files
Fr4nc3 Jun 12, 2025
80595af
homeinput clean up
Fr4nc3 Jun 12, 2025
e56cc57
clean up planpanelleff
Fr4nc3 Jun 12, 2025
b4dd540
clean up taskdetails
Fr4nc3 Jun 12, 2025
35f71fb
clean up task list
Fr4nc3 Jun 12, 2025
c459ba8
Update HomeInput.tsx
Fr4nc3 Jun 12, 2025
87bf98f
functionality review to taskdetails
Fr4nc3 Jun 12, 2025
07448b1
Update HomeInput.tsx
Fr4nc3 Jun 12, 2025
938da5b
onclick behavior
Fr4nc3 Jun 12, 2025
49ba91a
add toast for the subtask behavior
Fr4nc3 Jun 12, 2025
c1259ab
progress toast updated
Fr4nc3 Jun 12, 2025
e6c4f4a
Update frontend_server.py
Fr4nc3 Jun 13, 2025
0828ecc
Update frontend_server.py
Fr4nc3 Jun 13, 2025
3842ace
plan page loading fixing process
Fr4nc3 Jun 13, 2025
9ef0ea4
add new componets from coral
Fr4nc3 Jun 13, 2025
b0bcf48
update task list
Fr4nc3 Jun 13, 2025
8c89da1
configuration for frontend python server
Fr4nc3 Jun 13, 2025
775dbac
friendly error log
Fr4nc3 Jun 13, 2025
265ca44
user login workflow
Fr4nc3 Jun 13, 2025
a8a1fce
update css for missing style
Fr4nc3 Jun 13, 2025
a0847ae
Docker fixes
marktayl1 Jun 13, 2025
fec9e01
Merge branch 'feature/ui-ux-refresh' of https://github.com/microsoft/…
marktayl1 Jun 13, 2025
b57e311
bug fixes from excel
Fr4nc3 Jun 13, 2025
60e0f39
Minor changes
Jun 13, 2025
41f8abd
hr name fixed
Fr4nc3 Jun 13, 2025
c30cfde
Merge branch 'feature/ui-ux-refresh' of https://github.com/microsoft/…
Fr4nc3 Jun 13, 2025
bbab470
Merge branch 'feature/ui-ux-refresh' into ui-ux-refresh_eunsoo
Jun 13, 2025
2fb1353
remove the dismiss button
Fr4nc3 Jun 13, 2025
4d4f874
Merge branch 'feature/ui-ux-refresh' into ui-ux-refresh_eunsoo
Jun 13, 2025
c03ce51
config with print user info
Fr4nc3 Jun 13, 2025
1719332
PlanChat.tsx updates
Jun 13, 2025
bb8424e
excel fixes
Fr4nc3 Jun 13, 2025
a9a8178
fallback user_id
Fr4nc3 Jun 13, 2025
4bf5888
Merge branch 'ui-ux-refresh_eunsoo' into feature/ui-ux-refresh
Fr4nc3 Jun 13, 2025
01943ac
conciliate changes
Fr4nc3 Jun 13, 2025
1c47291
fixing issues for the accept buttons
Fr4nc3 Jun 13, 2025
dc8cfa1
logs for debugs, and logic for the approve reject flow
Fr4nc3 Jun 13, 2025
d506511
Merge branch 'feature/ui-ux-refresh' into ui-ux-refresh_eunsoo
Jun 15, 2025
13195ac
Merge branch 'ui-ux-refresh_eunsoo' of https://github.com/microsoft/M…
Jun 15, 2025
56aec82
fix missing messages
Fr4nc3 Jun 15, 2025
6766522
fix behavior when click approve or reject
Fr4nc3 Jun 15, 2025
16f776a
update setup
Fr4nc3 Jun 15, 2025
af97365
Major changes
Jun 15, 2025
57c31b9
Merge branch 'feature/ui-ux-refresh' into ui-ux-refresh_eunsoo
Jun 16, 2025
ca9f046
Minor changes
Jun 16, 2025
2f13a87
update user info from login
Fr4nc3 Jun 16, 2025
f3ac34e
Merge branch 'ui-ux-refresh_eunsoo' into feature/ui-ux-refresh
Fr4nc3 Jun 16, 2025
49db995
conciliate code
Fr4nc3 Jun 16, 2025
65e8a9d
consistency with the messages
Fr4nc3 Jun 16, 2025
d655516
update panel behavior
Fr4nc3 Jun 16, 2025
60b47f2
remove check to agent, add reloadtask
Fr4nc3 Jun 16, 2025
1e2ab68
fixing promptcard to disable
Fr4nc3 Jun 16, 2025
941abb7
remove punctuation to the toasts
Fr4nc3 Jun 16, 2025
e7bdd2e
Update HomeInput.tsx
Fr4nc3 Jun 16, 2025
a166cb0
Update Chat.css
Jun 16, 2025
78c6ff9
Update HomeInput.tsx
Fr4nc3 Jun 17, 2025
79c1463
remove the Hr Agent lower case
Fr4nc3 Jun 17, 2025
28acfa9
Update InlineToaster.tsx
Jun 17, 2025
eacee03
add the enter action
Fr4nc3 Jun 17, 2025
875d8d6
Merge branch 'ui-ux-refresh_eunsoo' into feature/ui-ux-refresh
Fr4nc3 Jun 17, 2025
6d444c7
Minor changes
Jun 17, 2025
284c7a0
Bug Fix #19325
Ravikirana-Microsoft Jun 17, 2025
f68a384
unused code removed
Ravikirana-Microsoft Jun 17, 2025
de88da5
Merge branch 'ui-ux-refresh_eunsoo' into feature/ui-ux-refresh
Fr4nc3 Jun 17, 2025
e792092
Merge pull request #272 from microsoft/ui-ux-refresh-bug-fixes
Fr4nc3 Jun 17, 2025
8710868
Major changes
Jun 17, 2025
8ef3653
Bring eunsoo changes
Fr4nc3 Jun 17, 2025
8407007
conciliate merge from eunsoo
Fr4nc3 Jun 17, 2025
98d3e2a
clean chat after clarification
Fr4nc3 Jun 17, 2025
9e09257
partial fix for final call
Fr4nc3 Jun 17, 2025
db5c031
Major changes
Jun 17, 2025
05c932d
Bug Fix #19398, #19280
Ravikirana-Microsoft Jun 18, 2025
e598fda
Merge branch 'ui-ux-refresh_eunsoo' into feature/ui-ux-refresh
Fr4nc3 Jun 18, 2025
a2a60a0
Merge pull request #274 from microsoft/ui-ux-refresh-bug-fixes
Fr4nc3 Jun 18, 2025
a9e2097
conciliate code
Fr4nc3 Jun 18, 2025
1228620
Merge remote-tracking branch 'upstream/dev' into feature/ui-ux-refresh
Fr4nc3 Jun 18, 2025
a9fee6f
Update PlanPanelLeft.tsx
Fr4nc3 Jun 18, 2025
791d125
clean up console.errors
Fr4nc3 Jun 18, 2025
0070332
Update planner_agent.py
Fr4nc3 Jun 18, 2025
aca10ea
Update planner_agent.py
Fr4nc3 Jun 18, 2025
f3a2c59
Update PlanPanelLeft.tsx
Fr4nc3 Jun 18, 2025
4e84436
clean up console.errors
Fr4nc3 Jun 18, 2025
8080c4e
Merge remote-tracking branch 'microsoft/dev' into feature/ui-ux-refresh
Fr4nc3 Jun 19, 2025
865ffe6
update the limit of the element for the limit
Fr4nc3 Jun 19, 2025
4b01873
add something missing from before the app was broken
Fr4nc3 Jun 19, 2025
52bb64c
Merge branch 'feature/ui-ux-refresh_619_wk' into feature/ui-ux-refresh
Fr4nc3 Jun 19, 2025
3d63820
Add new images to readme
marktayl1 Jun 20, 2025
eab276f
Merge pull request #280 from microsoft/docs/add-readme-images
Fr4nc3 Jun 23, 2025
08dbfbf
allow only frontend to call backend server
Fr4nc3 Jun 24, 2025
4fa1776
delete old frontend folder
Fr4nc3 Jun 24, 2025
3896e18
rename new frontend_react to frontend
Fr4nc3 Jun 24, 2025
83aba0a
Update migration-commands.txt
Fr4nc3 Jun 24, 2025
ed0a36d
Merge branch 'dev' into feature/ui-ux-refresh
Roopan-Microsoft Jun 24, 2025
1030068
Tag dev01 reverted to latest
Roopan-Microsoft Jun 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ Solution overview
The solution leverages Azure OpenAI Service, Azure Container Apps, Azure Cosmos DB, and Azure Container Registry to create an intelligent automation pipeline. It uses a multi-agent approach where specialized AI agents work together to plan, execute, and validate tasks based on user input.

### Solution architecture
|![image](./docs/images/readme/macae-architecture.png)|
|![image](./docs/images/readme/architecture.png)|
|---|


### Agentic architecture
|![image](./docs/images/readme/agent_flow.png)|
|---|

### How to customize
If you'd like to customize the solution accelerator, here are some common areas to start:
Expand Down Expand Up @@ -111,7 +113,7 @@ either by deleting the resource group in the Portal or running `azd down`.
Business Scenario
</h2>

|![image](./docs/images/readme/macae-application.png)|
|![image](./docs/images/readme/application.png)|
|---|

<br/>
Expand Down
1 change: 1 addition & 0 deletions __azurite_db_queue__.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"filename":"c:\\src\\Multi-Agent-Custom-Automation-Engine-Solution-Accelerator\\__azurite_db_queue__.json","collections":[{"name":"$SERVICES_COLLECTION$","data":[],"idIndex":null,"binaryIndices":{},"constraints":null,"uniqueNames":["accountName"],"transforms":{},"objType":"$SERVICES_COLLECTION$","dirty":false,"cachedIndex":null,"cachedBinaryIndex":null,"cachedData":null,"adaptiveBinaryIndices":true,"transactional":false,"cloneObjects":false,"cloneMethod":"parse-stringify","asyncListeners":false,"disableMeta":false,"disableChangesApi":true,"disableDeltaChangesApi":true,"autoupdate":false,"serializableIndices":true,"disableFreeze":true,"ttl":null,"maxId":0,"DynamicViews":[],"events":{"insert":[],"update":[],"pre-insert":[],"pre-update":[],"close":[],"flushbuffer":[],"error":[],"delete":[null],"warning":[null]},"changes":[],"dirtyIds":[]},{"name":"$QUEUES_COLLECTION$","data":[],"idIndex":null,"binaryIndices":{"accountName":{"name":"accountName","dirty":false,"values":[]},"name":{"name":"name","dirty":false,"values":[]}},"constraints":null,"uniqueNames":[],"transforms":{},"objType":"$QUEUES_COLLECTION$","dirty":false,"cachedIndex":null,"cachedBinaryIndex":null,"cachedData":null,"adaptiveBinaryIndices":true,"transactional":false,"cloneObjects":false,"cloneMethod":"parse-stringify","asyncListeners":false,"disableMeta":false,"disableChangesApi":true,"disableDeltaChangesApi":true,"autoupdate":false,"serializableIndices":true,"disableFreeze":true,"ttl":null,"maxId":0,"DynamicViews":[],"events":{"insert":[],"update":[],"pre-insert":[],"pre-update":[],"close":[],"flushbuffer":[],"error":[],"delete":[null],"warning":[null]},"changes":[],"dirtyIds":[]},{"name":"$MESSAGES_COLLECTION$","data":[],"idIndex":null,"binaryIndices":{"accountName":{"name":"accountName","dirty":false,"values":[]},"queueName":{"name":"queueName","dirty":false,"values":[]},"messageId":{"name":"messageId","dirty":false,"values":[]},"visibleTime":{"name":"visibleTime","dirty":false,"values":[]}},"constraints":null,"uniqueNames":[],"transforms":{},"objType":"$MESSAGES_COLLECTION$","dirty":false,"cachedIndex":null,"cachedBinaryIndex":null,"cachedData":null,"adaptiveBinaryIndices":true,"transactional":false,"cloneObjects":false,"cloneMethod":"parse-stringify","asyncListeners":false,"disableMeta":false,"disableChangesApi":true,"disableDeltaChangesApi":true,"autoupdate":false,"serializableIndices":true,"disableFreeze":true,"ttl":null,"maxId":0,"DynamicViews":[],"events":{"insert":[],"update":[],"pre-insert":[],"pre-update":[],"close":[],"flushbuffer":[],"error":[],"delete":[null],"warning":[null]},"changes":[],"dirtyIds":[]}],"databaseVersion":1.5,"engineVersion":1.5,"autosave":true,"autosaveInterval":5000,"autosaveHandle":null,"throttledSaves":true,"options":{"persistenceMethod":"fs","autosave":true,"autosaveInterval":5000,"serializationMethod":"normal","destructureDelimiter":"$<\n"},"persistenceMethod":"fs","persistenceAdapter":null,"verbose":false,"events":{"init":[null],"loaded":[],"flushChanges":[],"close":[],"changes":[],"warning":[]},"ENV":"NODEJS"}
1 change: 1 addition & 0 deletions __azurite_db_queue_extent__.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"filename":"c:\\src\\Multi-Agent-Custom-Automation-Engine-Solution-Accelerator\\__azurite_db_queue_extent__.json","collections":[{"name":"$EXTENTS_COLLECTION$","data":[],"idIndex":null,"binaryIndices":{"id":{"name":"id","dirty":false,"values":[]}},"constraints":null,"uniqueNames":[],"transforms":{},"objType":"$EXTENTS_COLLECTION$","dirty":false,"cachedIndex":null,"cachedBinaryIndex":null,"cachedData":null,"adaptiveBinaryIndices":true,"transactional":false,"cloneObjects":false,"cloneMethod":"parse-stringify","asyncListeners":false,"disableMeta":false,"disableChangesApi":true,"disableDeltaChangesApi":true,"autoupdate":false,"serializableIndices":true,"disableFreeze":true,"ttl":null,"maxId":0,"DynamicViews":[],"events":{"insert":[],"update":[],"pre-insert":[],"pre-update":[],"close":[],"flushbuffer":[],"error":[],"delete":[null],"warning":[null]},"changes":[],"dirtyIds":[]}],"databaseVersion":1.5,"engineVersion":1.5,"autosave":true,"autosaveInterval":5000,"autosaveHandle":null,"throttledSaves":true,"options":{"persistenceMethod":"fs","autosave":true,"autosaveInterval":5000,"serializationMethod":"normal","destructureDelimiter":"$<\n"},"persistenceMethod":"fs","persistenceAdapter":null,"verbose":false,"events":{"init":[null],"loaded":[],"flushChanges":[],"close":[],"changes":[],"warning":[]},"ENV":"NODEJS"}
Binary file added docs/images/readme/agent_flow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/readme/application.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/readme/architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/images/readme/macae-application.png
Binary file not shown.
Binary file removed docs/images/readme/macae-architecture.png
Binary file not shown.
4 changes: 2 additions & 2 deletions infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,7 @@ module containerApp 'br/public:avm/res/app/container-app:0.14.2' = if (container
containers: [
{
name: containerAppConfiguration.?containerName ?? 'backend'
image: '${containerAppConfiguration.?containerImageRegistryDomain ?? 'biabcontainerreg.azurecr.io'}/${containerAppConfiguration.?containerImageName ?? 'macaebackend'}:${containerAppConfiguration.?containerImageTag ?? 'latest'}'
image: '${containerAppConfiguration.?containerImageRegistryDomain ?? 'biabcontainerreg.azurecr.io'}/${containerAppConfiguration.?containerImageName ?? 'macaebackend'}:${containerAppConfiguration.?containerImageTag ?? 'dev01'}'
resources: {
//TODO: Make cpu and memory parameterized
cpu: containerAppConfiguration.?containerCpu ?? '2.0'
Expand Down Expand Up @@ -1151,7 +1151,7 @@ module webSite 'br/public:avm/res/web/site:0.15.1' = if (webSiteEnabled) {
diagnosticSettings: [{ workspaceResourceId: logAnalyticsWorkspaceId }]
publicNetworkAccess: 'Enabled' //TODO: use Azure Front Door WAF or Application Gateway WAF instead
siteConfig: {
linuxFxVersion: 'DOCKER|${webSiteConfiguration.?containerImageRegistryDomain ?? 'biabcontainerreg.azurecr.io'}/${webSiteConfiguration.?containerImageName ?? 'macaefrontend'}:${webSiteConfiguration.?containerImageTag ?? 'latest'}'
linuxFxVersion: 'DOCKER|${webSiteConfiguration.?containerImageRegistryDomain ?? 'biabcontainerreg.azurecr.io'}/${webSiteConfiguration.?containerImageName ?? 'macaefrontend'}:${webSiteConfiguration.?containerImageTag ?? 'dev01'}'
}
appSettingsKeyValuePairs: {
SCM_DO_BUILD_DURING_DEPLOYMENT: 'true'
Expand Down
96 changes: 92 additions & 4 deletions src/backend/app_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
# Add this near the top of your app.py, after initializing the app
app.add_middleware(
CORSMiddleware,
allow_origins=[frontend_url], # Add your frontend server URL
allow_origins=[frontend_url],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
Expand Down Expand Up @@ -519,10 +519,12 @@ async def approve_step_endpoint(
return {"status": "All steps approved"}


@app.get("/api/plans", response_model=List[PlanWithSteps])
@app.get("/api/plans")
async def get_plans(
request: Request, session_id: Optional[str] = Query(None)
) -> List[PlanWithSteps]:
request: Request,
session_id: Optional[str] = Query(None),
plan_id: Optional[str] = Query(None),
):
"""
Retrieve plans for the current user.
Expand Down Expand Up @@ -607,6 +609,24 @@ async def get_plans(
plan_with_steps = PlanWithSteps(**plan.model_dump(), steps=steps)
plan_with_steps.update_step_counts()
return [plan_with_steps]
if plan_id:
plan = await memory_store.get_plan_by_plan_id(plan_id=plan_id)
if not plan:
track_event_if_configured(
"GetPlanBySessionNotFound",
{"status_code": 400, "detail": "Plan not found"},
)
raise HTTPException(status_code=404, detail="Plan not found")

# Use get_steps_by_plan to match the original implementation
steps = await memory_store.get_steps_by_plan(plan_id=plan.id)
messages = await memory_store.get_data_by_type_and_session_id(
"agent_message", session_id=plan.session_id
)

plan_with_steps = PlanWithSteps(**plan.model_dump(), steps=steps)
plan_with_steps.update_step_counts()
return [plan_with_steps, messages]

all_plans = await memory_store.get_all_plans()
# Fetch steps for all plans concurrently
Expand Down Expand Up @@ -756,6 +776,74 @@ async def get_agent_messages(session_id: str, request: Request) -> List[AgentMes
return agent_messages


@app.get("/api/agent_messages_by_plan/{plan_id}", response_model=List[AgentMessage])
async def get_agent_messages_by_plan(
plan_id: str, request: Request
) -> List[AgentMessage]:
"""
Retrieve agent messages for a specific session.
---
tags:
- Agent Messages
parameters:
- name: session_id
in: path
type: string
required: true
in: path
type: string
required: true
description: The ID of the session to retrieve agent messages for
responses:
200:
description: List of agent messages associated with the specified session
schema:
type: array
items:
type: object
properties:
id:
type: string
description: Unique ID of the agent message
session_id:
type: string
description: Session ID associated with the message
plan_id:
type: string
description: Plan ID related to the agent message
content:
type: string
description: Content of the message
source:
type: string
description: Source of the message (e.g., agent type)
timestamp:
type: string
format: date-time
description: Timestamp of the message
step_id:
type: string
description: Optional step ID associated with the message
400:
description: Missing or invalid user information
404:
description: Agent messages not found
"""
authenticated_user = get_authenticated_user_details(request_headers=request.headers)
user_id = authenticated_user["user_principal_id"]
if not user_id:
track_event_if_configured(
"UserIdNotFound", {"status_code": 400, "detail": "no user"}
)
raise HTTPException(status_code=400, detail="no user")

# Initialize memory context
kernel, memory_store = await initialize_runtime_and_context("", user_id)
agent_messages = await memory_store.get_data_by_type_and_plan_id("agent_message")
return agent_messages


@app.delete("/api/messages")
async def delete_all_messages(request: Request) -> Dict[str, str]:
"""
Expand Down
34 changes: 33 additions & 1 deletion src/backend/context/cosmos_memory_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,17 @@ async def get_plan_by_session(self, session_id: str) -> Optional[Plan]:
plans = await self.query_items(query, parameters, Plan)
return plans[0] if plans else None

async def get_plan_by_plan_id(self, plan_id: str) -> Optional[Plan]:
"""Retrieve a plan associated with a session."""
query = "SELECT * FROM c WHERE c.id=@id AND c.user_id=@user_id AND c.data_type=@data_type"
parameters = [
{"name": "@id", "value": plan_id},
{"name": "@data_type", "value": "plan"},
{"name": "@user_id", "value": self.user_id},
]
plans = await self.query_items(query, parameters, Plan)
return plans[0] if plans else None

async def get_thread_by_session(self, session_id: str) -> Optional[Any]:
"""Retrieve a plan associated with a session."""
query = "SELECT * FROM c WHERE c.session_id=@session_id AND c.user_id=@user_id AND c.data_type=@data_type"
Expand Down Expand Up @@ -257,7 +268,7 @@ async def get_plan(self, plan_id: str) -> Optional[Plan]:

async def get_all_plans(self) -> List[Plan]:
"""Retrieve all plans."""
query = "SELECT * FROM c WHERE c.user_id=@user_id AND c.data_type=@data_type ORDER BY c._ts DESC OFFSET 0 LIMIT 5"
query = "SELECT * FROM c WHERE c.user_id=@user_id AND c.data_type=@data_type ORDER BY c._ts DESC OFFSET 0 LIMIT 10"
parameters = [
{"name": "@data_type", "value": "plan"},
{"name": "@user_id", "value": self.user_id},
Expand Down Expand Up @@ -431,6 +442,27 @@ async def get_data_by_type(self, data_type: str) -> List[BaseDataModel]:
logging.exception(f"Failed to query data by type from Cosmos DB: {e}")
return []

async def get_data_by_type_and_session_id(
self, data_type: str, session_id: str
) -> List[BaseDataModel]:
"""Query the Cosmos DB for documents with the matching data_type, session_id and user_id."""
await self.ensure_initialized()
if self._container is None:
return []

model_class = self.MODEL_CLASS_MAPPING.get(data_type, BaseDataModel)
try:
query = "SELECT * FROM c WHERE c.session_id=@session_id AND c.user_id=@user_id AND c.data_type=@data_type ORDER BY c._ts ASC"
parameters = [
{"name": "@session_id", "value": session_id},
{"name": "@data_type", "value": data_type},
{"name": "@user_id", "value": self.user_id},
]
return await self.query_items(query, parameters, model_class)
except Exception as e:
logging.exception(f"Failed to query data by type from Cosmos DB: {e}")
return []

async def delete_item(self, item_id: str, partition_key: str) -> None:
"""Delete an item from Cosmos DB."""
await self.ensure_initialized()
Expand Down
19 changes: 13 additions & 6 deletions src/backend/kernel_agents/planner_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,17 @@
from kernel_tools.procurement_tools import ProcurementTools
from kernel_tools.product_tools import ProductTools
from kernel_tools.tech_support_tools import TechSupportTools
from models.messages_kernel import (AgentMessage, AgentType,
HumanFeedbackStatus, InputTask, Plan,
PlannerResponsePlan, PlanStatus, Step,
StepStatus)
from models.messages_kernel import (
AgentMessage,
AgentType,
HumanFeedbackStatus,
InputTask,
Plan,
PlannerResponsePlan,
PlanStatus,
Step,
StepStatus,
)
from semantic_kernel.functions import KernelFunction
from semantic_kernel.functions.kernel_arguments import KernelArguments

Expand Down Expand Up @@ -188,7 +195,7 @@ async def handle_input_task(self, input_task: InputTask) -> str:
session_id=input_task.session_id,
user_id=self._user_id,
plan_id=plan.id,
content=f"Generated a plan with {len(steps)} steps. Click the blue check box beside each step to complete it, click the x to remove this step.",
content=f"Generated a plan with {len(steps)} steps. Click the checkmark beside each step to complete it, click the x to reject this step.",
source=AgentType.PLANNER.value,
step_id="",
)
Expand All @@ -200,7 +207,7 @@ async def handle_input_task(self, input_task: InputTask) -> str:
"session_id": input_task.session_id,
"user_id": self._user_id,
"plan_id": plan.id,
"content": f"Generated a plan with {len(steps)} steps. Click the blue check box beside each step to complete it, click the x to remove this step.",
"content": f"Generated a plan with {len(steps)} steps. Click the checkmark beside each step to complete it, click the x to reject this step.",
"source": AgentType.PLANNER.value,
},
)
Expand Down
13 changes: 13 additions & 0 deletions src/frontend/.env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# This is a sample .env file for the frontend application.

API_URL=http://localhost:8000
ENABLE_AUTH=false
# VITE_APP_MSAL_AUTH_CLIENTID=""
# VITE_APP_MSAL_AUTH_AUTHORITY=""
# VITE_APP_MSAL_REDIRECT_URL="/"
# VITE_APP_MSAL_POST_REDIRECT_URL="/"
# REACT_APP_MSAL_AUTH_CLIENTID=""
# REACT_APP_MSAL_AUTH_AUTHORITY=""
# REACT_APP_MSAL_REDIRECT_URL="/"
# REACT_APP_MSAL_POST_REDIRECT_URL="/"

25 changes: 25 additions & 0 deletions src/frontend/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module.exports = {
root: true,
extends: [
'react-app',
'react-app/jest',
'plugin:react/recommended',
],
plugins: ['react', '@typescript-eslint'],
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
jsx: true
}
},
settings: {
react: {
version: 'detect'
}
},
rules: {
// Add custom rules here
'react/react-in-jsx-scope': 'off', // Not needed in React 17+
}
};
28 changes: 28 additions & 0 deletions src/frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build
/dist

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

# Vite
.vite/
*.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
Loading
Loading