| name | juicebox-core-workflow-b |
| description | Implement Juicebox candidate enrichment workflow.
Use when enriching profile data, gathering additional candidate details,
or building comprehensive candidate profiles.
Trigger with phrases like "juicebox enrich profile", "juicebox candidate details",
"enrich candidate data", "juicebox profile enrichment".
|
| allowed-tools | Read, Write, Edit, Bash(npm:*), Bash(pip:*), Grep |
| version | 1.0.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
Juicebox Candidate Enrichment Workflow
Overview
Enrich candidate profiles with additional data including contact information, work history, and skills verification.
Prerequisites
- Juicebox SDK configured
- Search workflow implemented (
juicebox-core-workflow-a)
- Data storage for enriched profiles
Instructions
Step 1: Define Enrichment Schema
export interface EnrichedProfile {
id: string;
basicInfo: {
name: string;
title: string;
company: string;
location: string;
};
contact: {
email?: string;
phone?: string;
linkedin?: string;
};
experience: WorkExperience[];
education: Education[];
skills: Skill[];
lastEnriched: Date;
}
export interface WorkExperience {
company: string;
title: string;
startDate: string;
endDate?: string;
description?: string;
}
Step 2: Implement Enrichment Service
import { JuiceboxService } from '../lib/juicebox-client';
export class ProfileEnrichmentService {
constructor(private juicebox: JuiceboxService) {}
async enrichProfile(profileId: string): Promise<EnrichedProfile> {
const fullProfile = await this.juicebox.getProfile(profileId, {
include: ['contact', 'experience', 'education', 'skills']
});
const enriched: EnrichedProfile = {
id: profileId,
basicInfo: {
name: fullProfile.name,
title: fullProfile.title,
company: fullProfile.company,
location: fullProfile.location
},
contact: {
email: fullProfile.email,
phone: fullProfile.phone,
: fullProfile.
},
: .(fullProfile.),
: .(fullProfile.),
: .(fullProfile.),
: ()
};
enriched;
}
(: []): <[]> {
batchSize = ;
: [] = [];
( i = ; i < profileIds.; i += batchSize) {
batch = profileIds.(i, i + batchSize);
enriched = .(
batch.( .(id))
);
results.(...enriched);
(i + batchSize < profileIds.) {
();
}
}
results;
}
}
Step 3: Store Enriched Data
export class ProfileStorage {
async saveEnrichedProfile(profile: EnrichedProfile): Promise<void> {
await db.profiles.upsert({
where: { id: profile.id },
create: profile,
update: {
...profile,
lastEnriched: new Date()
}
});
}
async getStaleProfiles(olderThan: Date): Promise<string[]> {
const stale = await db.profiles.findMany({
where: {
lastEnriched: { lt: olderThan }
},
select: { id: true }
});
return stale.map(p => p.id);
}
}
Output
- Enriched profile schema
- Batch enrichment service
- Data persistence layer
- Freshness tracking
Error Handling
| Error | Cause | Solution |
|---|
| Profile Not Found | Invalid ID | Verify profile exists |
| Partial Data | Limited access | Handle optional fields |
| Rate Limited | Too many requests | Implement backoff |
Examples
Enrichment Pipeline
const enrichmentService = new ProfileEnrichmentService(juicebox);
const storage = new ProfileStorage();
const candidates = await searchPipeline.searchCandidates(criteria);
const profileIds = candidates.slice(0, 20).map(c => c.id);
const enriched = await enrichmentService.batchEnrich(profileIds);
for (const profile of enriched) {
await storage.saveEnrichedProfile(profile);
console.log(`Enriched: ${profile.basicInfo.name}`);
}
Resources
Next Steps
After enrichment, explore juicebox-common-errors for error handling patterns.