Skip to content

Commit cd9705d

Browse files
authored
0.7 release (#69)
1 parent cc48319 commit cd9705d

File tree

230 files changed

+56571
-924
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

230 files changed

+56571
-924
lines changed

.github/workflows/build.yml

Lines changed: 51 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -20,73 +20,86 @@ jobs:
2020
compile -c recommendation_package_api.json
2121
compile -c recommendation_package_kafka.json
2222
23-
- example: finance-rewards
24-
path: finance-credit-card-chatbot
23+
- example: credit-card-analytics
24+
path: finance-credit-card-chatbot/credit-card-analytics
25+
tag: credit-card-analytics
26+
test_commands: |
27+
compile -c creditcard_analytics_package_test.json
28+
compile -c creditcard_analytics_package_kafka.json
29+
test -c creditcard_analytics_package_test.json creditcard_analytics_package_jwt.json
30+
- example: credit-card-rewards
31+
path: finance-credit-card-chatbot/credit-card-rewards
32+
tag: credit-card-rewards
2533
test_commands: |
2634
compile -c creditcard_rewards_package_test.json
2735
compile -c creditcard_rewards_package_kafka.json
28-
test -c creditcard_rewards_package_test.json
29-
- example: finance-analytics
30-
path: finance-credit-card-chatbot
36+
test -c creditcard_rewards_package_test.json creditcard_rewards_package_jwt.json
37+
- example: credit-card-views
38+
path: finance-credit-card-chatbot/credit-card-views
39+
tag: credit-card-views
3140
test_commands: |
32-
compile -c creditcard_analytics_package_test.json
33-
compile -c creditcard_analytics_package_kafka.json
34-
test -c creditcard_analytics_package_test.json
41+
compile -c creditcard_views_package_test.json
42+
# FIXME test -c creditcard_views_package_test.json
3543

36-
- example: healthcare-compile
37-
path: healthcare-study-monitoring
44+
- example: healthcare-study-analytics
45+
path: healthcare-study/healthcare-study-analytics
46+
tag: healthcare-study-analytics
3847
test_commands: |
39-
compile -c study_stream_package_test.json
40-
compile -c study_stream_package_kafka.json
41-
compile -c study_api_package_api.json
42-
compile -c study_api_package_test.json
4348
compile -c study_analytics_package_test.json
44-
# FIXME https://github.com/DataSQRL/sqrl/issues/1140 compile -c study_analytics_package_snowflake.json
45-
- example: healthcare-analytics
46-
path: healthcare-study-monitoring
47-
test_commands: |
4849
test -c study_analytics_package_test.json
49-
- example: healthcare-api
50-
path: healthcare-study-monitoring
50+
# FIXME https://github.com/DataSQRL/sqrl/issues/1140 compile -c study_analytics_package_snowflake.json
51+
- example: healthcare-study-api
52+
path: healthcare-study/healthcare-study-api
53+
tag: healthcare-study-api
5154
test_commands: |
55+
compile -c study_api_package_api.json
56+
compile -c study_api_package_test.json
5257
test -c study_api_package_test.json
53-
- example: healthcare-stream
54-
path: healthcare-study-monitoring
58+
- example: healthcare-study-stream
59+
path: healthcare-study/healthcare-study-stream
60+
tag: healthcare-study-stream
5561
test_commands: |
62+
compile -c study_stream_package_kafka.json
63+
compile -c study_stream_package_test.json
5664
test -c study_stream_package_test.json
5765
58-
- example: logistics
59-
path: logistics-shipping-geodata
60-
test_commands: |
61-
compile -c logistics_package_test.json
62-
test -c logistics_package_test.json
63-
6466
- example: iot-sensor
6567
path: iot-sensor-metrics
6668
test_commands: |
67-
compile -c sensor_package_api.json
68-
compile -c sensor_package_test.json
69-
test -c sensor_package_test.json
70-
test -c sensor_package_api.json
69+
compile -c sensors_package_api.json
70+
compile -c sensors_package_test.json
71+
test -c sensors_package_test.json
72+
test -c sensors_package_api.json
7173
72-
- example: law
74+
- example: law-enforcement
7375
path: law-enforcement
7476
test_commands: |
7577
compile -c baseball_card_package_test.json
7678
test -c baseball_card_package_test.json
7779
78-
- example: oil-gas
79-
path: oil-gas-agent-automation
80+
- example: logistics
81+
path: logistics-shipping-geodata
82+
test_commands: |
83+
compile -c logistics_package_test.json
84+
test -c logistics_package_test.json
85+
86+
- example: oil-gas-monitoring
87+
path: oil-gas-agent-automation/oil-gas-agent-monitoring
88+
tag: oil-gas-agent-monitoring
8089
test_commands: |
8190
compile -c monitoring_agent_package_test.json
91+
- example: oil-gas-operations
92+
path: oil-gas-agent-automation/oil-gas-agent-operations
93+
tag: oil-gas-agent-operations
94+
test_commands: |
8295
compile -c operations_agent_package_test.json
8396
test -c operations_agent_package_test.json
8497
8598
- example: usage-analytics
8699
path: usage-analytics
87100
test_commands: |
88-
compile -c package-test.json
89-
test -c package-test.json
101+
compile -c usertokens_package_test.json
102+
test -c usertokens_package_test.json
90103
91104
env:
92105
TZ: 'America/Los_Angeles'
@@ -163,7 +176,7 @@ jobs:
163176
context: ./${{ matrix.path }}
164177
file: ./${{ matrix.path }}/Dockerfile
165178
push: true
166-
tags: datasqrl/examples:${{ matrix.path }}
179+
tags: datasqrl/examples:${{ matrix.tag && matrix.tag != '' && matrix.tag || matrix.path }}
167180
platforms: linux/amd64,linux/arm64
168181

169182
ci-summary:

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ h2.db.mv.db
55
cache
66
.project
77
*/myenv
8+
warehouse
89

910

1011
# Created by https://www.toptal.com/developers/gitignore/api/python
@@ -222,4 +223,4 @@ Temporary Items
222223
*.icloud
223224

224225
py-venv
225-
# End of https://www.toptal.com/developers/gitignore/api/macos
226+
# End of https://www.toptal.com/developers/gitignore/api/macos

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22

33
This is a repository for real world [DataSQRL](https://github.com/DataSQRL/sqrl) use cases and examples.
44

5-
* **[Finance Credit Card Chatbot](finance-credit-card-chatbot/)**: Build a data pipeline that enriches and analyzes credit card transaction in real time and feeds the data into a GenAI chatbot to answer customer's questions about their transactions and spending. The extended example shows how to build a credit card rewards program and GenAI agent that sells credit cards.
6-
* **[Clickstream AI Recommendation](clickstream-ai-recommendation/)**: Build a personalized recommendation engine based on clickstream data and vector content embeddings generated by an LLM.
7-
* **[Healthcare Study](healthcare-study-monitoring/)**: Build a data pipeline for enriching healthcare data and querying it in realtime through an API, for data analytics in Iceberg, and publishing it to Kafka.
5+
* **[Finance Credit Card Chatbot](finance-credit-card-chatbot)**: Build a data pipeline that enriches and analyzes credit card transaction in real time and feeds the data into a GenAI chatbot to answer customer's questions about their transactions and spending. The extended example shows how to build a credit card rewards program and GenAI agent that sells credit cards.
6+
* **[Clickstream AI Recommendation](clickstream-ai-recommendation)**: Build a personalized recommendation engine based on clickstream data and vector content embeddings generated by an LLM.
7+
* **[Healthcare Study](healthcare-study)**: Build a data pipeline for enriching healthcare data and querying it in realtime through an API, for data analytics in Iceberg, and publishing it to Kafka.
88
* **[Law Enforcement](law-enforcement)**: Build a realtime data pipeline for capturing and tracking warrants and Bolos.
99
* **[Oil & Gas IoT Automation Agent](oil-gas-agent-automation)**: Build a realtime data enrichment pipeline that triggers an agent to analyze abnormal events for automated troubleshooting.
10-
* **[IoT Sensor Metrics](iot-sensor-metrics/)**: Build an event-driven microservice that ingests sensor metrics, processes them in realtime, and produces alerts and dashboards for users.
11-
* **[Logistics Shipping](logistics-shipping-geodata/)**: Build a data pipeline that processes logistics data to provide real-time tracking and shipment information for customers.
12-
* **[User Defined Function](user-defined-function/)**: This small tutorial shows how to include your call a custom function in your SQRL script.
10+
* **[IoT Sensor Metrics](iot-sensor-metrics)**: Build an event-driven microservice that ingests sensor metrics, processes them in realtime, and produces alerts and dashboards for users.
11+
* **[Logistics Shipping](logistics-shipping-geodata)**: Build a data pipeline that processes logistics data to provide real-time tracking and shipment information for customers.
12+
* **[User Defined Function](user-defined-function)**: This small tutorial shows how to include your call a custom function in your SQRL script.
1313

1414
## Running the Examples
1515

@@ -41,4 +41,4 @@ docker run -it --rm -v $PWD:/build datasqrl/cmd:latest compile [ARGUMENTS GO HER
4141

4242
Check out the main [DataSQRL repository](https://github.com/DataSQRL/sqrl/) for more information on the compiler and runtime used in these examples.
4343

44-
Take a look at the [DataSQRL documentation](https://datasqrl.github.io/sqrl) to learn how to build your own project with DataSQRL.
44+
Take a look at the [DataSQRL documentation](https://datasqrl.github.io/sqrl) to learn how to build your own project with DataSQRL.

clickstream-ai-recommendation/recommendation_package_api.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
},
1515
"dependencies": {
1616
"content" : {
17-
"name": "content-api"
17+
"folder": "content-api"
1818
},
1919
"clickstream" : {
20-
"name": "clickstream-api"
20+
"folder": "clickstream-api"
2121
}
2222
}
2323
}

clickstream-ai-recommendation/recommendation_package_kafka.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
},
1515
"dependencies": {
1616
"content" : {
17-
"name": "content-kafka"
17+
"folder": "content-kafka"
1818
},
1919
"clickstream" : {
20-
"name": "clickstream-kafka"
20+
"folder": "clickstream-kafka"
2121
}
2222
},
2323
"test-runner": {
Lines changed: 41 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,29 @@
1-
# Finance Credit Card ChatBot
1+
# Finance Credit Card ChatBot Examples
22

33
This project contains two example use cases that process credit card transaction, customer, and merchant data:
44

5-
1. **Transaction Analytics**: A data pipeline which enriches the credit card transactions with customer and merchant information to give customers an overview of their transactions as well as some analytics on their spending.
6-
1. To run this data pipeline with file data, use the `creditcard_analytics_package_test.json` manifest file.
7-
2. To run this data pipeline with Kafka as the data source, use the `creditcard_analytics_package_kafka.json` manifest file.
8-
2. **Credit Card Rewards**: A data pipeline that implements a credit card rewards program. Merchants sign up for cash-back rewards on certain credit card types during certain periods and customer get a cash reward when they make a purchase at the merchant during that time. The data pipeline processes the rewards and give the customer insight into the reward they earned.
9-
1. To run this data pipeline with file data, use the `creditcard_rewards_package_test.json` manifest file.
10-
2. To run this data pipeline with Kafka as the data source, use the `creditcard_rewards_package_kafka.json` manifest file.
11-
12-
See below for detailed instructions on how to run each data pipeline. Note, that the instructions are for the *Transaction Analytics* use case. Replace the manifest files to run the *Credit Card Rewards* use case (i.e. `rewards` instead of `analytics` in the package JSON filename) - the instructions are otherwise identical.
5+
* [**Transaction Analytics**](credit-card-analytics): A data pipeline which enriches the credit card
6+
transactions with customer and merchant information to give customers an overview of their transactions as well as
7+
some analytics on their spending.
8+
* To run this data pipeline with file data, use the `creditcard_analytics_package_test.json` manifest file.
9+
* To run this data pipeline with Kafka as the data source, use the `creditcard_analytics_package_kafka.json` manifest file.
10+
* [**Credit Card Rewards**](credit-card-rewards): A data pipeline that implements a credit card rewards program.
11+
Merchants sign up for cash-back rewards on certain credit card types during certain periods and customer get a cash
12+
reward when they make a purchase at the merchant during that time. The data pipeline processes the rewards and give
13+
the customer insight into the reward they earned.
14+
* To run this data pipeline with file data, use the `creditcard_rewards_package_test.json` manifest file.
15+
* To run this data pipeline with Kafka as the data source, use the `creditcard_rewards_package_kafka.json` manifest file.
16+
17+
See below for detailed instructions on how to run each data pipeline.
18+
Note, that the instructions are for the *Transaction Analytics* use case.
19+
Replace the manifest files to run the *Credit Card Rewards* use case (i.e. `rewards` instead of `analytics` in the
20+
package JSON filename) - the instructions are otherwise identical.
1321

1422
## 1. Run the API with File data source
1523

16-
To run this example, invoke the following command in this directory on Unix based systems to compile the project
24+
To run this example, invoke the following command in the example directory on Unix based systems to compile the project:
1725
```bash
26+
cd credit-card-analytics
1827
docker run -it -p 8081:8081 -p 8888:8888 --rm -v $PWD:/build datasqrl/cmd:latest run -c creditcard_analytics_package_test.json
1928
```
2029

@@ -25,12 +34,14 @@ When you are done, you can stop the pipeline by hitting CTRL-C.
2534

2635
## 2. Run the API with Kafka data source
2736

28-
The instructions above run the data pipeline with data ingested from local files. While this is great for testing and local development, most production use cases need to ingest data from an external data source like Kafka.
37+
The instructions above run the data pipeline with data ingested from local files. While this is great for testing and local development,
38+
most production use cases need to ingest data from an external data source like Kafka.
2939

3040
To use Kafka as the data source, follow these steps:
3141

32-
Invoke the following command in this directory:
42+
Invoke the following command in the example directory:
3343
```bash
44+
cd credit-card-analytics
3445
docker run -it -p 8081:8081 -p 8888:8888 -p 9092:9092 --rm -v $PWD:/build datasqrl/cmd:latest run -c creditcard_analytics_package_kafka.json
3546
```
3647

@@ -51,28 +62,30 @@ The first load should be pretty quick. The transactions are then loaded at a rat
5162

5263
To see how the data enters the topics and the [Flink UI](http://localhost:8081/) to see the processing status.
5364

54-
As above, you can [open GraphiQL](http://localhost:8888/graphiql/) to access the API and query for data. Note, that the time windows are very long, so you won't be seeing any output there for the short period of time we are inserting data. You can adjust the time windows or keep loading data for a long time ;-).
65+
As above, you can [open GraphiQL](http://localhost:8888/graphiql/) to access the API and query for data. Note, that the time windows are very long,
66+
so you won't be seeing any output there for the short period of time we are inserting data.
67+
You can adjust the time windows or keep loading data for a long time ;-).
5568

5669
When you are done, you can stop the pipeline by hitting CTRL-C.
5770

58-
## 3. Run the AI Data Agent
59-
60-
Both use cases can be extended with a Generative AI data agent:
61-
1. **Transaction Analytics**: The data agent can answer customers' questions about their credit card transaction history and spending habits. The agent is defined in the folder `analytics-agent`.
62-
2. **Credit Card Rewards**: The data agent can show customers the rewards they earned and sell customers on different types of credit cards to maximize their rewards. The agent is defined in the folder `rewards-agent`.
71+
## 3. Securing the API endpoints
6372

64-
To run the data agent as a chatbot, you follow these steps:
73+
To secure the public API endpoints, both examples include a JWT-specific package configuration that can be combined with
74+
any of the main package configurations to secure the endpoints, regardless of other data source–specific configuration files.
6575

66-
1. Run the agent in docker:
76+
For example, to secure the API with the File data source, invoke the following command in the specific example directory:
6777
```bash
68-
docker run -it --rm -p 8080:8080 -v $PWD:/config/ -e OPENAI_API_KEY={ADD_YOUR_KEY} datasqrl/acorn /config/analytics-agent/creditcard.openai.config.json /config/creditcard_analytics.graphqls
78+
cd credit-card-analytics
79+
docker run -it -p 8081:8081 -p 8888:8888 --rm -v $PWD:/build datasqrl/cmd:latest run -c creditcard_analytics_package_test.json creditcard_analytics_package_jwt.json
6980
```
70-
* Replace `{ADD_YOUR_KEY}` with your OpenAI API key.
71-
* To run the agent for the credit card rewards use case, replace the folder `analytics-agent` with `rewards-agent` and the GraphQL file `creditcard_analytics.graphqls` with `creditcard_rewards.graphqls`.
72-
2. Open the [data agent chat](http://localhost:8080/) and enter a customer id (1-9) to "log in" as that customer. Then ask away. Questions like "what credit card would you recommend for me?" or "How many rewards did I earn?" or "How many rewards could I have earned?"
7381

74-
The example above uses OpenAI as the LLM model provider. To use a different LLM model provider, you can change the configuration file (i.e. the first argument that ends with `config.json`):
75-
* `creditcard.bedrock-llama.config.json`: Uses Llama3 on AWS Bedrock.
76-
* `creditcard.groq-llama.config.json`: Uses Llama3 on Groq.
82+
## 4. Run the MCP Inspector
83+
84+
Both use cases can utilize the MCP inspector. If API is running, open a new terminal and invoke the following command:
85+
```bash
86+
npx @modelcontextprotocol/inspector
87+
```
88+
Assuming `npm` is installed, first time, this will install a new `npm` package, then it will start the inspector.
89+
In the browser window that pop up, pick **Streamable HTTP**, and the SQRL MCP server should be available at `http://localhost:8888/mcp`.
7790

78-
You may have to update the model provider configuration to match your cloud configuration for Bedrock or Google Vertex.
91+
All public API endpoints will be listed under. **Tools**. For more information about MCP inspector, [see its documentation](https://modelcontextprotocol.io/docs/tools/inspector).

finance-credit-card-chatbot/analytics-agent/creditcard.bedrock-llama.config.json

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)