feat: add LostFound Match Agent template#158
Conversation
WalkthroughAdds a LostFound Match Agent kit: template config and flow, agent prompts and constitution enforcing a strict JSON output schema, and README documentation for matching lost and found reports. ChangesLostFound Match Agent Kit
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
PR Validation ResultsNew Contributions Detected
Check Results
Errors
🛑 Please fix the errors above before this PR can be merged. Refer to CONTRIBUTING.md and CLAUDE.md for the expected folder structure. |
|
Hi Lamatic team, the validation checks have passed and this PR has received the passing-checks label. |
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 `@templates/lostfound-match-agent/meta.json`:
- Around line 15-34: Add a formal output schema file describing the agent's
response contract to validate the fields shown in output_example: create an
outputs.json that defines each top-level property (match_score, decision,
reason, matching_signals, conflicting_signals, verification_questions,
next_action) with types, required=true where appropriate, descriptions, and
constraints (e.g., match_score numeric 0–100, arrays of strings for
signals/questions). Ensure the schema keys exactly match the example in
meta.json so integrators can validate agent responses and catch breaking
changes.
🪄 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: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: ff8ecfab-c3ed-4cf2-a1b6-1753d77bdc6b
📒 Files selected for processing (4)
templates/lostfound-match-agent/README.mdtemplates/lostfound-match-agent/config.jsontemplates/lostfound-match-agent/inputs.jsontemplates/lostfound-match-agent/meta.json
| "output_example": { | ||
| "match_score": 85, | ||
| "decision": "Likely Match", | ||
| "reason": "Both reports describe a dark wallet found near similar academic locations and mention an ID card.", | ||
| "matching_signals": [ | ||
| "Both reports mention a wallet", | ||
| "Both reports mention a dark or black color", | ||
| "Both reports mention an ID card", | ||
| "The locations are similar" | ||
| ], | ||
| "conflicting_signals": [ | ||
| "The found report does not mention cash" | ||
| ], | ||
| "verification_questions": [ | ||
| "What name is written on the ID card?", | ||
| "How much cash was inside?", | ||
| "Does the wallet have any brand or unique mark?" | ||
| ], | ||
| "next_action": "Send this case to an admin for manual verification before returning the item." | ||
| }, |
There was a problem hiding this comment.
🧹 Nitpick | 🔵 Trivial | ⚡ Quick win
Agent, consider documenting the output contract.
The output example demonstrates a well-structured match result with match_score, decision, reason, matching_signals, conflicting_signals, verification_questions, and next_action. However, there's no formal output schema (like an outputs.json file) defining types, constraints, or required fields for this structure.
While not critical for a template, a formal output schema would help integrators validate agent responses and catch breaking changes.
📋 Proposed addition: outputs.json schema
Consider adding templates/lostfound-match-agent/outputs.json:
{
"match_score": {
"type": "number",
"required": true,
"description": "Match confidence score between 0-100"
},
"decision": {
"type": "string",
"required": true,
"description": "Match decision category (e.g., Likely Match, Possible Match, No Match)"
},
"reason": {
"type": "string",
"required": true,
"description": "Human-readable explanation of the decision"
},
"matching_signals": {
"type": "array",
"required": true,
"description": "List of signals supporting the match"
},
"conflicting_signals": {
"type": "array",
"required": true,
"description": "List of signals contradicting the match"
},
"verification_questions": {
"type": "array",
"required": true,
"description": "Questions to verify ownership"
},
"next_action": {
"type": "string",
"required": true,
"description": "Recommended next step for the administrator"
}
}🤖 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 `@templates/lostfound-match-agent/meta.json` around lines 15 - 34, Add a formal
output schema file describing the agent's response contract to validate the
fields shown in output_example: create an outputs.json that defines each
top-level property (match_score, decision, reason, matching_signals,
conflicting_signals, verification_questions, next_action) with types,
required=true where appropriate, descriptions, and constraints (e.g.,
match_score numeric 0–100, arrays of strings for signals/questions). Ensure the
schema keys exactly match the example in meta.json so integrators can validate
agent responses and catch breaking changes.
|
Hi @Rewant05! 👋 Before this PR can be reviewed by maintainers, please resolve all comments and requested changes from the CodeRabbit automated review. Steps to follow:
This helps keep the review process efficient for everyone. Thank you! 🙏 |
|
Hello @Rewant05 Can you please check and update the file structure? Reference: https://github.com/Lamatic/AgentKit/blob/main/CONTRIBUTING.md#repository-layout |
|
Thanks @akshatvirmani! I checked that the validation checks have passed and the PR has received the passing-checks label. |
Added README.md for LostFound Match Agent detailing its purpose, problem, solution, input/output examples, use cases, and assumptions.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
kits/lostfound-match-agent/README.md (1)
1-93:⚠️ Potential issue | 🟠 Major | 🏗️ Heavy liftMission briefing incomplete, agent. Critical operational instructions are missing.
Your README provides excellent intelligence on what this agent does and why it matters, but the field manual is missing essential deployment protocols. As per coding guidelines, every kit README must document setup, environment variables, and usage.
Current status:
- ✓ Problem analysis and solution overview
- ✓ Input/output specifications
- ✓ Use case identification
- ✗ Setup instructions (how to install/configure)
- ✗ Environment variables (required API keys, config)
- ✗ Usage instructions (how to execute the kit)
Without these sections, field operatives cannot deploy this mission. Consider adding:
- Setup section covering installation steps
- Environment Variables section listing required keys (e.g., AI model API keys)
- Usage section with command examples or execution steps
This message will self-destruct after you've addressed these gaps. Good luck, agent.
As per coding guidelines: "Every kit must have a
README.mdthat documents setup, environment variables, and usage"🤖 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 `@kits/lostfound-match-agent/README.md` around lines 1 - 93, The README is missing deploy/run instructions—add three sections titled "Setup", "Environment Variables", and "Usage" to the README.md: under Setup give installation and dependency steps (e.g., install packages, build steps) and any configuration required; under Environment Variables list required keys (e.g., OPENAI_API_KEY or other AI/model/service keys, NODE_ENV, DATABASE_URL if used) and example expected formats; under Usage provide concrete run examples and commands, example input JSON and expected output flow, and any troubleshooting notes; ensure these sections are named exactly "Setup", "Environment Variables", and "Usage" so reviewers and automation can locate them easily.
🤖 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.
Outside diff comments:
In `@kits/lostfound-match-agent/README.md`:
- Around line 1-93: The README is missing deploy/run instructions—add three
sections titled "Setup", "Environment Variables", and "Usage" to the README.md:
under Setup give installation and dependency steps (e.g., install packages,
build steps) and any configuration required; under Environment Variables list
required keys (e.g., OPENAI_API_KEY or other AI/model/service keys, NODE_ENV,
DATABASE_URL if used) and example expected formats; under Usage provide concrete
run examples and commands, example input JSON and expected output flow, and any
troubleshooting notes; ensure these sections are named exactly "Setup",
"Environment Variables", and "Usage" so reviewers and automation can locate them
easily.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: 7377c982-95e8-483c-8d8b-da52320ac3a0
📒 Files selected for processing (1)
kits/lostfound-match-agent/README.md
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@kits/lostfound-match-agent/prompts/lostfound-match-agent_system.md`:
- Line 1: Add a top-level H1 heading above the existing prompt text (e.g., "#
LostFound Match Agent System Prompt") so the file starts with a markdown H1 and
satisfies MD041; keep the existing first line "You are a Lost and Found Matching
Agent for institutions such as campuses, airports, malls, hotels, and metro
stations." unchanged after the new heading to preserve the prompt content.
- Around line 24-43: The system prompt's JSON contract allows invalid values for
match_score and decision; change the wording around the "match_score" and
"decision" fields so match_score is explicitly an integer in the range 0-100
(e.g., "match_score": integer 0-100) and require "decision" to be exactly one of
the three allowed strings ("Likely Match", "Possible Match", "Not a Match");
update any validator text or examples in the prompt to enforce integer
casting/clamping for match_score and strict enumeration checking for decision so
downstream parsers always receive a bounded integer and one of the three exact
decision values.
🪄 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: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: e02787b0-7f65-4e08-8115-4b0fbc6e98db
📒 Files selected for processing (5)
kits/lostfound-match-agent/agent.mdkits/lostfound-match-agent/constitutions/default.mdkits/lostfound-match-agent/flows/lostfound-match-agent.tskits/lostfound-match-agent/lamatic.config.tskits/lostfound-match-agent/prompts/lostfound-match-agent_system.md
| Return only valid JSON in this format: | ||
|
|
||
| { | ||
| "match_score": 0, | ||
| "decision": "Likely Match | Possible Match | Not a Match", | ||
| "reason": "Short explanation of the decision.", | ||
| "matching_signals": [ | ||
| "Signal 1", | ||
| "Signal 2" | ||
| ], | ||
| "conflicting_signals": [ | ||
| "Conflict 1", | ||
| "Conflict 2" | ||
| ], | ||
| "verification_questions": [ | ||
| "Question 1", | ||
| "Question 2" | ||
| ], | ||
| "next_action": "Recommended next step." | ||
| } |
There was a problem hiding this comment.
🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win
Mission-critical: tighten the output contract for parser-safe responses.
At Line 27 and Line 28, constrain match_score (for example, integer 0-100) and require decision to be exactly one of the three allowed values, otherwise downstream consumers may receive inconsistent payloads.
🤖 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 `@kits/lostfound-match-agent/prompts/lostfound-match-agent_system.md` around
lines 24 - 43, The system prompt's JSON contract allows invalid values for
match_score and decision; change the wording around the "match_score" and
"decision" fields so match_score is explicitly an integer in the range 0-100
(e.g., "match_score": integer 0-100) and require "decision" to be exactly one of
the three allowed strings ("Likely Match", "Possible Match", "Not a Match");
update any validator text or examples in the prompt to enforce integer
casting/clamping for match_score and strict enumeration checking for decision so
downstream parsers always receive a bounded integer and one of the three exact
decision values.
Clarify the JSON response format and update decision options.
Added setup instructions, environment variables, and usage examples for the Lamatic AgentKit template.
|
Hi @akshatvirmani, I updated the PR to follow the CONTRIBUTING.md repository layout. The contribution now lives under: kits/lostfound-match-agent/ with:
I also addressed the CodeRabbit feedback by updating the README with Setup, Environment Variables, and Usage sections, and tightening the system prompt output contract. CodeRabbit review is now completed, but the validation workflow is still failing because it appears to be treating each file/folder inside kits/lostfound-match-agent as a separate kit root and expecting config.json/README.md/flows inside each one. Could you please confirm whether I should keep the current CONTRIBUTING.md structure or adjust it to match the validator? |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
♻️ Duplicate comments (1)
kits/lostfound-match-agent/prompts/lostfound-match-agent_system.md (1)
32-50:⚠️ Potential issue | 🟠 Major | ⚡ Quick winMission-critical: output contract still requires tighter constraints for field validation.
Agent, your JSON schema example demonstrates structure but leaves critical validation gaps. The contract must explicitly constrain:
match_scoreto an integer in range 0-100 (prevent floats, negatives, or values >100)decisionto exactly one of three allowed strings:"Likely Match","Possible Match", or"Not a Match"Without these constraints, downstream parsers risk receiving
match_score: -42ordecision: "Unclear", compromising mission integrity.🎯 Mission brief: tighten the contract
Add explicit constraints to the prompt text before the JSON example:
The JSON response must follow this contract: + +Field constraints: +- `match_score`: integer from 0 to 100 +- `decision`: must be exactly one of: "Likely Match", "Possible Match", or "Not a Match" ```json { - "match_score": 0, - "decision": "Likely Match", + "match_score": 0, // integer 0-100 + "decision": "Likely Match", // one of: "Likely Match", "Possible Match", "Not a Match" "reason": "Short explanation of the decision.",🤖 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 `@kits/lostfound-match-agent/prompts/lostfound-match-agent_system.md` around lines 32 - 50, The prompt's JSON example leaves `match_score` and `decision` unconstrained; update the system prompt text immediately before the JSON block to explicitly require that `match_score` is an integer between 0 and 100 (no floats, no negatives, no >100) and that `decision` must be exactly one of the three strings "Likely Match", "Possible Match", or "Not a Match"; mention these constraints in plain language (and optionally as brief inline comments next to `match_score` and `decision`) so downstream parsers and validators know to reject/normalize invalid values.
🤖 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 `@kits/lostfound-match-agent/prompts/lostfound-match-agent_system.md`:
- Around line 32-50: The prompt's JSON example leaves `match_score` and
`decision` unconstrained; update the system prompt text immediately before the
JSON block to explicitly require that `match_score` is an integer between 0 and
100 (no floats, no negatives, no >100) and that `decision` must be exactly one
of the three strings "Likely Match", "Possible Match", or "Not a Match"; mention
these constraints in plain language (and optionally as brief inline comments
next to `match_score` and `decision`) so downstream parsers and validators know
to reject/normalize invalid values.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Pro
Run ID: 5d017264-ca3c-4119-a24c-6bde20905698
📒 Files selected for processing (2)
kits/lostfound-match-agent/README.mdkits/lostfound-match-agent/prompts/lostfound-match-agent_system.md
|
Hello @Rewant05 Keep the structure as mentioned in the CONTRIBUTING.MD only. I will let you know if this causes any problems |
PR Checklist
1. Select Contribution Type
kits/<category>/<kit-name>/)bundles/<bundle-name>/)templates/<template-name>/)2. General Requirements
kebab-caseand matches the flow IDREADME.md(purpose, setup, usage)3. File Structure (Check what applies)
config.jsonpresent with valid metadata (name, description, tags, steps, author, env keys)flows/<flow-name>/(where applicable) include:config.json(Lamatic flow export)inputs.jsonmeta.jsonREADME.md.env.examplewith placeholder values only (kits only)config.jsonnode graphs (changes via Lamatic Studio export)4. Validation
npm install && npm run devworks locally (kits: UI runs; bundles/templates: flows are valid)@prompts/lostfound-match-agent_system.md")Flow overview