Skip to content

Commit ff50a70

Browse files
authored
Merge pull request #74 from anuragBhardwaj01-auquan/ab-feature-auquan-agent-sample
Add Auquan Agent Code Sample
2 parents 0d966f7 + 1adb2cc commit ff50a70

File tree

5 files changed

+514
-0
lines changed

5 files changed

+514
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Auquan Ltd.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# 🏠 Home Loan Guide
2+
3+
The Due Diligence Risk Analyst is an expert system designed to provide comprehensive risk analysis and timeline tracking for companies. It specializes in analyzing company risks across multiple dimensions including operational, financial, regulatory, and sustainability metrics. The agent processes structured risk data from Auquan's API, generates detailed timelines, and provides actionable insights through well-formatted reports with visual risk indicators.
4+
5+
---
6+
7+
## 💼 Use Cases
8+
1. Comprehensive Risk Analysis
9+
- "Do a risk analysis for Total energies"
10+
11+
2. Specific Risk Assessment
12+
- "What are the critical risks identified for TotalEnergies?"
13+
14+
3. Sustainability Analysis
15+
- "Generate a sustainability analysis for TotalEnergies"
16+
17+
4. Risk Table Creation
18+
- "Create a table indicating risks for TotalEnergies showing all categories and severity"
19+
20+
5. Overall Risk Rating Analysis
21+
- "What is the overall risk range of TotalEnergies?"
22+
23+
6. Recent Theme Analysis
24+
- "What are the recent themes around TotalEnergies and what are their impacts?"
25+
26+
---
27+
28+
## 🧩 Tools
29+
30+
This agent leverages **Azure AI Agent Service**, using the following tools:
31+
## Tool 1: Auquan API
32+
**Description:**
33+
Retrieves and processes company risk data from Auquan's API. This tool enables the agent to access comprehensive company information, risk assessments, and thematic analysis data.
34+
35+
**API Endpoint:** `https://agents.auquan.com/api/analyze-query`
36+
**Authentication:** API key in x-api-key header
37+
**Request Format:**
38+
```json
39+
{
40+
"query": "do a risk analysis for {COMPANY_NAME}"
41+
}
42+
```
43+
44+
**Error Handling:**
45+
- 401: Check API key validity
46+
- 500: Retry with backoff
47+
- Log all errors for monitoring
48+
49+
### Tool 2: Code Interpreter
50+
**Description:**
51+
Performs data analysis and visualization tasks including:
52+
- Risk score calculations
53+
- Timeline generation
54+
- Data formatting and structuring
55+
- Table and chart creation
56+
57+
**Reference Files:**
58+
- No specific reference files required
59+
- No authentication required
60+
61+
### Tool 3: Grounding with Bing Search
62+
**Description:**
63+
Enriches the analysis with:
64+
- Latest news and developments
65+
- Regulatory updates
66+
- Industry trends
67+
- Sustainability initiatives
68+
69+
**Reference Files:**
70+
- No specific reference files required
71+
- No authentication required
72+
73+
The agent is configured via a `template.py` file and deployable with Bicep for enterprise use.
74+
75+
76+
## ⚙️ Setup Instructions
77+
78+
### Prerequisites
79+
Obtain an API key for your Auquan Risk Agent.
80+
81+
---
82+
## 💬 Example Agent Interactions
83+
84+
- "Do a risk analysis for Total energies"
85+
86+
- "What are the critical risks identified for TotalEnergies?"
87+
88+
- "Generate a sustainability analysis for TotalEnergies"
89+
90+
- "Create a table indicating risks for TotalEnergies showing all categories and severity"
91+
92+
- "What is the overall risk range of TotalEnergies?"
93+
94+
- "What are the recent themes around TotalEnergies and what are their impacts?"
95+
96+
97+
## 🛠 Customization Tips
98+
99+
- **Connect with more datasets**
100+
Add datasets like lawsuits/sanctions to the agent's analysis via the Auquan Knowledge tool to identify potential risks.
101+
102+
- **Connect with vector stores**
103+
Connect with vector stores that have specific data (eg. Annual Reports, Industry Reports etc.) ingested into them.
104+
105+
- **Connect with local files**
106+
Add your local files to include your data in risk-analysis
Lines changed: 1 addition & 0 deletions
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
{
2+
"openapi": "3.0.0",
3+
"info": {
4+
"title": "Auquan Risk Analyzer API",
5+
"version": "1.0.0",
6+
"description": "API for company risk analysis and query processing"
7+
},
8+
"servers": [
9+
{
10+
"url": "https://agents.auquan.com",
11+
"description": "Auquan Server"
12+
}
13+
],
14+
"components": {
15+
"securitySchemes": {
16+
"apiKeyHeader": {
17+
"type": "apiKey",
18+
"name": "x-api-key",
19+
"in": "header",
20+
"description": "API key for authentication"
21+
}
22+
}
23+
},
24+
"security": [
25+
{
26+
"apiKeyHeader": []
27+
}
28+
],
29+
"paths": {
30+
"/api/analyze-query": {
31+
"post": {
32+
"operationId": "analyze_query",
33+
"tags": ["Azure Agent"],
34+
"summary": "Analyze a user's natural language query and return risk analysis",
35+
"description": "This endpoint requires a valid API key in the x-api-key header. The API key must be included in all requests.",
36+
"security": [
37+
{
38+
"apiKeyHeader": []
39+
}
40+
],
41+
"requestBody": {
42+
"required": true,
43+
"content": {
44+
"application/json": {
45+
"schema": {
46+
"type": "object",
47+
"properties": {
48+
"query": {
49+
"type": "string",
50+
"description": "The natural language query about company risks",
51+
"example": "do a risk analysis for ClimatePartner"
52+
}
53+
},
54+
"required": ["query"]
55+
}
56+
}
57+
}
58+
},
59+
"responses": {
60+
"200": {
61+
"description": "Successful response",
62+
"content": {
63+
"application/json": {
64+
"schema": {
65+
"type": "object",
66+
"properties": {
67+
"status": {
68+
"type": "string",
69+
"enum": ["success"]
70+
},
71+
"data": {
72+
"type": "object",
73+
"properties": {
74+
"company_name": {
75+
"type": "string"
76+
},
77+
"basic_info": {
78+
"type": "object",
79+
"properties": {
80+
"name": {
81+
"type": "string"
82+
},
83+
"description": {
84+
"type": "string"
85+
},
86+
"summary": {
87+
"type": "string"
88+
}
89+
}
90+
},
91+
"risk_analysis": {
92+
"type": "object",
93+
"properties": {
94+
"auquan_risks": {
95+
"type": "array",
96+
"items": {
97+
"type": "object"
98+
}
99+
},
100+
"sasb_risks": {
101+
"type": "array",
102+
"items": {
103+
"type": "object"
104+
}
105+
},
106+
"ungc_risks": {
107+
"type": "array",
108+
"items": {
109+
"type": "object"
110+
}
111+
},
112+
"sdg_risks": {
113+
"type": "array",
114+
"items": {
115+
"type": "object"
116+
}
117+
},
118+
"recent_themes": {
119+
"type": "array",
120+
"items": {
121+
"type": "object"
122+
}
123+
}
124+
}
125+
}
126+
}
127+
}
128+
}
129+
}
130+
}
131+
}
132+
},
133+
"401": {
134+
"description": "Unauthorized - Invalid or missing API key",
135+
"content": {
136+
"application/json": {
137+
"schema": {
138+
"type": "object",
139+
"properties": {
140+
"detail": {
141+
"type": "string",
142+
"example": "Invalid API key"
143+
}
144+
}
145+
}
146+
}
147+
}
148+
}
149+
}
150+
}
151+
}
152+
}
153+
}
154+

0 commit comments

Comments
 (0)