Back to Prompt Library
implementation
Orchestrate Data Ingestion with Prefect and Report Generation
Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.
Linked challenge: Multi-Agent System for Commercial Real Estate Analysis
Format
Code-aware
Lines
22
Sections
8
Linked challenge
Multi-Agent System for Commercial Real Estate Analysis
Prompt source
Original prompt text with formatting preserved for inspection.
22 lines
8 sections
No variables
1 code block
Design a Prefect flow to orchestrate the data ingestion and preprocessing for your CRE analysis. This flow should fetch raw data (simulated from a file or API), clean it, and make it available for your AutoGen agents. Additionally, outline how the AutoGen system's final investment report can be automatically formatted and published (e.g., to a PDF or a web dashboard like Plotly Dash) once the agents complete their analysis. Show how Prefect would trigger the AutoGen analysis and collect its output.
```python
from prefect import flow, task
# import pandas as pd
# @task
# def fetch_raw_cre_data(source: str) -> pd.DataFrame:
# # Simulate fetching data
# return pd.DataFrame({'location': ['Austin', 'Seattle'], 'type': ['retail', 'office'], 'yield': [0.05, 0.04]})
# @task
# def preprocess_data(df: pd.DataFrame) -> dict:
# # Simulate preprocessing
# return df.set_index('location').to_dict('index')
# @flow
# def cre_analysis_pipeline(query: str):
# raw_data = fetch_raw_cre_data("external_api")
# processed_data = preprocess_data(raw_data)
# # Trigger AutoGen here, passing processed_data as context or tool input
# # final_report = autogen_manager.run_analysis(query, processed_data)
# # publish_report(final_report)
# if __name__ == "__main__":
# cre_analysis_pipeline(query="Analyze retail properties.")
```Adaptation plan
Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.
Keep stable
Hold the task contract and output shape stable so generated implementations remain comparable.
Tune next
Update libraries, interfaces, and environment assumptions to match the stack you actually run.
Verify after
Test failure handling, edge cases, and any code paths that depend on hidden context or secrets.