From ac95c22bb625d6ebe962125a12445baa9d276223 Mon Sep 17 00:00:00 2001 From: Harish Kesava Rao Date: Sat, 14 Feb 2026 23:39:56 +0530 Subject: [PATCH 1/3] Update project references to Apache Burr and remove DAGWorks attributions - Update GitHub URLs from dagworks-inc and DAGWorks-Inc to apache. - Update documentation links from burr.dagworks.io to burr.apache.org. - Update package references dagWorks-Inc/hamilton to apache/hamilton. - Remove by DAGWorks Inc. attributions from documentation and examples. - Standardize project URLs across READMEs, examples, and backend code. --- README.md | 3 +- burr/tracking/server/backend.py | 8 +- docs/examples/chatbots/gpt-like-chatbot.ipynb | 2 +- examples/adaptive-crag/README.md | 2 +- .../graph_db_example/README.md | 2 +- .../graph_db_example/ingest_notebook.ipynb | 808 +++++++++--------- examples/hamilton-integration/notebook.ipynb | 4 +- examples/image-telephone/README.md | 6 +- examples/ml-training/README.md | 4 +- examples/multi-agent-collaboration/README.md | 2 +- .../hamilton/README.md | 2 +- examples/multi-modal-chatbot/burr_demo.ipynb | 12 +- examples/opentelemetry/README.md | 2 +- examples/opentelemetry/notebook.ipynb | 2 +- examples/parallelism/README.md | 2 +- examples/parallelism/notebook.ipynb | 16 +- examples/pytest/README.md | 2 +- examples/recursive/README.md | 2 +- examples/simple-chatbot-intro/notebook.ipynb | 2 +- examples/simulation/README.md | 6 +- examples/streaming-fastapi/README.md | 4 +- examples/streaming-fastapi/notebook.ipynb | 4 +- examples/tracing-and-spans/README.md | 4 +- .../tracing-and-spans/burr_otel_demo.ipynb | 12 +- examples/web-server/README.md | 8 +- .../notebook.ipynb | 2 +- 26 files changed, 461 insertions(+), 462 deletions(-) diff --git a/README.md b/README.md index c65c035ed..96f019fda 100644 --- a/README.md +++ b/README.md @@ -160,8 +160,7 @@ While Apache Burr is attempting something (somewhat) unique, there are a variety ## 🌯 Why the name Burr? Apache Burr is named after [Aaron Burr](https://en.wikipedia.org/wiki/Aaron_Burr), founding father, third VP of the United States, and murderer/arch-nemesis of [Alexander Hamilton](https://en.wikipedia.org/wiki/Alexander_Hamilton). -What's the connection with Hamilton? This is [DAGWorks](www.dagworks.io)' second open-source library release after the [Apache Hamilton library](https://github.com/apache/hamilton) -We imagine a world in which Burr and Hamilton lived in harmony and saw through their differences to better the union. We originally +What's the connection with Hamilton? We imagine a world in which Burr and Hamilton lived in harmony and saw through their differences to better the union. We originally built Apache Burr as a _harness_ to handle state between executions of Apache Hamilton DAGs (because DAGs don't have cycles), but realized that it has a wide array of applications and decided to release it more broadly. diff --git a/burr/tracking/server/backend.py b/burr/tracking/server/backend.py index e33cab9b8..448d0daf9 100644 --- a/burr/tracking/server/backend.py +++ b/burr/tracking/server/backend.py @@ -257,10 +257,10 @@ def safe_json_load(line: bytes): def get_uri(project_id: str) -> str: project_id_map = { - "demo_counter": "https://github.com/DAGWorks-Inc/burr/tree/main/examples/hello-world-counter", - "demo_tracing": "https://github.com/DAGWorks-Inc/burr/tree/main/examples/tracing-and-spans/application.py", - "demo_chatbot": "https://github.com/DAGWorks-Inc/burr/tree/main/examples/multi-modal-chatbot", - "demo_conversational-rag": "https://github.com/DAGWorks-Inc/burr/tree/main/examples/conversational-rag", + "demo_counter": "https://github.com/apache/burr/tree/main/examples/hello-world-counter", + "demo_tracing": "https://github.com/apache/burr/tree/main/examples/tracing-and-spans/application.py", + "demo_chatbot": "https://github.com/apache/burr/tree/main/examples/multi-modal-chatbot", + "demo_conversational-rag": "https://github.com/apache/burr/tree/main/examples/conversational-rag", } return project_id_map.get(project_id, "") diff --git a/docs/examples/chatbots/gpt-like-chatbot.ipynb b/docs/examples/chatbots/gpt-like-chatbot.ipynb index dd875bc68..7d69f2f1f 100644 --- a/docs/examples/chatbots/gpt-like-chatbot.ipynb +++ b/docs/examples/chatbots/gpt-like-chatbot.ipynb @@ -11,7 +11,7 @@ " + \n", "\n", "\n", - "[https://github.com/apache/burr](https://github.com/apache/burr) by DAGWorks Inc. (YCW23 & StartX).\n", + "[https://github.com/apache/burr](https://github.com/apache/burr).\n", "\n", "Take🏠:\n", "\n", diff --git a/examples/adaptive-crag/README.md b/examples/adaptive-crag/README.md index 9dfe6af05..ba8dc3acb 100644 --- a/examples/adaptive-crag/README.md +++ b/examples/adaptive-crag/README.md @@ -38,4 +38,4 @@ We stop after `ask_assistant` to get the next `query` for `router`. ## Adaptive-CRAG 🧪 ![statemachine](statemachine.png) -We have some of the core concepts from the [Burr Docs](https://burr.dagworks.io/concepts/) in a folder and we will add that to a `LanceDB` table for Hybrid Search. You can add as many tables as you want. Each table will be a different route for the `router`. +We have some of the core concepts from the [Burr Docs](https://burr.apache.org/concepts/) in a folder and we will add that to a `LanceDB` table for Hybrid Search. You can add as many tables as you want. Each table will be a different route for the `router`. diff --git a/examples/conversational-rag/graph_db_example/README.md b/examples/conversational-rag/graph_db_example/README.md index 7f553767a..ecf9e5334 100644 --- a/examples/conversational-rag/graph_db_example/README.md +++ b/examples/conversational-rag/graph_db_example/README.md @@ -102,7 +102,7 @@ This will run the following two pipelines: ![ingest fighters](ingest_fighters.png) ![ingest fights](ingest_fights.png) -**Note:** [Hamilton](https://github.com/dagworks-inc/hamilton) also comes with a UI that you can use to visualize the pipeline and +**Note:** [Hamilton](https://github.com/apache/hamilton) also comes with a UI that you can use to visualize the pipeline and track execution information about it. See hamilton_ingest.py or ingest_notebook.ipynb for more information. ## Ingest data using a notebook: diff --git a/examples/conversational-rag/graph_db_example/ingest_notebook.ipynb b/examples/conversational-rag/graph_db_example/ingest_notebook.ipynb index a56efcddb..2c9ba0ab0 100644 --- a/examples/conversational-rag/graph_db_example/ingest_notebook.ipynb +++ b/examples/conversational-rag/graph_db_example/ingest_notebook.ipynb @@ -1,405 +1,405 @@ { - "cells": [ - { - "cell_type": "code", - "execution_count": null, - "id": "1ad0bb7d-58db-44c5-aa17-7db4f9af9f59", - "metadata": {}, - "source": [ - "# install requirements\n", - "!pip install falkordb openai sf-hamilton[sdk,visualization] " - ], - "outputs": [] - }, - { - "cell_type": "markdown", - "id": "dbda8a07-0167-4cdf-bd1f-be233d73f53e", - "metadata": {}, - "source": [ - "# Ingestion Notebook\n", - "\n", - "In this notebook we see how to load data into FalkorDB using [Hamilton](https://github.com/dagWorks-Inc/hamilton)." - ] - }, - { - "cell_type": "code", - "execution_count": 4, - "id": "c988cb764ad158b8", - "metadata": { - "ExecuteTime": { - "end_time": "2024-05-26T05:05:26.275402Z", - "start_time": "2024-05-26T05:05:25.579866Z" - } - }, - "source": [ - "# load jupyter magic to help display Hamilton in a notebook\n", - "%load_ext hamilton.plugins.jupyter_magic" - ], - "outputs": [] - }, - { - "cell_type": "markdown", - "id": "b26d3413-42ea-4f92-b951-9a2450f0ddb4", - "metadata": {}, - "source": [ - "## Fighter ingestion pipeline\n", - "\n", - "We define loading a CSV, then loading each row/fighter into FalkorDB.\n", - "\n", - "We use Hamilton to parallelize & iterate over each fighter to keep our code more unit testable and manageable. " - ] - }, - { - "cell_type": "code", - "execution_count": 5, - "id": "41492c8cd1ad9b26", - "metadata": { - "ExecuteTime": { - "end_time": "2024-05-26T05:12:04.660817Z", - "start_time": "2024-05-26T05:12:04.295564Z" - } - }, - "source": [ - "%%cell_to_module -m load_fighters --display\n", - "\n", - "import pandas as pd\n", - "from hamilton.htypes import Parallelizable, Collect\n", - "import falkordb\n", - "import utils\n", - "\n", - "def raw_fighter_details() -> pd.DataFrame:\n", - " \"\"\"Load fighter data\"\"\"\n", - " _df = pd.read_csv('../data/raw_fighter_details.csv')\n", - " return _df\n", - "\n", - "def fighter(raw_fighter_details: pd.DataFrame) -> Parallelizable[pd.Series]:\n", - " \"\"\"We then want to do something for each record. That's what this code sets up\"\"\"\n", - " for idx, row in raw_fighter_details.iterrows():\n", - " yield row\n", - "\n", - "def record(fighter: pd.Series) -> dict:\n", - " \"\"\"Given a single fighter record, process it into a dictionary.\"\"\"\n", - " attrs = {}\n", - " attrs['Name'] = fighter.fighter_name\n", - " \n", - " if isinstance(fighter.Height, str) and fighter.Height != \"\":\n", - " attrs['Height'] = utils.height_to_cm(fighter.Height)\n", - " \n", - " if isinstance(fighter.Weight, str) and fighter.Weight != \"\":\n", - " Weight = int(fighter.Weight.replace(' lbs.', ''))\n", - " attrs['Weight'] = Weight\n", - " \n", - " if isinstance(fighter.Reach, str) and fighter.Reach != \"\":\n", - " attrs['Reach'] = utils.reach_to_cm(fighter.Reach)\n", - " \n", - " if isinstance(fighter.Stance, str) and fighter.Stance != \"\":\n", - " attrs['Stance'] = fighter.Stance\n", - " \n", - " if isinstance(fighter.DOB, str) and fighter.DOB != \"\":\n", - " attrs['DOB'] = utils.date_to_timestamp(fighter.DOB)\n", - " \n", - " # Significant Strikes Landed per Minute\n", - " attrs['SLpM'] = float(fighter.SLpM)\n", - " \n", - " # Strike accuracy\n", - " attrs['Str_Acc'] = utils.percentage_to_float(fighter.Str_Acc)\n", - " \n", - " # Significant Strikes Absorbed per Minute.\n", - " attrs['SApM'] = float(fighter.SApM)\n", - " \n", - " # strikes defended\n", - " attrs['Str_Def'] = utils.percentage_to_float(fighter.Str_Def)\n", - " \n", - " # Takedown average\n", - " attrs['TD_Avg'] = float(fighter.TD_Avg)\n", - " \n", - " # Takedown accuracy\n", - " attrs['TD_Acc'] = utils.percentage_to_float(fighter.TD_Acc)\n", - " \n", - " # Takedown defense\n", - " attrs['TD_Def'] = utils.percentage_to_float(fighter.TD_Def)\n", - " \n", - " # Submission average\n", - " attrs['Sub_Avg'] = float(fighter.Sub_Avg)\n", - " return attrs\n", - "\n", - "def write_to_graph(record: Collect[dict], graph: falkordb.Graph) -> int:\n", - " \"\"\"Take all records and then push to the DB\"\"\"\n", - " records = list(record)\n", - " # Load all fighters in one go.\n", - " q = \"UNWIND $fighters as fighter CREATE (f:Fighter) SET f = fighter\"\n", - " graph.query(q, {'fighters': records})\n", - " return len(records)\n" - ], - "outputs": [] - }, - { - "cell_type": "markdown", - "id": "2913b8eb-8c2f-4886-a319-da8a5563991d", - "metadata": {}, - "source": [ - "# Fights ingestion pipeline\n", - "\n", - "This code then takes the fight data and creates the graph structure required by\n", - "FalkorDB to link things together.\n", - "\n", - "It then uses the Hamilton construct to iterate over each fight and push that individually\n", - "to FalkorDB." - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "id": "b97f10cd9937d5dd", - "metadata": { - "ExecuteTime": { - "end_time": "2024-05-26T05:44:01.899490Z", - "start_time": "2024-05-26T05:44:01.430713Z" - } - }, - "source": [ - "%%cell_to_module -m load_fights --display\n", - "\n", - "import pandas as pd\n", - "import utils\n", - "from hamilton.htypes import Parallelizable, Collect\n", - "import falkordb\n", - "\n", - "def raw_total_fight_data() -> pd.DataFrame:\n", - " \"\"\"Loads the raw fight data\"\"\"\n", - " _df = pd.read_csv('../data/raw_total_fight_data.csv', delimiter=\";\")\n", - " return _df\n", - "\n", - "def transformed_data(raw_total_fight_data: pd.DataFrame) -> pd.DataFrame:\n", - " \"\"\"Does some light transformation on the data and adds some columns\"\"\"\n", - " _df = raw_total_fight_data\n", - " _df.last_round = _df.last_round.astype(int)\n", - " _df.last_round_time = _df.last_round_time.apply(lambda x: utils.time_to_seconds(x))\n", - " _df.date = _df.date.apply(lambda x: utils.date_to_timestamp(x))\n", - " _df[\"Loser\"] = _df.apply(\n", - " lambda x: x[\"B_fighter\"] if x[\"Winner\"] == x[\"R_fighter\"] else x[\"R_fighter\"], axis=1)\n", - " return _df\n", - "\n", - "\n", - "def columns_of_interest() -> list[str]:\n", - " \"\"\"Returns the columns that we're interested in processing\"\"\"\n", - " return [\n", - " \"R_fighter\", \"B_fighter\", \n", - " # R_KD, B_KD, R_SIG_STR.,B_SIG_STR.,\n", - " # R_SIG_STR_pct, B_SIG_STR_pct, R_TOTAL_STR., B_TOTAL_STR.,\n", - " # R_TD, B_TD, R_TD_pct, B_TD_pct, R_SUB_ATT, B_SUB_ATT,\n", - " # R_REV, B_REV, R_CTRL, B_CTRL, R_HEAD, B_HEAD, R_BODY,\n", - " # B_BODY, R_LEG, B_LEG, R_DISTANCE, B_DISTANCE, R_CLINCH,\n", - " # B_CLINCH, R_GROUND, B_GROUND, win_by, \n", - " \"last_round\",\n", - " \"last_round_time\", \"Format\", \"Referee\", \"date\", \"location\",\n", - " \"Fight_type\", \"Winner\", \"Loser\"\n", - " ]\n", - "\n", - "\n", - "def fight(transformed_data: pd.DataFrame, \n", - " columns_of_interest: list[str],\n", - " ) -> Parallelizable[pd.Series]:\n", - " \"\"\"Enables us to process each fight. We pass in a client along with each row\"\"\"\n", - " for _idx, _row in transformed_data[columns_of_interest].iterrows():\n", - " yield _row\n", - "\n", - "def write_to_graph(fight: pd.Series, graph: falkordb.Graph) -> str:\n", - " _row, _graph = fight, graph\n", - " # create referee\n", - " q = \"MERGE (:Referee {Name: $name})\"\n", - " _graph.query(q, {'name': _row.Referee if isinstance(_row.Referee, str) else \"\"})\n", - "\n", - " # create card\n", - " q = \"MERGE (c:Card {Date: $date, Location: $location})\"\n", - " _graph.query(q, {'date': _row.date, 'location': _row.location})\n", - "\n", - " # create fight\n", - " q = \"\"\"MATCH (c:Card {Date: $date, Location: $location})\n", - " MATCH (ref:Referee {Name: $referee})\n", - " MATCH (r:Fighter {Name:$R_fighter})\n", - " MATCH (b:Fighter {Name:$B_fighter})\n", - " CREATE (f:Fight)-[:PART_OF]->(c)\n", - " SET f = $fight\n", - " CREATE (f)-[:RED]->(r)\n", - " CREATE (f)-[:BLUE]->(b)\n", - " CREATE (ref)-[:REFEREED]->(f)\n", - " RETURN ID(f)\n", - " \"\"\"\n", - " f_id = _graph.query(q, {'date': _row.date, 'location': _row.location,\n", - " 'referee': _row.Referee if isinstance(_row.Referee, str) else \"\", 'R_fighter': _row.R_fighter,\n", - " 'B_fighter': _row.B_fighter, 'fight': {'Last_round': _row.last_round,\n", - " 'Last_round_time': _row.last_round_time, 'Format': _row.Format,\n", - " 'Fight_type': _row.Fight_type}\n", - " }).result_set[0][0]\n", - " \n", - " # mark winner & loser\n", - " q = \"\"\"MATCH (f:Fight) WHERE ID(f) = $fight_id\n", - " MATCH (l:Fighter {Name:$loser})\n", - " MATCH (w:Fighter {Name:$winner})\n", - " CREATE (w)-[:WON]->(f), (l)-[:LOST]->(f)\n", - " \"\"\"\n", - " _graph.query(q, {'fight_id': f_id, 'loser': _row.Loser, 'winner': _row.Winner if isinstance(_row.Winner, str) else \"\"})\n", - " return \"success\"\n", - "\n", - "def collect_writes(write_to_graph: Collect[str]) -> int:\n", - " return len(list(write_to_graph))" - ], - "outputs": [] - }, - { - "cell_type": "markdown", - "id": "235966ca-f05d-441e-aa99-27c1e1f6802a", - "metadata": {}, - "source": [ - "# Exercise the pipelines\n", - "\n", - "We set up the requisite objects and clients to run the pipelines." - ] - }, - { - "cell_type": "code", - "execution_count": 7, - "id": "357252c5857a3f7b", - "metadata": { - "ExecuteTime": { - "end_time": "2024-05-26T05:44:05.459158Z", - "start_time": "2024-05-26T05:44:05.448476Z" - } - }, - "source": [ - "import falkordb\n", - "from hamilton import driver\n", - "from hamilton.execution import executors\n", - "\n", - "db = falkordb.FalkorDB(host='localhost', port=6379)\n", - "g = db.select_graph(\"UFC\")\n", - "\n", - "# Clear previous graph\n", - "if \"UFC\" in db.list_graphs():\n", - " g.delete()" - ], - "outputs": [] - }, - { - "cell_type": "markdown", - "id": "f200ae21-1ab3-4bb8-ada1-876ddbd1fb5f", - "metadata": {}, - "source": [ - "### Note about the Hamilton UI\n", - "Hamilton comes with an [open source UI](https://hamilton.dagworks.io/en/latest/hamilton-ui/) that you can\n", - "surface information about your Hamilton executions. If you pull the docker containers\n", - "locally and uncomment adding the HamiltonTracker, then you'll see runs logged to it." - ] - }, - { - "cell_type": "code", - "execution_count": 8, - "id": "ec7e41c83b69311c", - "metadata": { - "ExecuteTime": { - "end_time": "2024-05-26T05:44:33.832688Z", - "start_time": "2024-05-26T05:44:06.038046Z" - } - }, - "source": [ - "# if you have the Hamilton UI you can see progress:\n", - "# from hamilton_sdk import adapters\n", - "# tracker = adapters.HamiltonTracker(\n", - "# project_id=44, # modify this as needed\n", - "# username=\"elijah@dagworks.io\",\n", - "# dag_name=\"load_fighters\",\n", - "# tags={\"environment\": \"DEV\", \"team\": \"MY_TEAM\", \"version\": \"X\"}\n", - "# )\n", - "\n", - "\n", - "# build the hamilton Driver\n", - "fighter_loader = (\n", - " driver.Builder()\n", - " .with_modules(load_fighters)\n", - " .enable_dynamic_execution(allow_experimental_mode=True)\n", - " .with_remote_executor(executors.MultiThreadingExecutor(5))\n", - " # .with_adapters(tracker) # <--- uncomment this to add tracker.\n", - " .build()\n", - ")\n", - "\n", - "fighter_loader.execute([\"write_to_graph\"], inputs={\"graph\": g})" - ], - "outputs": [] - }, - { - "cell_type": "code", - "execution_count": 9, - "id": "3b703eeb5a360", - "metadata": { - "ExecuteTime": { - "end_time": "2024-05-26T05:49:42.579219Z", - "start_time": "2024-05-26T05:44:33.835479Z" - } - }, - "source": [ - "# if you have the Hamilton UI you can see progress:\n", - "# from hamilton_sdk import adapters\n", - "# tracker = adapters.HamiltonTracker(\n", - "# project_id=44, # modify this as needed\n", - "# username=\"elijah@dagworks.io\",\n", - "# dag_name=\"load_fights\",\n", - "# tags={\"environment\": \"DEV\", \"team\": \"MY_TEAM\", \"version\": \"X\"}\n", - "# )\n", - "\n", - "fights_loader = (\n", - " driver.Builder()\n", - " .with_modules(load_fights)\n", - " .enable_dynamic_execution(allow_experimental_mode=True)\n", - " .with_remote_executor(executors.MultiThreadingExecutor(5)) # this will do 5 concurrent inserts\n", - " # .with_adapters(tracker) # <--- uncomment this to add tracker.\n", - " .build()\n", - ")\n", - "fights_loader.execute([\"collect_writes\"], inputs={\"graph\": g})" - ], - "outputs": [] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "59e6ba771b3563f2", - "metadata": { - "ExecuteTime": { - "end_time": "2024-05-26T05:49:42.591409Z", - "start_time": "2024-05-26T05:49:42.580724Z" - } - }, - "source": [], - "outputs": [] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "7981e2c8294873e5", - "metadata": {}, - "source": [], - "outputs": [] - } - ], - "metadata": { - "kernelspec": { - "display_name": "Python 3 (ipykernel)", - "language": "python", - "name": "python3" - }, - "language_info": { - "codemirror_mode": { - "name": "ipython", - "version": 3 - }, - "file_extension": ".py", - "mimetype": "text/x-python", - "name": "python", - "nbconvert_exporter": "python", - "pygments_lexer": "ipython3", - "version": "3.10.13" - } - }, - "nbformat": 4, - "nbformat_minor": 5 -} + "cells": [ + { + "cell_type": "code", + "execution_count": null, + "id": "1ad0bb7d-58db-44c5-aa17-7db4f9af9f59", + "metadata": {}, + "source": [ + "# install requirements\n", + "!pip install falkordb openai sf-hamilton[sdk,visualization] " + ], + "outputs": [] + }, + { + "cell_type": "markdown", + "id": "dbda8a07-0167-4cdf-bd1f-be233d73f53e", + "metadata": {}, + "source": [ + "# Ingestion Notebook\n", + "\n", + "In this notebook we see how to load data into FalkorDB using [Hamilton](https://github.com/apache/hamilton)." + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "id": "c988cb764ad158b8", + "metadata": { + "ExecuteTime": { + "end_time": "2024-05-26T05:05:26.275402Z", + "start_time": "2024-05-26T05:05:25.579866Z" + } + }, + "source": [ + "# load jupyter magic to help display Hamilton in a notebook\n", + "%load_ext hamilton.plugins.jupyter_magic" + ], + "outputs": [] + }, + { + "cell_type": "markdown", + "id": "b26d3413-42ea-4f92-b951-9a2450f0ddb4", + "metadata": {}, + "source": [ + "## Fighter ingestion pipeline\n", + "\n", + "We define loading a CSV, then loading each row/fighter into FalkorDB.\n", + "\n", + "We use Hamilton to parallelize & iterate over each fighter to keep our code more unit testable and manageable. " + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "id": "41492c8cd1ad9b26", + "metadata": { + "ExecuteTime": { + "end_time": "2024-05-26T05:12:04.660817Z", + "start_time": "2024-05-26T05:12:04.295564Z" + } + }, + "source": [ + "%%cell_to_module -m load_fighters --display\n", + "\n", + "import pandas as pd\n", + "from hamilton.htypes import Parallelizable, Collect\n", + "import falkordb\n", + "import utils\n", + "\n", + "def raw_fighter_details() -> pd.DataFrame:\n", + " \"\"\"Load fighter data\"\"\"\n", + " _df = pd.read_csv('../data/raw_fighter_details.csv')\n", + " return _df\n", + "\n", + "def fighter(raw_fighter_details: pd.DataFrame) -> Parallelizable[pd.Series]:\n", + " \"\"\"We then want to do something for each record. That's what this code sets up\"\"\"\n", + " for idx, row in raw_fighter_details.iterrows():\n", + " yield row\n", + "\n", + "def record(fighter: pd.Series) -> dict:\n", + " \"\"\"Given a single fighter record, process it into a dictionary.\"\"\"\n", + " attrs = {}\n", + " attrs['Name'] = fighter.fighter_name\n", + " \n", + " if isinstance(fighter.Height, str) and fighter.Height != \"\":\n", + " attrs['Height'] = utils.height_to_cm(fighter.Height)\n", + " \n", + " if isinstance(fighter.Weight, str) and fighter.Weight != \"\":\n", + " Weight = int(fighter.Weight.replace(' lbs.', ''))\n", + " attrs['Weight'] = Weight\n", + " \n", + " if isinstance(fighter.Reach, str) and fighter.Reach != \"\":\n", + " attrs['Reach'] = utils.reach_to_cm(fighter.Reach)\n", + " \n", + " if isinstance(fighter.Stance, str) and fighter.Stance != \"\":\n", + " attrs['Stance'] = fighter.Stance\n", + " \n", + " if isinstance(fighter.DOB, str) and fighter.DOB != \"\":\n", + " attrs['DOB'] = utils.date_to_timestamp(fighter.DOB)\n", + " \n", + " # Significant Strikes Landed per Minute\n", + " attrs['SLpM'] = float(fighter.SLpM)\n", + " \n", + " # Strike accuracy\n", + " attrs['Str_Acc'] = utils.percentage_to_float(fighter.Str_Acc)\n", + " \n", + " # Significant Strikes Absorbed per Minute.\n", + " attrs['SApM'] = float(fighter.SApM)\n", + " \n", + " # strikes defended\n", + " attrs['Str_Def'] = utils.percentage_to_float(fighter.Str_Def)\n", + " \n", + " # Takedown average\n", + " attrs['TD_Avg'] = float(fighter.TD_Avg)\n", + " \n", + " # Takedown accuracy\n", + " attrs['TD_Acc'] = utils.percentage_to_float(fighter.TD_Acc)\n", + " \n", + " # Takedown defense\n", + " attrs['TD_Def'] = utils.percentage_to_float(fighter.TD_Def)\n", + " \n", + " # Submission average\n", + " attrs['Sub_Avg'] = float(fighter.Sub_Avg)\n", + " return attrs\n", + "\n", + "def write_to_graph(record: Collect[dict], graph: falkordb.Graph) -> int:\n", + " \"\"\"Take all records and then push to the DB\"\"\"\n", + " records = list(record)\n", + " # Load all fighters in one go.\n", + " q = \"UNWIND $fighters as fighter CREATE (f:Fighter) SET f = fighter\"\n", + " graph.query(q, {'fighters': records})\n", + " return len(records)\n" + ], + "outputs": [] + }, + { + "cell_type": "markdown", + "id": "2913b8eb-8c2f-4886-a319-da8a5563991d", + "metadata": {}, + "source": [ + "# Fights ingestion pipeline\n", + "\n", + "This code then takes the fight data and creates the graph structure required by\n", + "FalkorDB to link things together.\n", + "\n", + "It then uses the Hamilton construct to iterate over each fight and push that individually\n", + "to FalkorDB." + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "id": "b97f10cd9937d5dd", + "metadata": { + "ExecuteTime": { + "end_time": "2024-05-26T05:44:01.899490Z", + "start_time": "2024-05-26T05:44:01.430713Z" + } + }, + "source": [ + "%%cell_to_module -m load_fights --display\n", + "\n", + "import pandas as pd\n", + "import utils\n", + "from hamilton.htypes import Parallelizable, Collect\n", + "import falkordb\n", + "\n", + "def raw_total_fight_data() -> pd.DataFrame:\n", + " \"\"\"Loads the raw fight data\"\"\"\n", + " _df = pd.read_csv('../data/raw_total_fight_data.csv', delimiter=\";\")\n", + " return _df\n", + "\n", + "def transformed_data(raw_total_fight_data: pd.DataFrame) -> pd.DataFrame:\n", + " \"\"\"Does some light transformation on the data and adds some columns\"\"\"\n", + " _df = raw_total_fight_data\n", + " _df.last_round = _df.last_round.astype(int)\n", + " _df.last_round_time = _df.last_round_time.apply(lambda x: utils.time_to_seconds(x))\n", + " _df.date = _df.date.apply(lambda x: utils.date_to_timestamp(x))\n", + " _df[\"Loser\"] = _df.apply(\n", + " lambda x: x[\"B_fighter\"] if x[\"Winner\"] == x[\"R_fighter\"] else x[\"R_fighter\"], axis=1)\n", + " return _df\n", + "\n", + "\n", + "def columns_of_interest() -> list[str]:\n", + " \"\"\"Returns the columns that we're interested in processing\"\"\"\n", + " return [\n", + " \"R_fighter\", \"B_fighter\", \n", + " # R_KD, B_KD, R_SIG_STR.,B_SIG_STR.,\n", + " # R_SIG_STR_pct, B_SIG_STR_pct, R_TOTAL_STR., B_TOTAL_STR.,\n", + " # R_TD, B_TD, R_TD_pct, B_TD_pct, R_SUB_ATT, B_SUB_ATT,\n", + " # R_REV, B_REV, R_CTRL, B_CTRL, R_HEAD, B_HEAD, R_BODY,\n", + " # B_BODY, R_LEG, B_LEG, R_DISTANCE, B_DISTANCE, R_CLINCH,\n", + " # B_CLINCH, R_GROUND, B_GROUND, win_by, \n", + " \"last_round\",\n", + " \"last_round_time\", \"Format\", \"Referee\", \"date\", \"location\",\n", + " \"Fight_type\", \"Winner\", \"Loser\"\n", + " ]\n", + "\n", + "\n", + "def fight(transformed_data: pd.DataFrame, \n", + " columns_of_interest: list[str],\n", + " ) -> Parallelizable[pd.Series]:\n", + " \"\"\"Enables us to process each fight. We pass in a client along with each row\"\"\"\n", + " for _idx, _row in transformed_data[columns_of_interest].iterrows():\n", + " yield _row\n", + "\n", + "def write_to_graph(fight: pd.Series, graph: falkordb.Graph) -> str:\n", + " _row, _graph = fight, graph\n", + " # create referee\n", + " q = \"MERGE (:Referee {Name: $name})\"\n", + " _graph.query(q, {'name': _row.Referee if isinstance(_row.Referee, str) else \"\"})\n", + "\n", + " # create card\n", + " q = \"MERGE (c:Card {Date: $date, Location: $location})\"\n", + " _graph.query(q, {'date': _row.date, 'location': _row.location})\n", + "\n", + " # create fight\n", + " q = \"\"\"MATCH (c:Card {Date: $date, Location: $location})\n", + " MATCH (ref:Referee {Name: $referee})\n", + " MATCH (r:Fighter {Name:$R_fighter})\n", + " MATCH (b:Fighter {Name:$B_fighter})\n", + " CREATE (f:Fight)-[:PART_OF]->(c)\n", + " SET f = $fight\n", + " CREATE (f)-[:RED]->(r)\n", + " CREATE (f)-[:BLUE]->(b)\n", + " CREATE (ref)-[:REFEREED]->(f)\n", + " RETURN ID(f)\n", + " \"\"\"\n", + " f_id = _graph.query(q, {'date': _row.date, 'location': _row.location,\n", + " 'referee': _row.Referee if isinstance(_row.Referee, str) else \"\", 'R_fighter': _row.R_fighter,\n", + " 'B_fighter': _row.B_fighter, 'fight': {'Last_round': _row.last_round,\n", + " 'Last_round_time': _row.last_round_time, 'Format': _row.Format,\n", + " 'Fight_type': _row.Fight_type}\n", + " }).result_set[0][0]\n", + " \n", + " # mark winner & loser\n", + " q = \"\"\"MATCH (f:Fight) WHERE ID(f) = $fight_id\n", + " MATCH (l:Fighter {Name:$loser})\n", + " MATCH (w:Fighter {Name:$winner})\n", + " CREATE (w)-[:WON]->(f), (l)-[:LOST]->(f)\n", + " \"\"\"\n", + " _graph.query(q, {'fight_id': f_id, 'loser': _row.Loser, 'winner': _row.Winner if isinstance(_row.Winner, str) else \"\"})\n", + " return \"success\"\n", + "\n", + "def collect_writes(write_to_graph: Collect[str]) -> int:\n", + " return len(list(write_to_graph))" + ], + "outputs": [] + }, + { + "cell_type": "markdown", + "id": "235966ca-f05d-441e-aa99-27c1e1f6802a", + "metadata": {}, + "source": [ + "# Exercise the pipelines\n", + "\n", + "We set up the requisite objects and clients to run the pipelines." + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "id": "357252c5857a3f7b", + "metadata": { + "ExecuteTime": { + "end_time": "2024-05-26T05:44:05.459158Z", + "start_time": "2024-05-26T05:44:05.448476Z" + } + }, + "source": [ + "import falkordb\n", + "from hamilton import driver\n", + "from hamilton.execution import executors\n", + "\n", + "db = falkordb.FalkorDB(host='localhost', port=6379)\n", + "g = db.select_graph(\"UFC\")\n", + "\n", + "# Clear previous graph\n", + "if \"UFC\" in db.list_graphs():\n", + " g.delete()" + ], + "outputs": [] + }, + { + "cell_type": "markdown", + "id": "f200ae21-1ab3-4bb8-ada1-876ddbd1fb5f", + "metadata": {}, + "source": [ + "### Note about the Hamilton UI\n", + "Hamilton comes with an [open source UI](https://hamilton.dagworks.io/en/latest/hamilton-ui/) that you can\n", + "surface information about your Hamilton executions. If you pull the docker containers\n", + "locally and uncomment adding the HamiltonTracker, then you'll see runs logged to it." + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "id": "ec7e41c83b69311c", + "metadata": { + "ExecuteTime": { + "end_time": "2024-05-26T05:44:33.832688Z", + "start_time": "2024-05-26T05:44:06.038046Z" + } + }, + "source": [ + "# if you have the Hamilton UI you can see progress:\n", + "# from hamilton_sdk import adapters\n", + "# tracker = adapters.HamiltonTracker(\n", + "# project_id=44, # modify this as needed\n", + "# username=\"elijah@example.com\",\n", + "# dag_name=\"load_fighters\",\n", + "# tags={\"environment\": \"DEV\", \"team\": \"MY_TEAM\", \"version\": \"X\"}\n", + "# )\n", + "\n", + "\n", + "# build the hamilton Driver\n", + "fighter_loader = (\n", + " driver.Builder()\n", + " .with_modules(load_fighters)\n", + " .enable_dynamic_execution(allow_experimental_mode=True)\n", + " .with_remote_executor(executors.MultiThreadingExecutor(5))\n", + " # .with_adapters(tracker) # <--- uncomment this to add tracker.\n", + " .build()\n", + ")\n", + "\n", + "fighter_loader.execute([\"write_to_graph\"], inputs={\"graph\": g})" + ], + "outputs": [] + }, + { + "cell_type": "code", + "execution_count": 9, + "id": "3b703eeb5a360", + "metadata": { + "ExecuteTime": { + "end_time": "2024-05-26T05:49:42.579219Z", + "start_time": "2024-05-26T05:44:33.835479Z" + } + }, + "source": [ + "# if you have the Hamilton UI you can see progress:\n", + "# from hamilton_sdk import adapters\n", + "# tracker = adapters.HamiltonTracker(\n", + "# project_id=44, # modify this as needed\n", + "# username=\"elijah@example.com\",\n", + "# dag_name=\"load_fights\",\n", + "# tags={\"environment\": \"DEV\", \"team\": \"MY_TEAM\", \"version\": \"X\"}\n", + "# )\n", + "\n", + "fights_loader = (\n", + " driver.Builder()\n", + " .with_modules(load_fights)\n", + " .enable_dynamic_execution(allow_experimental_mode=True)\n", + " .with_remote_executor(executors.MultiThreadingExecutor(5)) # this will do 5 concurrent inserts\n", + " # .with_adapters(tracker) # <--- uncomment this to add tracker.\n", + " .build()\n", + ")\n", + "fights_loader.execute([\"collect_writes\"], inputs={\"graph\": g})" + ], + "outputs": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "59e6ba771b3563f2", + "metadata": { + "ExecuteTime": { + "end_time": "2024-05-26T05:49:42.591409Z", + "start_time": "2024-05-26T05:49:42.580724Z" + } + }, + "source": [], + "outputs": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7981e2c8294873e5", + "metadata": {}, + "source": [], + "outputs": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.13" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} \ No newline at end of file diff --git a/examples/hamilton-integration/notebook.ipynb b/examples/hamilton-integration/notebook.ipynb index f7f021643..4ac8bc26c 100644 --- a/examples/hamilton-integration/notebook.ipynb +++ b/examples/hamilton-integration/notebook.ipynb @@ -24,7 +24,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "# Use the 2-layer approach for a maintainable RAG system [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/dagworks-inc/burr/blob/main/examples/hamilton-integration/notebook.ipynb) [![GitHub badge](https://img.shields.io/badge/github-view_source-2b3137?logo=github)](https://github.com/dagworks-inc/burr/blob/main/examples/hamilton-integration/notebook.ipynb)\n", + "# Use the 2-layer approach for a maintainable RAG system [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/dagworks-inc/burr/blob/main/examples/hamilton-integration/notebook.ipynb) [![GitHub badge](https://img.shields.io/badge/github-view_source-2b3137?logo=github)](https://github.com/apache/burr/blob/main/examples/hamilton-integration/notebook.ipynb)\n", "\n", "Ready-made solutions can get you started with GenAI, but building reliable product features with retrieval augmented generation (RAG) and LLM agents inevitably required custom code. This post shares the 2-layer approach to build a maintainable RAG application that will evolve with your needs. To illustrate these ideas, we will show how a typical RAG project might evolve.\n", "\n", @@ -669,7 +669,7 @@ "\n", "In th next snippets, we refactor actions using Hamilton, a lightweight library to structure data transformations as directed acyclic graphs (DAGs). Hamilton uses the function and parameter names to infer the dependencies between functions and the graph structure.\n", "\n", - "The next cell reimplements the `ingest_blog` action from `V2`. It uses `%%cell_to_module` from the Hamilton notebook extension to define a DAG in a single cell and view it ([see tutorial](https://github.com/DAGWorks-Inc/hamilton/blob/main/examples/jupyter_notebook_magic/example.ipynb))." + "The next cell reimplements the `ingest_blog` action from `V2`. It uses `%%cell_to_module` from the Hamilton notebook extension to define a DAG in a single cell and view it ([see tutorial](https://github.com/apache/hamilton/blob/main/examples/jupyter_notebook_magic/example.ipynb))." ] }, { diff --git a/examples/image-telephone/README.md b/examples/image-telephone/README.md index e618b0447..ea72ab784 100644 --- a/examples/image-telephone/README.md +++ b/examples/image-telephone/README.md @@ -29,7 +29,7 @@ that talks to itself to do something fun. The game is simple: 2. That caption is then provided to DALL-E, which generates an image based on the caption, which is saved to state. 3. The loop repeats -- and you have encoded the game of telephone! -Specifically, each action here in Burr is delegated to the [Hamilton](https://github.com/dagworks-inc/hamilton) micro-framework to run. +Specifically, each action here in Burr is delegated to the [Hamilton](https://github.com/apache/hamilton) micro-framework to run. Hamilton is a great replacement for tools like LCEL, because it's built to provide a great SDLC experience, in addition to being lightweight, extensible and more general purpose (e.g. it's great for expressing things data processing, ML, and web-request logic). We're using @@ -71,5 +71,5 @@ documentation for the Hamilton dataflows that are used: [captioning](https://hub template by overriding values, or by copying the code and modifying it yourself in 2 minutes - see instructions on the [hub](https://hub.dagworks.io/). ## Hamilton code -For more details on the [Hamilton](https://github.com/dagworks-inc/hamilton) code and -this [streamlit app](https://image-telephone.streamlit.app) see [this example in the Hamilton repo.](https://github.com/DAGWorks-Inc/hamilton/tree/main/examples/LLM_Workflows/image_telephone) +For more details on the [Hamilton](https://github.com/apache/hamilton) code and +this [streamlit app](https://image-telephone.streamlit.app) see [this example in the Hamilton repo.](https://github.com/apache/hamilton/tree/main/examples/LLM_Workflows/image_telephone) diff --git a/examples/ml-training/README.md b/examples/ml-training/README.md index 993030329..4b02e3934 100644 --- a/examples/ml-training/README.md +++ b/examples/ml-training/README.md @@ -19,7 +19,7 @@ # ML Training -This is a WIP! Please contribute back if you have ideas. You can track the associated issue [here](https://github.com/DAGWorks-Inc/burr/issues/138). +This is a WIP! Please contribute back if you have ideas. You can track the associated issue [here](https://github.com/apache/burr/issues/138). A machine learning training system can easily be modeled as a state machine. @@ -52,7 +52,7 @@ you can use Burr hooks to log metrics, visualize, etc... at each step. This allo While some models are trained in a single-shot and shipped to production, many require human input. Burr can be used to express training, then checkpoint/pause the state while a human is evaluating it, -and have their input (e.g. go/no-go) passed in as an [input parameter](https://burr.dagworks.io/concepts/actions/#runtime-inputs). +and have their input (e.g. go/no-go) passed in as an [input parameter](https://burr.apache.org/concepts/actions/#runtime-inputs). Note that this still requires a scheduling tool (say a task executor that runs until the next human input is needed), but that task executor does not need to be complicated (all it needs to do is run a job when prompted, and possibly on a chron schedule). diff --git a/examples/multi-agent-collaboration/README.md b/examples/multi-agent-collaboration/README.md index 3638c2ee8..ecd6c18a5 100644 --- a/examples/multi-agent-collaboration/README.md +++ b/examples/multi-agent-collaboration/README.md @@ -23,7 +23,7 @@ This example resembles the example from following [cookbook](https://github.com/ There are two implementations: -1. `hamilton/` -- this uses [Hamilton](https://github.com/dagworks-inc/hamilton) inside the defined actions. +1. `hamilton/` -- this uses [Hamilton](https://github.com/apache/hamilton) inside the defined actions. 2. `lcel/` -- this uses LangChain's LCEL inside the defined actions. # `hamilton/application.py` vs `lcel/application.py`: diff --git a/examples/multi-agent-collaboration/hamilton/README.md b/examples/multi-agent-collaboration/hamilton/README.md index 6b612b6fd..097885c95 100644 --- a/examples/multi-agent-collaboration/hamilton/README.md +++ b/examples/multi-agent-collaboration/hamilton/README.md @@ -27,7 +27,7 @@ With Hamilton the prompts can be found in the module [`func_agent.py`](func_agen The Hamilton code creates the following dataflow: -![dataflow](https://github.com/DAGWorks-Inc/burr/assets/2328071/24822ee5-f05b-4fa4-95e7-daa23969cfff) +![dataflow](https://github.com/apache/burr/assets/2328071/24822ee5-f05b-4fa4-95e7-daa23969cfff) # Tracing diff --git a/examples/multi-modal-chatbot/burr_demo.ipynb b/examples/multi-modal-chatbot/burr_demo.ipynb index 5af9f21fb..301795c7c 100644 --- a/examples/multi-modal-chatbot/burr_demo.ipynb +++ b/examples/multi-modal-chatbot/burr_demo.ipynb @@ -33,7 +33,7 @@ " +\n", "\n", "\n", - "[https://github.com/dagworks-inc/burr](https://github.com/dagworks-inc/burr) by DAGWorks Inc. (YCW23 & StartX).\n", + "[https://github.com/apache/burr](https://github.com/apache/burr).\n", "\n", "Take🏠:\n", "\n", @@ -96,7 +96,7 @@ "metadata": {}, "source": [ "# Solution: Burr\n", - "(Complements our other framework [Hamilton](https://github.com/dagWorks-Inc/hamilton))\n" + "(Complements our other framework [Hamilton](https://github.com/apache/hamilton))\n" ] }, { @@ -1016,7 +1016,7 @@ "\n", "[Link to video walking through this notebook](https://youtu.be/hqutVJyd3TI).\n", "\n", - "[https://github.com/dagworks-inc/burr](https://github.com/dagworks-inc/burr)\n", + "[https://github.com/apache/burr](https://github.com/apache/burr)\n", "\n", "\n", "[Time Travel blog post & video:](https://blog.dagworks.io/p/travel-back-in-time-with-burr)\n", @@ -1027,10 +1027,10 @@ "\n", "More blogs @ `blog.dagworks.io` e.g. [async & streaming](https://blog.dagworks.io/p/streaming-chatbot-with-burr-fastapi)\n", "\n", - "More [examples](https://github.com/DAGWorks-Inc/burr/tree/main/examples/):\n", + "More [examples](https://github.com/apache/burr/tree/main/examples/):\n", "\n", - "- e.g. [test case creation](https://burr.dagworks.io/examples/guardrails/creating_tests/)\n", - "- e.g. [multi-agent collaboration](https://github.com/DAGWorks-Inc/burr/tree/main/examples/multi-agent-collaboration)\n", + "- e.g. [test case creation](https://burr.apache.org/examples/guardrails/creating_tests/)\n", + "- e.g. [multi-agent collaboration](https://github.com/apache/burr/tree/main/examples/multi-agent-collaboration)\n", "\n", "Follow on Twitter & LinkedIn:\n", "\n", diff --git a/examples/opentelemetry/README.md b/examples/opentelemetry/README.md index d0c18c6ca..f5b67f401 100644 --- a/examples/opentelemetry/README.md +++ b/examples/opentelemetry/README.md @@ -29,4 +29,4 @@ We have two modes: See [notebook.ipynb](./notebook.ipynb) for a simple overview. See [application.py](./application.py) for the full code -See the [documentation](https://burr.dagworks.io/concepts/additional-visibility/#open-telemetry) for more info +See the [documentation](https://burr.apache.org/concepts/additional-visibility/#open-telemetry) for more info diff --git a/examples/opentelemetry/notebook.ipynb b/examples/opentelemetry/notebook.ipynb index f91424b00..925e548a6 100644 --- a/examples/opentelemetry/notebook.ipynb +++ b/examples/opentelemetry/notebook.ipynb @@ -26,7 +26,7 @@ "source": [ "# OpenTelemetry\n", "\n", - "In this notebook we'll instrument a simple Burr app with [OpenTelemetry](www.opentelemetry.io). See the [docs](https://burr.dagworks.io/concepts/additional-visibility/) for more information." + "In this notebook we'll instrument a simple Burr app with [OpenTelemetry](www.opentelemetry.io). See the [docs](https://burr.apache.org/concepts/additional-visibility/) for more information." ] }, { diff --git a/examples/parallelism/README.md b/examples/parallelism/README.md index 6365172d2..884a3e551 100644 --- a/examples/parallelism/README.md +++ b/examples/parallelism/README.md @@ -19,7 +19,7 @@ # Parallelism -In this example we go over Burr's parallelism capabilities. It is based on the documentation (https://burr.dagworks.io/concepts/parallelism/), demonstrating the `MapStates` capabilities. +In this example we go over Burr's parallelism capabilities. It is based on the documentation (https://burr.apache.org/concepts/parallelism/), demonstrating the `MapStates` capabilities. See [the notebook](./notebook.ipynb) for the full example. Or Open In Colab diff --git a/examples/parallelism/notebook.ipynb b/examples/parallelism/notebook.ipynb index ac2f3391d..025ce255a 100644 --- a/examples/parallelism/notebook.ipynb +++ b/examples/parallelism/notebook.ipynb @@ -8,7 +8,7 @@ "\n", " \"Open\n", " \n", - "or view source\n", + "or view source\n", "\n", "For a video walkthrough of this notebook click here." ] @@ -33,13 +33,13 @@ "\n", "Burr is all about thinking and modeling things as a \"graph\" or \"flowchart\". This just so happens to be a great way to model agents. This modeling also lends itself well to modeling \"hierarchy/recursion\" and \"parallelism\", which are key in building more complex interactions and agent systems.\n", "\n", - "In this notebook we're going to go over how to run parallel \"actions\", which could be as simple as a single \"action\", or even \"whole burr sub-applications themselves\" (a.k.a. \"sub-agents\"). For full documentation on Parallelism see [this page](https://burr.dagworks.io/concepts/parallelism/); if you're familliar with the [`map-reduce`](https://en.wikipedia.org/wiki/MapReduce) pattern, then you'll feel right at home here.\n", + "In this notebook we're going to go over how to run parallel \"actions\", which could be as simple as a single \"action\", or even \"whole burr sub-applications themselves\" (a.k.a. \"sub-agents\"). For full documentation on Parallelism see [this page](https://burr.apache.org/concepts/parallelism/); if you're familliar with the [`map-reduce`](https://en.wikipedia.org/wiki/MapReduce) pattern, then you'll feel right at home here.\n", "\n", "We will start simple and show how to write a simple Burr application that compares different LLMs for the same prompt & context. We'll then extend what we parallelize to be a whole burr sub-application/agent. \n", "\n", "To start:\n", "1. we will not use Burr's parallelism or recursion constructs to help build your mental model.\n", - "2. we will then show Burr's [\"recursion/hierarchy\" capabilities](https://burr.dagworks.io/concepts/recursion/).\n", + "2. we will then show Burr's [\"recursion/hierarchy\" capabilities](https://burr.apache.org/concepts/recursion/).\n", "3. we will then show how Burr's parallelism constructs simplify things.\n", "4. we will then show how Burr's parallelism constructs enable you to more easily model more complex behavior.\n", "\n", @@ -418,7 +418,7 @@ "\n", "Burr allows you to create Burr applications within Burr applications and wire through tracking to the UI so you can visualize sub-applications. For this, we will be representing the LLM calls with different models as their own (single-node) application. While this is built for more complex sub-application shapes, and is a bit of overkill for our toy example, it still works quite well with the simplicity of a single action (node) application. My point here is that you could add more actions to the application very easily and do more complex operations and model hierarchy than what we're doing here. The Burr sub-applications/graphs can be used independently elsewhere.\n", "\n", - "For more on the code constructs in this section see Burr's [recursive/hierarchy tracking capabilities](https://burr.dagworks.io/concepts/recursion/)." + "For more on the code constructs in this section see Burr's [recursive/hierarchy tracking capabilities](https://burr.apache.org/concepts/recursion/)." ] }, { @@ -611,9 +611,9 @@ "source": [ "# Approach #3 -- using Burr's Parallel constructs\n", "\n", - "We can use Burr's parallel construct to make running the differnet LLMs in parallel even simpler. To do so we need to bring in a Class that extends from `MapStates` (we can also map over actions with [`MapActions`](https://burr.dagworks.io/reference/parallelism/#burr.core.parallelism.MapActions) and both state & actions with [`MapStateAndActions`](https://burr.dagworks.io/reference/parallelism/#burr.core.parallelism.MapActionsAndStates)). This Class enables us to \"map\" over state -- in this case, the Class will return the same Action for each model in the `models` field, enabling you to run the models in parallel. Underneath, Burr will create the Burr Applications and run them in parallel. \n", + "We can use Burr's parallel construct to make running the differnet LLMs in parallel even simpler. To do so we need to bring in a Class that extends from `MapStates` (we can also map over actions with [`MapActions`](https://burr.apache.org/reference/parallelism/#burr.core.parallelism.MapActions) and both state & actions with [`MapStateAndActions`](https://burr.apache.org/reference/parallelism/#burr.core.parallelism.MapActionsAndStates)). This Class enables us to \"map\" over state -- in this case, the Class will return the same Action for each model in the `models` field, enabling you to run the models in parallel. Underneath, Burr will create the Burr Applications and run them in parallel. \n", "\n", - "For more on the code constructs in this section see Burr's [parallel map/reduce concepts](https://burr.dagworks.io/concepts/parallelism/)." + "For more on the code constructs in this section see Burr's [parallel map/reduce concepts](https://burr.apache.org/concepts/parallelism/)." ] }, { @@ -809,7 +809,7 @@ "source": [ "# #4 - Building more complex Burr Applications\n", "\n", - "Above we showed a progression on how you can tackle parallelism with Burr. Here we discuss and show sketches of examples that get more complex. Note: see [docs on executors](https://burr.dagworks.io/reference/application/#burr.core.application.ApplicationBuilder.with_parallel_executor) (and roadmap) as to what is supported right now.\n", + "Above we showed a progression on how you can tackle parallelism with Burr. Here we discuss and show sketches of examples that get more complex. Note: see [docs on executors](https://burr.apache.org/reference/application/#burr.core.application.ApplicationBuilder.with_parallel_executor) (and roadmap) as to what is supported right now.\n", "\n", "For example, you might want to take the same input, and map over several Burr applications/agents in parallel, e.g. for medical diagnosis.\n", "Or you might want to map over some value in state and run the same application/agent on it, e.g. web-interactions.\n", @@ -1398,7 +1398,7 @@ "metadata": {}, "source": [ "# To close\n", - "We're excited by what you can now model and importantly observe & iterate with Burr + the Burr UI (e.g. see [test-case creation](https://burr.dagworks.io/examples/guardrails/creating_tests/), [time-travel](https://blog.dagworks.io/p/travel-back-in-time-with-burr), or [annotation](https://blog.dagworks.io/p/annotating-data-in-burr?r=2cg5z1&utm_campaign=post&utm_medium=web)). \n", + "We're excited by what you can now model and importantly observe & iterate with Burr + the Burr UI (e.g. see [test-case creation](https://burr.apache.org/examples/guardrails/creating_tests/), [time-travel](https://blog.dagworks.io/p/travel-back-in-time-with-burr), or [annotation](https://blog.dagworks.io/p/annotating-data-in-burr?r=2cg5z1&utm_campaign=post&utm_medium=web)). \n", "\n", "We have an active roadmap planned (we're looking for contributors!), and if you like what you see, have thoughts / or questions, please drop by our discord community -> [![Discord](https://img.shields.io/badge/Join-Burr_Discord-7289DA?logo=discord)](https://discord.gg/6Zy2DwP4f3)" ] diff --git a/examples/pytest/README.md b/examples/pytest/README.md index 788bffc6f..2900fa882 100644 --- a/examples/pytest/README.md +++ b/examples/pytest/README.md @@ -207,7 +207,7 @@ def test_my_agent(input, expected_output, results_bag): ### Using Burr's pytest Hook With Burr you can curate test cases from real application runs. You can then use these test cases in your pytest suite. Burr has a hook that enables you to curate a file with the input state and expected output state for an entire run, -or a single action. See the [Burr test case creation documentation](https://burr.dagworks.io/examples/guardrails/creating_tests/) for more +or a single action. See the [Burr test case creation documentation](https://burr.apache.org/examples/guardrails/creating_tests/) for more details on how. Here we show you how you can combine this with getting results: ```python diff --git a/examples/recursive/README.md b/examples/recursive/README.md index cc2532cf7..bf04f0e14 100644 --- a/examples/recursive/README.md +++ b/examples/recursive/README.md @@ -55,5 +55,5 @@ Run the example with `python application.py`. Then, ensure `burr` is running, an UI: [http://localhost:7241/project/demo:parallelism_poem_generation](http://localhost:7241/project/demo:parallelism_poem_generation). -FOr more information, read the documentation on [recursive applications](https://burr.dagworks.io/concepts/recursion). +FOr more information, read the documentation on [recursive applications](https://burr.apache.org/concepts/recursion). ``` diff --git a/examples/simple-chatbot-intro/notebook.ipynb b/examples/simple-chatbot-intro/notebook.ipynb index 5fa24b113..c122b73bc 100644 --- a/examples/simple-chatbot-intro/notebook.ipynb +++ b/examples/simple-chatbot-intro/notebook.ipynb @@ -356,7 +356,7 @@ "\n", "To add a persistor, you have to tell it to load from a state (`.initialize(...)`) on the builder, and tell it to save to a state (`.with_state_persister`).\n", "\n", - "More about persistence [here](https://burr.dagworks.io/concepts/state-persistence/)." + "More about persistence [here](https://burr.apache.org/concepts/state-persistence/)." ] }, { diff --git a/examples/simulation/README.md b/examples/simulation/README.md index 571a21702..547afbbae 100644 --- a/examples/simulation/README.md +++ b/examples/simulation/README.md @@ -19,7 +19,7 @@ # Simulations -This example is a WIP -- we're actively looking for contributors + ideas. See [this issue](https://github.com/DAGWorks-Inc/burr/issues/136) to track. +This example is a WIP -- we're actively looking for contributors + ideas. See [this issue](https://github.com/apache/burr/issues/136) to track. At a high level, simulations generally run over a set of time steps and maintain state. The user then manages the state, which becomes the input to the next time step, as well as output data to analyze. @@ -47,7 +47,7 @@ This is a special case of time-series forecasting, in which one wants to simulat - `construct_portfolio` - uses the forecast to construct a portfolio - `evaluate_portfolio` - evaluates the portfolio -Each one of these could be a DAG using [Hamilton](https://github.com/dagworks-inc/hamilton), or running any custom code. +Each one of these could be a DAG using [Hamilton](https://github.com/apache/hamilton), or running any custom code. ### Multi-agent simulation @@ -56,4 +56,4 @@ For multiple independent "agents", Burr could help model the way they interact. actions, or an action that loops over all "users". We are still figuring out the best way to model this, so reach out if you have ideas! -Please comment at [this issue](https://github.com/DAGWorks-Inc/burr/issues/136) if you have any opinions on the above! We would love user-contributed examples. +Please comment at [this issue](https://github.com/apache/burr/issues/136) if you have any opinions on the above! We would love user-contributed examples. diff --git a/examples/streaming-fastapi/README.md b/examples/streaming-fastapi/README.md index 74c9d2b38..de47de1ee 100644 --- a/examples/streaming-fastapi/README.md +++ b/examples/streaming-fastapi/README.md @@ -35,7 +35,7 @@ or do one of the following: 3. Generate a poem 4. Prompt for more -It will use an LLM to decide which to do. It streams back text using async streaming in Burr. Read more about how that is implemented [here](https://burr.dagworks.io/concepts/streaming-actions/). +It will use an LLM to decide which to do. It streams back text using async streaming in Burr. Read more about how that is implemented [here](https://burr.apache.org/concepts/streaming-actions/). Note that, even though not every response is streaming (E.G. unsafe response, which is hardcoded), they are modeled as streaming to make interaction with the app simpler. @@ -59,7 +59,7 @@ Navigate to the [streaming example](http://localhost:7241/demos/streaming-chatbo ## Streaming in Burr -Read more [here](https://burr.dagworks.io/concepts/streaming-actions/) +Read more [here](https://burr.apache.org/concepts/streaming-actions/) To use streaming in Burr, you write your actions as a generator. If you're using the function-based API (as we do in this example), the function should yield a tuple, consisting of: 1. The result (intermediate or final) diff --git a/examples/streaming-fastapi/notebook.ipynb b/examples/streaming-fastapi/notebook.ipynb index a4a813eea..791b15c86 100644 --- a/examples/streaming-fastapi/notebook.ipynb +++ b/examples/streaming-fastapi/notebook.ipynb @@ -43,7 +43,7 @@ "This notebook only shows the streaming side. To check out FastAPI in Burr, check out\n", "- The [Burr code](./application.py) -- imported and used here\n", "- The [backend FastAPI server](./server.py) for the streaming output using SSE\n", - "- The [frontend typescript code](https://github.com/dagworks-inc/burr/blob/main/telemetry/ui/src/examples/StreamingChatbot.tsx) that renders and interacts with the stream\n", + "- The [frontend typescript code](https://github.com/apache/burr/blob/main/telemetry/ui/src/examples/StreamingChatbot.tsx) that renders and interacts with the stream\n", "\n", "You can view this demo in your app by running Burr:\n", "\n", @@ -83,7 +83,7 @@ "3. Generate a poem\n", "4. Prompt for more\n", "\n", - "It will use an LLM to decide which to do. It streams back text using async streaming in Burr. Read more about how that is implemented [here](https://burr.dagworks.io/concepts/streaming-actions/).\n", + "It will use an LLM to decide which to do. It streams back text using async streaming in Burr. Read more about how that is implemented [here](https://burr.apache.org/concepts/streaming-actions/).\n", "\n", "Note that, even though not every response is streaming (E.G. unsafe response, which is hardcoded), they are modeled as streaming to make interaction with the app simpler." ] diff --git a/examples/tracing-and-spans/README.md b/examples/tracing-and-spans/README.md index 13b7aeb65..0d6ba25d3 100644 --- a/examples/tracing-and-spans/README.md +++ b/examples/tracing-and-spans/README.md @@ -20,7 +20,7 @@ # Traces and spans This demo covers the tracing/span capabilities in Burr. -For additional information, read over: [the documentation](https://burr.dagworks.io/concepts/additional-visibility/). +For additional information, read over: [the documentation](https://burr.apache.org/concepts/additional-visibility/). This does the same thing as the standard [multi-modal example](../multi-modal-chatbot), but leverages traces. Note that you'll likely be integrating tracing into whatever framework (langchain/hamilton) you're using -- we're @@ -30,6 +30,6 @@ These traces are used in the Burr UI. E.G. as follows: ![tracing](tracing_screencap.png) -The notebook also shows how things work. +The notebook also shows how things work. Open In Colab diff --git a/examples/tracing-and-spans/burr_otel_demo.ipynb b/examples/tracing-and-spans/burr_otel_demo.ipynb index bbb87458b..e17a03643 100644 --- a/examples/tracing-and-spans/burr_otel_demo.ipynb +++ b/examples/tracing-and-spans/burr_otel_demo.ipynb @@ -12,7 +12,7 @@ " + \n", "\n", "\n", - "[https://github.com/dagworks-inc/burr](https://github.com/dagworks-inc/burr) by DAGWorks Inc. (YCW23 & StartX).\n", + "[https://github.com/apache/burr](https://github.com/apache/burr).\n", "\n", "Take🏠:\n", "\n", @@ -72,7 +72,7 @@ "metadata": {}, "source": [ "# Solution: Burr\n", - "(Complements our other framework [Hamilton](https://github.com/dagWorks-Inc/hamilton))\n" + "(Complements our other framework [Hamilton](https://github.com/apache/hamilton))\n" ] }, { @@ -949,7 +949,7 @@ "\n", "[Link to video walking through this notebook](https://youtu.be/hqutVJyd3TI).\n", "\n", - "[https://github.com/dagworks-inc/burr](https://github.com/dagworks-inc/burr)\n", + "[https://github.com/apache/burr](https://github.com/apache/burr)\n", "\n", "\n", "[Time Travel blog post & video:](https://blog.dagworks.io/p/travel-back-in-time-with-burr)\n", @@ -960,10 +960,10 @@ "\n", "More blogs @ `blog.dagworks.io` e.g. [async & streaming](https://blog.dagworks.io/p/streaming-chatbot-with-burr-fastapi)\n", "\n", - "More [examples](https://github.com/DAGWorks-Inc/burr/tree/main/examples/):\n", + "More [examples](https://github.com/apache/burr/tree/main/examples/):\n", "\n", - "- e.g. [test case creation](https://burr.dagworks.io/examples/guardrails/creating_tests/)\n", - "- e.g. [multi-agent collaboration](https://github.com/DAGWorks-Inc/burr/tree/main/examples/multi-agent-collaboration)\n", + "- e.g. [test case creation](https://burr.apache.org/examples/guardrails/creating_tests/)\n", + "- e.g. [multi-agent collaboration](https://github.com/apache/burr/tree/main/examples/multi-agent-collaboration)\n", "\n", "Follow on Twitter & LinkedIn:\n", "\n", diff --git a/examples/web-server/README.md b/examples/web-server/README.md index da8172898..20253933a 100644 --- a/examples/web-server/README.md +++ b/examples/web-server/README.md @@ -175,7 +175,7 @@ they can debug any state-related issues, ensuring a smooth user experience. Note that we never called out to databases. It all just magically worked.. This is all because we decouple the persistence layer from the web-call. The application will be persisted (to whatever database you want), -by burr's plugin capabilities -- read more [here](https://burr.dagworks.io/concepts/state-persistence/). +by burr's plugin capabilities -- read more [here](https://burr.apache.org/concepts/state-persistence/). This greatly reduces the amount you have to think about when developing. As Burr persistence is pluggable, you can write to your own database with whichever schema you prefer, customizing the schema for your project or using a generic one (state is just a JSON object -- you can easily serialize/deseriealize it). @@ -209,13 +209,13 @@ Or possibly some combination of the above. #### Async While we implemented synchronous calls, you can easily make these async by using `async def` and `await` in the appropriate places, -and using the `arun` method in Burr. Read more about async capabilities in [applications](https://burr.dagworks.io/concepts/state-machine/), -and [actions](https://burr.dagworks.io/concepts/actions/). +and using the `arun` method in Burr. Read more about async capabilities in [applications](https://burr.apache.org/concepts/state-machine/), +and [actions](https://burr.apache.org/concepts/actions/). #### Streaming You can use streaming to send back the stream of the output at any given point. You do this by creating a -[streaming action](https://burr.dagworks.io/concepts/streaming-actions/). You can then integrate with the +[streaming action](https://burr.apache.org/concepts/streaming-actions/). You can then integrate with the streaming respose in FastAPI to send back the stream of the output. You can do this with any steps (intermediate or final) in your application. diff --git a/examples/youtube-to-social-media-post/notebook.ipynb b/examples/youtube-to-social-media-post/notebook.ipynb index cacaac34f..375be2496 100644 --- a/examples/youtube-to-social-media-post/notebook.ipynb +++ b/examples/youtube-to-social-media-post/notebook.ipynb @@ -799,7 +799,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Persistence is great for iterative development such as tuning your [Instructor model with validators and constraints](https://python.useinstructor.com/concepts/reask_validation/), but it's also a powerful tool for building [test cases and guard rails](https://burr.dagworks.io/examples/guardrails/creating_tests/). The CLI command `burr-test-case` can generate a `pytest.fixture` to resume your app from a given state." + "Persistence is great for iterative development such as tuning your [Instructor model with validators and constraints](https://python.useinstructor.com/concepts/reask_validation/), but it's also a powerful tool for building [test cases and guard rails](https://burr.apache.org/examples/guardrails/creating_tests/). The CLI command `burr-test-case` can generate a `pytest.fixture` to resume your app from a given state." ] }, { From c6c3c94e21a9c07b2ab85ac15d60717b5d3bfe77 Mon Sep 17 00:00:00 2001 From: Harish Kesava Rao Date: Mon, 16 Feb 2026 07:59:48 +0530 Subject: [PATCH 2/3] Add write permissions to docs.yml --- .github/workflows/docs.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 573046ac6..1080c7ca9 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -29,6 +29,7 @@ on: permissions: contents: write pull-requests: write + issues: write concurrency: ci-${{ github.ref }} From aadeddfa5129cd31874220702431b7a614203bb1 Mon Sep 17 00:00:00 2001 From: Stefan Krawczyk Date: Sun, 22 Feb 2026 06:17:32 +1100 Subject: [PATCH 3/3] Apply suggestion from @skrawcz update wording on readme about hamilton connection --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 96f019fda..ac155fc98 100644 --- a/README.md +++ b/README.md @@ -160,8 +160,7 @@ While Apache Burr is attempting something (somewhat) unique, there are a variety ## 🌯 Why the name Burr? Apache Burr is named after [Aaron Burr](https://en.wikipedia.org/wiki/Aaron_Burr), founding father, third VP of the United States, and murderer/arch-nemesis of [Alexander Hamilton](https://en.wikipedia.org/wiki/Alexander_Hamilton). -What's the connection with Hamilton? We imagine a world in which Burr and Hamilton lived in harmony and saw through their differences to better the union. We originally -built Apache Burr as a _harness_ to handle state between executions of Apache Hamilton DAGs (because DAGs don't have cycles), +What's the connection with (Apache) Hamilton? We imagine a world in which Burr and Hamilton lived in harmony and saw through their differences to better the union. Originally Apache Burr was built as a _harness_ to handle state between executions of Apache Hamilton DAGs (because DAGs don't have cycles), but realized that it has a wide array of applications and decided to release it more broadly. # Testimonials