stackConsult commited on
Commit
3005446
·
verified ·
1 Parent(s): d803a39

Add enrichment agent config with prioritized sources, rate limits, and retry policies

Browse files
Files changed (1) hide show
  1. docs/configs/enrichment_config.json +199 -0
docs/configs/enrichment_config.json ADDED
@@ -0,0 +1,199 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "agent_name": "recovery_enrichment_agent",
3
+ "version": "1.0.0",
4
+ "description": "Configuration for recovery and enrichment agent with prioritized data sources",
5
+
6
+ "enrichment_sources": {
7
+ "priority_order": [
8
+ "crunchbase_api",
9
+ "clearbit_api",
10
+ "linkedin_browser",
11
+ "company_website_scraper",
12
+ "apollo_api"
13
+ ],
14
+
15
+ "source_configs": {
16
+ "crunchbase_api": {
17
+ "enabled": true,
18
+ "rate_limit": {
19
+ "requests_per_minute": 60,
20
+ "requests_per_hour": 3000,
21
+ "burst_size": 10
22
+ },
23
+ "retry_policy": {
24
+ "max_retries": 3,
25
+ "initial_backoff_seconds": 2,
26
+ "backoff_multiplier": 2,
27
+ "max_backoff_seconds": 60
28
+ },
29
+ "timeout_seconds": 30,
30
+ "required_fields": ["company_name", "domain"]
31
+ },
32
+
33
+ "clearbit_api": {
34
+ "enabled": true,
35
+ "rate_limit": {
36
+ "requests_per_minute": 100,
37
+ "requests_per_hour": 5000,
38
+ "burst_size": 20
39
+ },
40
+ "retry_policy": {
41
+ "max_retries": 3,
42
+ "initial_backoff_seconds": 1,
43
+ "backoff_multiplier": 2,
44
+ "max_backoff_seconds": 30
45
+ },
46
+ "timeout_seconds": 20,
47
+ "required_fields": ["domain"]
48
+ },
49
+
50
+ "linkedin_browser": {
51
+ "enabled": true,
52
+ "rate_limit": {
53
+ "requests_per_minute": 10,
54
+ "requests_per_hour": 200,
55
+ "burst_size": 3
56
+ },
57
+ "retry_policy": {
58
+ "max_retries": 2,
59
+ "initial_backoff_seconds": 5,
60
+ "backoff_multiplier": 3,
61
+ "max_backoff_seconds": 120
62
+ },
63
+ "timeout_seconds": 60,
64
+ "requires_human_validation": true,
65
+ "fallback_to_browser_agent": true
66
+ },
67
+
68
+ "company_website_scraper": {
69
+ "enabled": true,
70
+ "rate_limit": {
71
+ "requests_per_minute": 30,
72
+ "requests_per_hour": 1000,
73
+ "burst_size": 5
74
+ },
75
+ "retry_policy": {
76
+ "max_retries": 2,
77
+ "initial_backoff_seconds": 3,
78
+ "backoff_multiplier": 2,
79
+ "max_backoff_seconds": 45
80
+ },
81
+ "timeout_seconds": 45,
82
+ "user_agent_rotation": true
83
+ },
84
+
85
+ "apollo_api": {
86
+ "enabled": true,
87
+ "rate_limit": {
88
+ "requests_per_minute": 50,
89
+ "requests_per_hour": 2000,
90
+ "burst_size": 15
91
+ },
92
+ "retry_policy": {
93
+ "max_retries": 3,
94
+ "initial_backoff_seconds": 2,
95
+ "backoff_multiplier": 2,
96
+ "max_backoff_seconds": 60
97
+ },
98
+ "timeout_seconds": 25
99
+ }
100
+ }
101
+ },
102
+
103
+ "queue_processing": {
104
+ "batch_size": 10,
105
+ "concurrent_workers": 3,
106
+ "queue_check_interval_seconds": 5,
107
+ "max_queue_age_hours": 24,
108
+ "priority_weights": {
109
+ "high": 3,
110
+ "medium": 2,
111
+ "low": 1
112
+ }
113
+ },
114
+
115
+ "agent_handoff": {
116
+ "browser_agent_fallback": {
117
+ "enabled": true,
118
+ "trigger_conditions": [
119
+ "api_rate_limit_exceeded",
120
+ "authentication_required",
121
+ "captcha_detected",
122
+ "data_quality_insufficient"
123
+ ],
124
+ "max_browser_attempts": 2,
125
+ "timeout_seconds": 120
126
+ },
127
+
128
+ "human_validation": {
129
+ "enabled": true,
130
+ "trigger_conditions": [
131
+ "conflicting_data_sources",
132
+ "confidence_score_below_threshold",
133
+ "sensitive_data_detected",
134
+ "legal_compliance_check"
135
+ ],
136
+ "confidence_threshold": 0.75,
137
+ "escalation_queue": "human_review"
138
+ }
139
+ },
140
+
141
+ "logging": {
142
+ "activity_log_path": "activity_log.csv",
143
+ "log_level": "INFO",
144
+ "log_rotation": {
145
+ "enabled": true,
146
+ "max_size_mb": 50,
147
+ "backup_count": 5
148
+ },
149
+ "tracked_events": [
150
+ "enrichment_started",
151
+ "enrichment_completed",
152
+ "enrichment_failed",
153
+ "source_attempted",
154
+ "source_succeeded",
155
+ "source_failed",
156
+ "rate_limit_hit",
157
+ "retry_attempted",
158
+ "browser_agent_triggered",
159
+ "human_validation_required",
160
+ "escalation_created"
161
+ ]
162
+ },
163
+
164
+ "data_quality": {
165
+ "min_confidence_score": 0.6,
166
+ "required_enrichment_fields": [
167
+ "company_name",
168
+ "industry",
169
+ "employee_count",
170
+ "founded_year"
171
+ ],
172
+ "validation_rules": {
173
+ "email_format": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$",
174
+ "phone_format": "^\\+?[1-9]\\d{1,14}$",
175
+ "url_format": "^https?://.*"
176
+ }
177
+ },
178
+
179
+ "error_handling": {
180
+ "circuit_breaker": {
181
+ "enabled": true,
182
+ "failure_threshold": 5,
183
+ "timeout_seconds": 60,
184
+ "half_open_max_calls": 3
185
+ },
186
+ "dead_letter_queue": {
187
+ "enabled": true,
188
+ "max_retry_count": 5,
189
+ "retention_hours": 72
190
+ }
191
+ },
192
+
193
+ "integration": {
194
+ "upstream_agents": ["query_search_agent", "activity_ingestion_agent"],
195
+ "downstream_agents": ["validation_agent", "export_agent"],
196
+ "message_format": "json",
197
+ "queue_type": "priority_queue"
198
+ }
199
+ }