-
Notifications
You must be signed in to change notification settings - Fork 124
feat: add LostFound Match Agent template #158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Rewant05
wants to merge
33
commits into
Lamatic:main
Choose a base branch
from
Rewant05:lostfound-match-agent
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
91642cb
Create README.md
Rewant05 17eb1f7
Update README.md
Rewant05 f2ea1a1
Update README.md
Rewant05 c739f4e
add Lamatic config
Rewant05 6b39f45
add agent instructions
Rewant05 14a2d33
add flow documentation
Rewant05 2c32cb1
add lostfound matching prompt
Rewant05 80f0511
feat: add lostfound match flow
Rewant05 952991e
Create default.md
Rewant05 727f5fc
chore: add model config
Rewant05 ea56a75
fix: update Lamatic config schema
Rewant05 d217597
docs: add template README
Rewant05 4cbc877
chore: add template config
Rewant05 5351c00
chore: add template inputs
Rewant05 42347c0
chore: add template metadata
Rewant05 6caf77d
remove old kit files
Rewant05 6cb35d9
remove old kit files
Rewant05 89785e6
remove old kit files
Rewant05 486ca81
remove old kit files
Rewant05 11d2937
remove old kit nested files
Rewant05 6cc6285
remove old kit nested files
Rewant05 4f41467
remove old kit nested files
Rewant05 bd3c263
delete old files
Rewant05 ba475f3
move template README to kits structure
Rewant05 5534c03
add Lamatic config for kits structure
Rewant05 7bbdd22
move agent instructions to kits structure
Rewant05 41a65bd
feat: add flow to kits structure
Rewant05 48bf18b
docs: move prompt to kits structure
Rewant05 3003397
docs: add constitution to kits structure
Rewant05 5270683
fix: update config for kits template structure
Rewant05 546aff0
Delete templates/lostfound-match-agent directory
Rewant05 370f0a7
fix: tighten system prompt output contract
Rewant05 b449ddb
```text docs: add setup environment and usage sections
Rewant05 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,131 @@ | ||
| # LostFound Match Agent | ||
|
|
||
| ## Overview | ||
|
|
||
| LostFound Match Agent is an AI workflow that compares lost item reports with found item reports and helps administrators identify likely matches. | ||
|
|
||
| It is designed for campuses, airports, metro stations, malls, hotels, and other public places where lost and found reports are often handled manually. | ||
|
|
||
| ## Problem | ||
|
|
||
| Lost and found teams often receive incomplete, messy, or differently written item descriptions. | ||
|
|
||
| For example, one user may report: | ||
|
|
||
| > Black leather wallet lost near library with student ID. | ||
|
|
||
| Another person may report: | ||
|
|
||
| > Dark wallet found near reading room with college card inside. | ||
|
|
||
| Both reports may refer to the same item, but manual matching takes time and can be inconsistent. | ||
|
|
||
| ## Solution | ||
|
|
||
| This agent compares the lost item report and found item report using: | ||
|
|
||
| - item type | ||
| - color | ||
| - brand or material | ||
| - unique identifiers | ||
| - location similarity | ||
| - date/time proximity | ||
| - semantic similarity | ||
| - conflicting details | ||
|
|
||
| It then returns a structured match decision with a score, reasoning, verification questions, and next action. | ||
|
|
||
| ## Input | ||
|
|
||
| ```json | ||
| { | ||
| "lost_item_description": "Black leather wallet lost near library. It had my student ID card and some cash.", | ||
| "found_item_description": "Dark wallet found near reading room with a college ID card inside.", | ||
| "lost_location": "Library", | ||
| "found_location": "Reading room", | ||
| "lost_date": "2026-05-10", | ||
| "found_date": "2026-05-10" | ||
| } | ||
| ``` | ||
|
|
||
| ## Output | ||
|
|
||
| ```json | ||
| { | ||
| "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." | ||
| } | ||
| ``` | ||
|
|
||
| ## Use Cases | ||
|
|
||
| - Campus lost and found desks | ||
| - Airport lost property departments | ||
| - Metro station lost and found counters | ||
| - Mall and hotel security teams | ||
| - Lost and found management platforms | ||
|
|
||
| ## Why this matters | ||
|
|
||
| The agent does not replace human verification. It helps admins quickly prioritize likely matches and reduce manual effort. | ||
|
|
||
| ## Assumptions | ||
|
|
||
| - The match score is a recommendation, not a final ownership decision. | ||
| - Valuable or sensitive items should always be manually verified. | ||
| - The quality of the result depends on the quality of the descriptions provided. | ||
|
|
||
| ## Setup | ||
|
|
||
| This is a Lamatic AgentKit template for a single flow. It does not include a frontend app or local runtime. | ||
|
|
||
| To use this template: | ||
|
|
||
| 1. Open Lamatic Studio. | ||
| 2. Create a new project or open an existing project. | ||
| 3. Import or recreate the flow using the files in this template. | ||
| 4. Configure the LLM/model provider inside Lamatic Studio. | ||
| 5. Deploy the flow from Lamatic Studio. | ||
| 6. Test the flow using the sample input shown below. | ||
|
|
||
| No local `npm install` or `npm run dev` step is required because this is a flow-only template, not a full kit with a Next.js app. | ||
|
|
||
| ## Environment Variables | ||
|
|
||
| This template does not require any environment variables in the repository. | ||
|
|
||
| Any required model/API credentials should be configured securely inside Lamatic Studio or the connected provider settings. | ||
|
|
||
| Do not commit real API keys or secrets to this repository. | ||
|
|
||
| ## Usage | ||
|
|
||
| Send a lost item report and a found item report to the flow. | ||
|
|
||
| Example input: | ||
|
|
||
| ```json | ||
| { | ||
| "lost_item_description": "Black leather wallet lost near library. It had my student ID card and some cash.", | ||
| "found_item_description": "Dark wallet found near reading room with a college ID card inside.", | ||
| "lost_location": "Library", | ||
| "found_location": "Reading room", | ||
| "lost_date": "2026-05-10", | ||
| "found_date": "2026-05-10" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| # LostFound Match Agent | ||
|
|
||
| ## Role | ||
|
|
||
| You are a Lost and Found Matching Agent for institutions such as campuses, airports, malls, hotels, and metro stations. | ||
|
|
||
| Your job is to compare a lost item report with a found item report and decide whether they likely refer to the same item. | ||
|
|
||
| ## Instructions | ||
|
|
||
| Compare the reports using the following signals: | ||
|
|
||
| - item type | ||
| - color | ||
| - brand | ||
| - material | ||
| - unique identifiers | ||
| - location similarity | ||
| - date or time proximity | ||
| - semantic similarity between descriptions | ||
| - conflicting details | ||
|
|
||
| Return only valid JSON. | ||
|
|
||
| Do not claim a guaranteed match. Always recommend manual verification before returning an item. | ||
|
|
||
| ## Response Format | ||
|
|
||
| ```json | ||
| { | ||
| "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." | ||
| } | ||
| ``` | ||
|
|
||
| ## Example Input | ||
|
|
||
| ```json | ||
| { | ||
| "lost_item_description": "Black leather wallet lost near library. It had my student ID card and some cash.", | ||
| "found_item_description": "Dark wallet found near reading room with a college ID card inside.", | ||
| "lost_location": "Library", | ||
| "found_location": "Reading room", | ||
| "lost_date": "2026-05-10", | ||
| "found_date": "2026-05-10" | ||
| } | ||
| ``` | ||
|
|
||
| ## Example Output | ||
|
|
||
| ```json | ||
| { | ||
| "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." | ||
| } | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # LostFound Match Agent Constitution | ||
|
|
||
| ## Purpose | ||
|
|
||
| The LostFound Match Agent helps lost and found administrators compare lost item reports with found item reports and identify likely matches. | ||
|
|
||
| ## Safety Rules | ||
|
|
||
| - The agent must never claim that two reports are a guaranteed match. | ||
| - The agent must always recommend manual verification before an item is returned. | ||
| - The agent must not decide final ownership by itself. | ||
| - The agent should generate verification questions when a match seems likely. | ||
| - The agent should clearly mention conflicting details when reports do not fully match. | ||
|
|
||
| ## Decision Guidelines | ||
|
|
||
| The agent should consider: | ||
|
|
||
| - item type | ||
| - color | ||
| - brand | ||
| - material | ||
| - unique identifiers | ||
| - location similarity | ||
| - date or time proximity | ||
| - semantic similarity | ||
| - conflicting details | ||
|
|
||
| ## Output Rule | ||
|
|
||
| The agent must return structured JSON with a match score, decision, reason, matching signals, conflicting signals, verification questions, and next action. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| /* | ||
| # LostFound Match Agent | ||
|
|
||
| This flow compares a lost item report with a found item report and returns a structured match recommendation. | ||
|
|
||
| It is designed for campuses, airports, metro stations, malls, hotels, and other public places where lost and found reports are handled manually. | ||
| */ | ||
|
|
||
| export const meta = { | ||
| name: "LostFound Match Agent", | ||
| description: | ||
| "Compares lost and found item reports and returns a match score, reasoning, verification questions, and next action.", | ||
| tags: ["lost-and-found", "matching", "automation", "json"], | ||
| testInput: { | ||
| lost_item_description: | ||
| "Black leather wallet lost near library. It had my student ID card and some cash.", | ||
| found_item_description: | ||
| "Dark wallet found near reading room with a college ID card inside.", | ||
| lost_location: "Library", | ||
| found_location: "Reading room", | ||
| lost_date: "2026-05-10", | ||
| found_date: "2026-05-10" | ||
| }, | ||
| author: { | ||
| name: "Rewant Anand", | ||
| github: "Rewant05" | ||
| } | ||
| }; | ||
|
|
||
| export const inputs = { | ||
| lost_item_description: { | ||
| type: "string", | ||
| required: true, | ||
| description: "Description of the lost item reported by the user." | ||
| }, | ||
| found_item_description: { | ||
| type: "string", | ||
| required: true, | ||
| description: "Description of the found item reported by another user or admin." | ||
| }, | ||
| lost_location: { | ||
| type: "string", | ||
| required: false, | ||
| description: "Location where the item was lost." | ||
| }, | ||
| found_location: { | ||
| type: "string", | ||
| required: false, | ||
| description: "Location where the item was found." | ||
| }, | ||
| lost_date: { | ||
| type: "string", | ||
| required: false, | ||
| description: "Date when the item was lost." | ||
| }, | ||
| found_date: { | ||
| type: "string", | ||
| required: false, | ||
| description: "Date when the item was found." | ||
| } | ||
| }; | ||
|
|
||
| export const references = { | ||
| prompts: { | ||
| system: "@prompts/lostfound-match-agent_system.md" | ||
| } | ||
| }; | ||
|
|
||
| export default { | ||
| meta, | ||
| inputs, | ||
| references | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| export default { | ||
| name: "LostFound Match Agent", | ||
| description: | ||
| "AI workflow that compares lost item reports with found item reports and returns a match score, reasoning, verification questions, and next action.", | ||
| version: "1.0.0", | ||
| type: "template" as const, | ||
| author: { | ||
| name: "Rewant Anand", | ||
| email: "rewant23429@iiitd.ac.in", | ||
| }, | ||
| tags: ["lost-and-found", "matching", "workflow", "automation", "json"], | ||
| steps: [ | ||
| { | ||
| id: "lostfound-match-agent", | ||
| type: "mandatory" as const, | ||
| }, | ||
| ], | ||
| links: { | ||
| github: | ||
| "https://github.com/Lamatic/AgentKit/tree/main/kits/lostfound-match-agent", | ||
| }, | ||
| }; |
50 changes: 50 additions & 0 deletions
50
kits/lostfound-match-agent/prompts/lostfound-match-agent_system.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| # LostFound Match Agent System Prompt | ||
|
|
||
| You are a Lost and Found Matching Agent for institutions such as campuses, airports, malls, hotels, and metro stations. | ||
|
|
||
| Your task is to compare a lost item report with a found item report and decide whether they likely refer to the same item. | ||
|
|
||
| Use the following input fields: | ||
|
|
||
| - lost_item_description | ||
| - found_item_description | ||
| - lost_location | ||
| - found_location | ||
| - lost_date | ||
| - found_date | ||
|
|
||
| Compare the reports using: | ||
|
|
||
| - item type | ||
| - color | ||
| - brand | ||
| - material | ||
| - unique identifiers | ||
| - location similarity | ||
| - date or time proximity | ||
| - semantic similarity between descriptions | ||
| - conflicting details | ||
|
|
||
| Return only valid JSON. | ||
|
|
||
| The JSON response must follow this contract: | ||
|
|
||
| ```json | ||
| { | ||
| "match_score": 0, | ||
| "decision": "Likely 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." | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.