|
| 1 | +# AI News Agent |
| 2 | + |
| 3 | +This code sample enables creating an intelligent information summarization agent designed to help executives and decision-makers stay on top of the rapidly evolving world of artificial intelligence. By continuously scanning credible news sources, it identifies and summarizes the most impactful AI developments—especially those relevant to the Microsoft ecosystem, healthcare, and legal industries. |
| 4 | + |
| 5 | +The agent reduces information overload by prioritizing high-value updates and presenting them in a clear, digestible Markdown table format. Each summary includes a headline, date, key insight, strategic implications, and a verified source link. |
| 6 | + |
| 7 | +**AI News is not a replacement for human analysis or legal due diligence. Instead, it augments executive awareness by surfacing credible developments that may require further attention or discussion. All strategic decisions and compliance assessments remain the responsibility of the end user.** |
| 8 | + |
| 9 | + |
| 10 | +## 🎯 Use Cases |
| 11 | + |
| 12 | +1. **Daily Team Briefing:** Generate a morning digest of AI developments for Microsoft product teams. |
| 13 | +2. **Industry Watch:** Provide Healthcare or Legal compliance teams with up-to-the-minute AI news. |
| 14 | +3. **Executive Snapshot:** Deliver a concise AI highlights report to executives. |
| 15 | + |
| 16 | +## 🔍 What It Does |
| 17 | + |
| 18 | +- Searches Bing News via the BingGroundedSearchTool for the latest AI developments (last 24 hours PT) |
| 19 | +- Filters by publication date and credible domains (e.g., gartner.com, reuters.com, wired.com, mit.edu, stanford.edu) |
| 20 | +- Prioritizes items in this order: Microsoft+Healthcare → Microsoft+Legal → Healthcare → Legal |
| 21 | +- Summarizes each development and outlines implications for the three focus areas |
| 22 | +- Outputs in a Markdown table with columns: Headline, Date, Summary, Implications, Link |
| 23 | + |
| 24 | +## 🧠 Agent Instructions |
| 25 | + |
| 26 | +The agent follows a system prompt that enforces: |
| 27 | +- Source filtering against a predefined list of credible domains |
| 28 | +- Publication date constraint within the 24‑hour window |
| 29 | +- Priority order for topic groups |
| 30 | +- Consistent Markdown formatting for the output table |
| 31 | + |
| 32 | +## 🛠 Tools |
| 33 | + |
| 34 | +### BingGroundedSearchTool |
| 35 | +- **Description:** Queries Bing News for AI-related articles |
| 36 | +- **Auth:** Configured via `BING_SEARCH_KEY` environment variable (e.g., stored in Azure Key Vault) |
| 37 | +- **Reference:** OpenAPI schema provided in `tools/bing-grounded-search-schema.yaml` |
| 38 | + |
| 39 | +## 🧪 Sample Prompts |
| 40 | + |
| 41 | +- "What are the most impactful AI developments for Microsoft in the last 24 hours?" |
| 42 | +- "Summarize recent legal sector AI news." |
| 43 | +- "Healthcare-related AI breakthroughs today?" |
| 44 | + |
| 45 | +## Architecture Overview |
| 46 | +This agent uses Azure AI Projects with the BingGroundedSearchTool to query Bing News, applies filtering and prioritization logic in Python, summarizes via Azure OpenAI, and formats output as Markdown. |
| 47 | + |
| 48 | + |
| 49 | +## 📁 Example Notebook |
| 50 | + |
| 51 | +Refer to [`demo_ai_news_usage.ipynb`](./assets/demo_ai_news_usage.ipynb) for a guided walkthrough. |
| 52 | + |
| 53 | +## Setup Instructions |
| 54 | + |
| 55 | +### 1. Clone the repository |
| 56 | +```bash |
| 57 | +git clone https://github.com/your-org/azure-ai-agent-service-blueprints.git |
| 58 | +cd azure-ai-agent-service-blueprints/ai-news |
| 59 | +``` |
| 60 | + |
| 61 | +### 2. Provision Azure Resources with Bicep |
| 62 | +This Bicep script will: |
| 63 | +- Reference your existing Azure AI Agent Service project and model deployment |
| 64 | +- Create a Bing Grounding resource and connect it to your Cognitive Services account |
| 65 | +- Provision a Storage Account, App Service Plan, and Function App |
| 66 | + |
| 67 | +Run: |
| 68 | +```bash |
| 69 | +az deployment group create \ |
| 70 | + --resource-group <rg> \ |
| 71 | + --template-file deploy.bicep \ |
| 72 | + --parameters functionAppName=aiNewsApp account_name=<your-cognitive-account-name> |
| 73 | +``` |
| 74 | +- Replace `<your-cognitive-account-name>` with the name of your existing Cognitive Services account. |
| 75 | +- The script creates a Bing Grounding account named `bingsearch-<your-cognitive-account-name>` and a connection. |
| 76 | + |
| 77 | +### 3. Create a `.env` file |
| 78 | +In the project root, create `.env` containing: |
| 79 | +```ini |
| 80 | +PROJECT_ENDPOINT=<your-ai-agent-service-endpoint> |
| 81 | +MODEL_DEPLOYMENT_NAME=<your-openai-model-deployment-name> |
| 82 | +BING_CONNECTION_ID=<leave blank; Function App app setting will be injected> |
| 83 | +``` |
| 84 | + |
| 85 | +### 4. Install dependencies |
| 86 | +```bash |
| 87 | +python3 -m venv .venv |
| 88 | +source .venv/bin/activate |
| 89 | +pip install -r requirements.txt |
| 90 | +``` |
| 91 | + |
| 92 | +### 5. Create `system_prompt.txt` |
| 93 | +Refer to the main README for your prompt content. |
| 94 | + |
| 95 | +### 6. Run the agent locally |
| 96 | +```bash |
| 97 | +python template.py |
| 98 | +``` |
| 99 | +7. (Optional) Review and modify configuration in `template.py`. |
| 100 | + |
| 101 | +## Configuration Guide |
| 102 | +| Envar | Description | |
| 103 | +|-------------------------|----------------------------------------------------------------| |
| 104 | +| `PROJECT_ENDPOINT` | Azure AI Agent Service project endpoint | |
| 105 | +| `MODEL_DEPLOYMENT_NAME` | Name of the OpenAI model deployment (e.g., `gpt-4o-mini`) | |
| 106 | +| `BING_CONNECTION_ID` | Resource ID of the Bing Grounding connection (injected in FUNC)| |
| 107 | +| `USE_SAMPLE` | Set to `true` to use local sample JSON instead of live calls | |
| 108 | + |
| 109 | +### Sample Data |
| 110 | + |
| 111 | +- No input data is required; the agent runs on schedule and logs or prints the output. |
| 112 | + |
| 113 | +### Example Agent Interaction |
| 114 | + |
| 115 | +```text |
| 116 | +User: What are today’s top AI developments for Microsoft and healthcare? |
| 117 | +Agent: | Headline | Date | Summary | Implications | Link | |
| 118 | + |—————|———|———|——————|—| |
| 119 | + | ... | ... | ... | ... | ... | |
| 120 | +
|
| 121 | +User: Summarize the latest legal AI news. |
| 122 | +Agent: | Headline | Date | Summary | Implications | Link | ... | |
| 123 | +
|
| 124 | +User: Run the AI Developments Aggregation Agent now. |
| 125 | +Agent: (returns a Markdown table of up to 10 items) |
| 126 | +``` |
| 127 | + |
| 128 | +### Customization Tips |
| 129 | + |
| 130 | +- To route output to other targets (e.g., email, Teams), wrap the final table in a notification action. |
| 131 | +- To change the timezone from Pacific, review the # Compute time window (Pacific) section and make the necessary adjustments |
| 132 | + |
| 133 | +## Company |
| 134 | + |
| 135 | +Marquee Insights is a specialized AI consultancy delivering cutting-edge solutions. Visit [Marquee Insights](https://marqueeinsights.com). |
| 136 | + |
| 137 | +## Support |
| 138 | +For support, contact [email protected] |
| 139 | + |
| 140 | +## License |
| 141 | + |
| 142 | +MIT License |
0 commit comments