feat: Add B2B Lead Qualification Agent#616
Conversation
|
@DMEAGESWAR is attempting to deploy a commit to the aditthyass' projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Note
|
| Layer / File(s) | Summary |
|---|---|
Agent metadata, inputs schema, and example inputs src/agents/definitions/b2b-lead-qualification-agent.js |
Exports the agent's id, name, description, category, model/provider defaults, exampleInputs demonstrating company/lead data shape, and the inputs array schema covering required fields (company name, size, industry) and optional fields (LinkedIn URL, recent activity, pain points, decision makers, budget signals) with select and textarea input types. |
System prompt, output type, and chain configuration src/agents/definitions/b2b-lead-qualification-agent.js |
Adds the systemPrompt template instructing the model to produce qualification score, prospect type, agency detection, buying signals, niche, inferred pain points, decision makers, outreach strategy, personalized outreach message, and red flags. Sets outputType: "text" and suggestedChainFrom with three upstream agent identifiers. |
Estimated code review effort
🎯 2 (Simple) | ⏱️ ~10 minutes
Suggested labels
type:feature, level:beginner
Suggested reviewers
- AditthyaSS
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title accurately and concisely describes the main change: addition of a B2B Lead Qualification Agent. It directly matches the primary objective and new functionality introduced in the pull request. |
| Linked Issues check | ✅ Passed | The implementation successfully addresses all core objectives from issue #382: niche detection, personalized outreach message generation, AI-based qualification scoring, buying signal identification, agency detection, pain point analysis, and red flag detection. The agent configuration matches the stated requirements. |
| Out of Scope Changes check | ✅ Passed | All changes are directly aligned with the stated objectives. The single new file contains only the B2B Lead Qualification Agent definition with no unrelated modifications or scope creep. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create PR with unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
|
Hey @DMEAGESWAR! 👋
|
|
hey @DMEAGESWAR! 👋 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/agents/definitions/b2b-lead-qualification-agent.js`:
- Line 13: The exampleInputs object has a company_size value of "50-200
employees" which does not match the available select options defined in the
schema. Update the company_size field in exampleInputs to use the correct value
"51-200 employees" to ensure the example input aligns with the declared select
options and can be used for example-driven runs.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: e77d6666-9854-47a9-8875-916b520d3ba1
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json,!package-lock.json
📒 Files selected for processing (1)
src/agents/definitions/b2b-lead-qualification-agent.js
| model: "gpt-4o-mini", | ||
| exampleInputs: { | ||
| company_name: "TechCorp Solutions", | ||
| company_size: "50-200 employees", |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Align exampleInputs.company_size with the declared select options.
exampleInputs.company_size is "50-200 employees", but the allowed option is "51-200 employees". This creates an invalid preset value for example-driven runs.
Suggested fix
exampleInputs: {
company_name: "TechCorp Solutions",
- company_size: "50-200 employees",
+ company_size: "51-200 employees",
industry: "SaaS & Cloud Services",Also applies to: 34-41
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/agents/definitions/b2b-lead-qualification-agent.js` at line 13, The
exampleInputs object has a company_size value of "50-200 employees" which does
not match the available select options defined in the schema. Update the
company_size field in exampleInputs to use the correct value "51-200 employees"
to ensure the example input aligns with the declared select options and can be
used for example-driven runs.
There was a problem hiding this comment.
♻️ Duplicate comments (1)
src/agents/definitions/b2b-lead-qualification-agent.js (1)
13-13: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winAlign
exampleInputs.company_sizewith the declared select options.The example value
"50-200 employees"does not match any option in the schema. It should be"51-200 employees"to align with the select options defined at lines 34-41.Suggested fix
exampleInputs: { company_name: "TechCorp Solutions", - company_size: "50-200 employees", + company_size: "51-200 employees", industry: "SaaS & Cloud Services",🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/agents/definitions/b2b-lead-qualification-agent.js` at line 13, The exampleInputs.company_size field contains the value "50-200 employees" which does not match any of the select options defined in the schema. Update the company_size example input value to "51-200 employees" to align with the actual select options available in the form schema.
🧹 Nitpick comments (1)
src/agents/definitions/b2b-lead-qualification-agent.js (1)
87-101: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoffConsider using structured output type for better downstream processing.
The system prompt explicitly requests a "structured analysis" with 10 numbered sections, but
outputTypeis set to"text". While freeform text can work, using a structured output type (e.g.,"json") would enable more reliable parsing and downstream integration, especially given the specific fields requested (qualification score, prospect type, buying signals, etc.).If structured JSON output is desired, the systemPrompt should specify the exact JSON schema and outputType should be changed to
"json"or equivalent.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/agents/definitions/b2b-lead-qualification-agent.js` around lines 87 - 101, The systemPrompt in the b2b-lead-qualification-agent requests structured analysis with 10 numbered sections but the outputType is set to "text" instead of a structured format. Change the outputType from "text" to "json" and update the systemPrompt to specify the exact JSON schema with fields matching the 10 sections: qualification_score, prospect_type, agency_detection, buying_signals, niche_detection, key_pain_points, decision_makers, outreach_strategy, personalized_outreach, and red_flags. This will enable reliable parsing of the agent's response in downstream processing.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Duplicate comments:
In `@src/agents/definitions/b2b-lead-qualification-agent.js`:
- Line 13: The exampleInputs.company_size field contains the value "50-200
employees" which does not match any of the select options defined in the schema.
Update the company_size example input value to "51-200 employees" to align with
the actual select options available in the form schema.
---
Nitpick comments:
In `@src/agents/definitions/b2b-lead-qualification-agent.js`:
- Around line 87-101: The systemPrompt in the b2b-lead-qualification-agent
requests structured analysis with 10 numbered sections but the outputType is set
to "text" instead of a structured format. Change the outputType from "text" to
"json" and update the systemPrompt to specify the exact JSON schema with fields
matching the 10 sections: qualification_score, prospect_type, agency_detection,
buying_signals, niche_detection, key_pain_points, decision_makers,
outreach_strategy, personalized_outreach, and red_flags. This will enable
reliable parsing of the agent's response in downstream processing.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 5b9408b1-e2d8-4fbd-86f5-c74b8ae982c6
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json,!package-lock.json
📒 Files selected for processing (1)
src/agents/definitions/b2b-lead-qualification-agent.js
🎯 B2B Lead Qualification Agent
Resolves #382
Features Implemented
✅ AI-powered lead qualification scoring (0-100)
✅ Prospect type detection (sales teams, freelancers, agencies, recruiters)
✅ Staffing/recruitment agency detection
✅ Buying signal identification
✅ Niche detection
✅ Personalized outreach message generation
✅ Pain point analysis
✅ Red flag detection
File Added
src/agents/definitions/b2b-lead-qualification-agent.jsHow It Works
Analyzes company information and generates comprehensive lead qualification insights.
Summary by CodeRabbit