Skip to content

Commit

Permalink
corrected image paths
Browse files Browse the repository at this point in the history
  • Loading branch information
srijitcn committed Dec 13, 2024
1 parent 99544a6 commit 1156d3e
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 22 deletions.
2 changes: 1 addition & 1 deletion 00_Introduction.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
# MAGIC As mentioned in the [README](./README.md), let us build an AI Agent for providing accurate estimates of the cost of a medical procedure or diagnostic exam, end-to-end, utilizing Mosaic AI Agent Framework. Our full build will look as below
# MAGIC
# MAGIC
# MAGIC <img src="./resources/build_full.png" alt="Full Build" width="900"/>
# MAGIC <img src="https://raw.githubusercontent.com/databricks-industry-solutions/CareCost-Compass/refs/heads/main/resources/build_full.png" alt="Full Build" width="900"/>
# MAGIC
2 changes: 1 addition & 1 deletion 01_Setup Data.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# MAGIC %md
# MAGIC #Prepare Data
# MAGIC ###### Let us start by creating some synthetic data to work with.
# MAGIC <img src="./resources/build_1.png" alt="Prepare Data" width="900" style="border:2px;"/>
# MAGIC <img src="https://raw.githubusercontent.com/databricks-industry-solutions/CareCost-Compass/refs/heads/main/resources/build_1.png" alt="Prepare Data" width="900" style="border:2px;"/>
# MAGIC
# MAGIC
# MAGIC
Expand Down
8 changes: 4 additions & 4 deletions 02_Parsing and Chunking Summary of Benefits.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# MAGIC %md
# MAGIC # Parsing and Chunking Summary of benefits
# MAGIC ######Next step of our building process is to build the the Summary of Benefit Parsing and implement an appropriate chunking strategy.
# MAGIC <img src="./resources/build_2.png" alt="Parse and Chunk" width="900"/>
# MAGIC <img src="https://raw.githubusercontent.com/databricks-industry-solutions/CareCost-Compass/refs/heads/main/resources/build_2.png" alt="Parse and Chunk" width="900"/>
# MAGIC

# COMMAND ----------
Expand All @@ -14,16 +14,16 @@
# MAGIC
# MAGIC First page is the summary of coverage as shown below
# MAGIC
# MAGIC <img src="./resources/img_summary.png" alt="drawing" width="700"/>
# MAGIC <img src="https://raw.githubusercontent.com/databricks-industry-solutions/CareCost-Compass/refs/heads/main/resources/img_summary.png" alt="drawing" width="700"/>
# MAGIC
# MAGIC Remaining pages has the details of coverage as shown below
# MAGIC
# MAGIC <img src="./resources/img_details.png" alt="drawing" width="700"/>
# MAGIC <img src="https://raw.githubusercontent.com/databricks-industry-solutions/CareCost-Compass/refs/heads/main/resources/img_details.png" alt="drawing" width="700"/>
# MAGIC
# MAGIC Our aim is to extract this tabular data from PDF and create full text summary of each line item so that it captures the details appropriately. Below is an example
# MAGIC
# MAGIC For the line item
# MAGIC <img src="./resources/img_line.png" alt="drawing" width="700"/> we want to generate two paragraphs as below
# MAGIC <img src="https://raw.githubusercontent.com/databricks-industry-solutions/CareCost-Compass/refs/heads/main/resources/img_line.png" alt="drawing" width="700"/> we want to generate two paragraphs as below
# MAGIC
# MAGIC **If you have a test, for Diagnostic test (x-ray, blood work) you will pay $10 copay/test In Network and 40% coinsurance Out of Network.**
# MAGIC
Expand Down
2 changes: 1 addition & 1 deletion 03_Create Vector Index.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# MAGIC ### Vector Indexes
# MAGIC Let us start creating vector indexes
# MAGIC
# MAGIC <img src="./resources/build_3.png" alt="Vector Indexes" width="900"/>
# MAGIC <img src="https://raw.githubusercontent.com/databricks-industry-solutions/CareCost-Compass/refs/heads/main/resources/build_3.png" alt="Vector Indexes" width="900"/>
# MAGIC
# MAGIC We will be creating two vector indexes for this project.
# MAGIC 1. Vector Index for the parsed Summary of Benefits and Coverage chunks
Expand Down
4 changes: 2 additions & 2 deletions 04_Create Online Tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# MAGIC
# MAGIC Let us now create the required Online Tables
# MAGIC
# MAGIC <img src="./resources/build_4.png" alt="Online Tables" width="900"/>
# MAGIC <img src="https://raw.githubusercontent.com/databricks-industry-solutions/CareCost-Compass/refs/heads/main/resources/build_4.png" alt="Online Tables" width="900"/>
# MAGIC
# MAGIC We will be needing online tables for our `member_enrolment`, `member_accumulatord` and `procedure_cost` table.

Expand Down Expand Up @@ -54,7 +54,7 @@
# MAGIC ##NOTE Online table endpoints takes few minutes to be provisioned and available.
# MAGIC Please make sure that the endpoints are ready before proceeding further, by check the status in `Serving` page as below
# MAGIC
# MAGIC <img src="./resources/online_endpoint.png" width="800" />
# MAGIC <img src="https://raw.githubusercontent.com/databricks-industry-solutions/CareCost-Compass/refs/heads/main/resources/online_endpoint.png" width="800" />

# COMMAND ----------

Expand Down
7 changes: 4 additions & 3 deletions 05_Create All Tools and Model.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# MAGIC
# MAGIC **NOTE:** In a real enterprise application many of these tools could be complex functions or REST api calls to other services. The scope of this notebook is to illustrate the feature and can be extended any way possible.
# MAGIC
# MAGIC <img src="./resources/build_5.png" alt="Create Tools" width="900" />
# MAGIC <img src="https://raw.githubusercontent.com/databricks-industry-solutions/CareCost-Compass/refs/heads/main/resources/build_5.png" alt="Create Tools" width="900" />

# COMMAND ----------

Expand Down Expand Up @@ -606,7 +606,7 @@ def execute(self, notes:List[str]) -> str:
# MAGIC #Assemble the Care Cost Compass Application
# MAGIC
# MAGIC ####Now it's time to assemble all the components that we have built so far and build the Agent.
# MAGIC <img src="./resources/build_6.png" alt="Assemble Agent" width="900"/>
# MAGIC <img src="https://raw.githubusercontent.com/databricks-industry-solutions/CareCost-Compass/refs/heads/main/resources/build_6.png" alt="Assemble Agent" width="900"/>
# MAGIC
# MAGIC Since we made our components as LangChain Tools, we can use an AgentExecutor to run the process.
# MAGIC
Expand Down Expand Up @@ -665,7 +665,7 @@ def log_print(msg):
# MAGIC ####Workflow
# MAGIC We will implement the below workflow in the `predict` method of pyfunc model.
# MAGIC
# MAGIC <img src="./resources/logic_workflow.png" width="700">
# MAGIC <img src="https://raw.githubusercontent.com/databricks-industry-solutions/CareCost-Compass/refs/heads/main/resources/logic_workflow.png" width="700">

# COMMAND ----------

Expand Down Expand Up @@ -902,4 +902,5 @@ def predict(self, context:PythonModelContext, model_input: pd.DataFrame, params:

# COMMAND ----------

## Tell MLflow logging where to find your chain.
mlflow.models.set_model(model=CareCostCompassAgent())
12 changes: 6 additions & 6 deletions 06_Evaluate Tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# MAGIC
# MAGIC **NOTE:** For the sake of simplicity, we are performing full evaluation only on few tools. But we can extend the same concept to all the tools being used.
# MAGIC
# MAGIC <img src="./resources/star.png" width="40">Also see MLflow Tracing in action in the results section after you execute each command
# MAGIC <img src="https://raw.githubusercontent.com/databricks-industry-solutions/CareCost-Compass/refs/heads/main/resources/star.png" width="40">Also see MLflow Tracing in action in the results section after you execute each command

# COMMAND ----------

Expand Down Expand Up @@ -427,22 +427,22 @@
# MAGIC Now we can view all the evaluation runs in the experiment. Navigate to `Experiments` page and select the `carecost_compass_agent` experiment.
# MAGIC You can see the tool evaluation runs grouped as below
# MAGIC
# MAGIC <img src="./resources/tool_eval_1.png">
# MAGIC <img src="https://raw.githubusercontent.com/databricks-industry-solutions/CareCost-Compass/refs/heads/main/resources/tool_eval_1.png">
# MAGIC
# MAGIC **You can click open each run and view traces and databricks-agent evaluation results**
# MAGIC
# MAGIC ######Traces
# MAGIC <img src="./resources/tool_eval_traces_dbrx.png">
# MAGIC <img src="https://raw.githubusercontent.com/databricks-industry-solutions/CareCost-Compass/refs/heads/main/resources/tool_eval_traces_dbrx.png">
# MAGIC
# MAGIC
# MAGIC ######Evaluation Results
# MAGIC <img src="./resources/tool_eval_rag_dbrx.png">
# MAGIC <img src="https://raw.githubusercontent.com/databricks-industry-solutions/CareCost-Compass/refs/heads/main/resources/tool_eval_rag_dbrx.png">
# MAGIC
# MAGIC ######Detailed Assesments
# MAGIC You can now click open each input and see detailed assesments for each result
# MAGIC <img src="./resources/tool_eval_rag_details_1.png">
# MAGIC <img src="https://raw.githubusercontent.com/databricks-industry-solutions/CareCost-Compass/refs/heads/main/resources/tool_eval_rag_details_1.png">
# MAGIC
# MAGIC <img src="./resources/tool_eval_rag_details_2.png">
# MAGIC <img src="https://raw.githubusercontent.com/databricks-industry-solutions/CareCost-Compass/refs/heads/main/resources/tool_eval_rag_details_2.png">
# MAGIC
# MAGIC

Expand Down
2 changes: 1 addition & 1 deletion 07_Deploy the Agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# MAGIC #Let's Deploy The Agent
# MAGIC
# MAGIC ####Now it's time to log the model into MLflow and deploy it into Mosaic AI Model Servving
# MAGIC <img src="./resources/build_6.png" alt="Assemble Agent" width="900"/>
# MAGIC <img src="https://raw.githubusercontent.com/databricks-industry-solutions/CareCost-Compass/refs/heads/main/resources/build_6.png" alt="Assemble Agent" width="900"/>
# MAGIC
# MAGIC
# MAGIC ### Code Based MLflow Logging
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ A typical workflow for a procedure cost estimation is as below
In this project, we are attempting to create a Compound Gen AI application that perform these steps and derive the cost accurately. Many simplifying assumptions have been made in the sample data to keep the scope of this work limited to the design, development and deployment of the agentic application

### Architecture
<img src="./resources/architecture.png" alt="Architecture" width="700"/>
<img src="https://raw.githubusercontent.com/databricks-industry-solutions/CareCost-Compass/refs/heads/main/resources/architecture.png" alt="Architecture" width="700"/>

### Build the Solution in Databricks Workspace
The given notebooks will build all the application components step-by-step. The whole process looks like this

<img src="./resources/build_full.png" alt="Full Build" width="700"/>
<img src="https://raw.githubusercontent.com/databricks-industry-solutions/CareCost-Compass/refs/heads/main/resources/build_full.png" alt="Full Build" width="700"/>

To run this demo in a Databricks Workspace, follow the below steps
1. Use [Dabaricks Git Folders](https://docs.databricks.com/en/repos/index.html) and clone the repo into your workspace
Expand Down
2 changes: 1 addition & 1 deletion scripts/init_script.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
pip install --quiet opencv-python==4.8.0.74 camelot-py==0.11.0 pdfplumber==0.11.4
pip install --quiet typing-inspect==0.8.0 typing-extensions==4.12.2
pip install -q mlflow==2.16.2 databricks-vectorsearch==0.40 databricks-sdk==0.28.0 langchain==0.3.0 langchain-community==0.3.0 mlflow[databricks] databricks-agents==0.6.0
pip install -q mlflow==2.16.2 databricks-vectorsearch==0.40 langchain==0.3.0 langchain-community==0.3.0 mlflow[databricks] databricks-agents==0.6.0 databricks-sdk==0.28.0
pip install camelot-py[cv]==0.11.0
pip install 'PyPDF2<3.0'

0 comments on commit 1156d3e

Please sign in to comment.