Document the demo flow, field notes, and trace sharing process.
Browse files- DEMO_SCRIPT.md +42 -0
- FIELD_NOTES.md +56 -0
- README.md +25 -8
- TRACE_SHARING.md +26 -0
DEMO_SCRIPT.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Borderless Demo Script
|
| 2 |
+
|
| 3 |
+
## Setup
|
| 4 |
+
|
| 5 |
+
1. Open the Space and sign in with Hugging Face.
|
| 6 |
+
2. Point out the guided profile form, demo personas, chat, and live globe.
|
| 7 |
+
3. Select **India software engineer** to fill the chat box.
|
| 8 |
+
4. Send the prompt.
|
| 9 |
+
|
| 10 |
+
## Narration
|
| 11 |
+
|
| 12 |
+
"Borderless starts from the kind of messy profile a real person has: passport,
|
| 13 |
+
education, work history, languages, budget, timeline, and goals. Instead of
|
| 14 |
+
answering from memory, the agent plans a research session, searches for official
|
| 15 |
+
immigration sources, reads the relevant pages, and marks viable countries on the
|
| 16 |
+
globe."
|
| 17 |
+
|
| 18 |
+
## Expected Beats
|
| 19 |
+
|
| 20 |
+
- The tool trace shows planning, country profile lookup, web search, page
|
| 21 |
+
scraping, and globe updates in readable language.
|
| 22 |
+
- The globe flies to a shortlist and opens the first pathway label.
|
| 23 |
+
- The final answer uses `Snapshot`, `Best-Fit Countries`, `Pathway Details`,
|
| 24 |
+
`Documents To Prepare`, `Risks And Tradeoffs`, `Official Sources`, and
|
| 25 |
+
`Next Steps`.
|
| 26 |
+
- The answer cites official URLs and flags anything that still needs checking.
|
| 27 |
+
|
| 28 |
+
## Follow-Up Prompt
|
| 29 |
+
|
| 30 |
+
After the first answer, ask:
|
| 31 |
+
|
| 32 |
+
> Pick the strongest country from this shortlist and give me a 90-day document
|
| 33 |
+
> preparation plan.
|
| 34 |
+
|
| 35 |
+
This shows that Borderless can move from broad exploration to a concrete action
|
| 36 |
+
plan while keeping the same user profile in context.
|
| 37 |
+
|
| 38 |
+
## Closing Line
|
| 39 |
+
|
| 40 |
+
"The point is not to replace an immigration lawyer. The point is to help a person
|
| 41 |
+
arrive at a short, evidence-backed list of countries and pathways worth serious
|
| 42 |
+
follow-up."
|
FIELD_NOTES.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Borderless Field Notes
|
| 2 |
+
|
| 3 |
+
## Why This Exists
|
| 4 |
+
|
| 5 |
+
Immigration research is high-stakes, fragmented, and exhausting. A person trying
|
| 6 |
+
to move for work, study, family, or safety often has to compare government pages,
|
| 7 |
+
embassy notes, point calculators, processing-time pages, blogs, and anecdotes.
|
| 8 |
+
Borderless is built for the moment before someone pays a lawyer: "What countries
|
| 9 |
+
are realistically worth researching for my profile?"
|
| 10 |
+
|
| 11 |
+
## Why A Small Model Fits
|
| 12 |
+
|
| 13 |
+
The hard part is not memorizing every immigration rule. Policies change too
|
| 14 |
+
often. A small model works well when it is used as a planner and synthesizer:
|
| 15 |
+
|
| 16 |
+
- It turns an everyday-language profile into a concrete research plan.
|
| 17 |
+
- It calls search and scraping tools for current official sources.
|
| 18 |
+
- It compares tradeoffs in plain language.
|
| 19 |
+
- It drives the globe so geography is part of the reasoning, not decoration.
|
| 20 |
+
|
| 21 |
+
This is a better fit than a larger model guessing from stale training data.
|
| 22 |
+
|
| 23 |
+
## What Changed After Prototype Testing
|
| 24 |
+
|
| 25 |
+
The first prototype was a pure chat with visible tool JSON and an editable system
|
| 26 |
+
prompt. It worked, but a new user had to know what to ask and judges had to read
|
| 27 |
+
through debugging details.
|
| 28 |
+
|
| 29 |
+
The award-ready version adds:
|
| 30 |
+
|
| 31 |
+
- A guided intake form that creates a complete research prompt.
|
| 32 |
+
- Demo personas for quick evaluation.
|
| 33 |
+
- A stricter research protocol focused on official sources.
|
| 34 |
+
- Source-quality labels in search results.
|
| 35 |
+
- Country-profile metadata for shortlist and globe grounding.
|
| 36 |
+
- Friendlier tool traces that explain progress without raw JSON noise.
|
| 37 |
+
- Globe loading and empty states so the visual panel is useful immediately.
|
| 38 |
+
- Local JSONL trace logging that can be shared as hackathon evidence.
|
| 39 |
+
|
| 40 |
+
## Responsible Use
|
| 41 |
+
|
| 42 |
+
Borderless is research support, not legal advice. The agent is instructed to cite
|
| 43 |
+
official sources for eligibility, documents, fees, timelines, and application
|
| 44 |
+
steps. When official data is missing or a tool fails, the answer should say what
|
| 45 |
+
needs verification instead of inventing details.
|
| 46 |
+
|
| 47 |
+
## Hackathon Award Fit
|
| 48 |
+
|
| 49 |
+
- Backyard AI: a practical tool for a real, specific life decision.
|
| 50 |
+
- Best Agent: multi-step tool use, source quality, partial synthesis, and globe
|
| 51 |
+
updates are all model-driven.
|
| 52 |
+
- Best Demo: the guided form plus globe shortlist creates an immediate visual
|
| 53 |
+
story.
|
| 54 |
+
- Sharing is Caring: JSONL traces can be published with the Space or linked in a
|
| 55 |
+
writeup.
|
| 56 |
+
- Field Notes: this report documents the product choices and constraints.
|
README.md
CHANGED
|
@@ -25,9 +25,10 @@ Built for the [Build Small Hackathon](https://huggingface.co/build-small-hackath
|
|
| 25 |
Immigration research is fragmented across government sites, forums, and spreadsheets. Borderless puts it in one conversational flow:
|
| 26 |
|
| 27 |
1. **Describe yourself** β citizenship, education, work history, languages, budget, and goals in everyday language.
|
| 28 |
-
2. **
|
| 29 |
-
3. **
|
| 30 |
-
4. **
|
|
|
|
| 31 |
|
| 32 |
No forms to decode. No keyword guessing. Just a research session that meets you where you are.
|
| 33 |
|
|
@@ -37,23 +38,27 @@ Borderless is a **Gradio agent** powered by **[Qwen/Qwen3.6-27B](https://hugging
|
|
| 37 |
|
| 38 |
| Tool | What it fetches |
|
| 39 |
|------|-----------------|
|
| 40 |
-
| `
|
|
|
|
| 41 |
| `scrape_web_page` | Markdown content from a specific official government or embassy URL (Firecrawl) |
|
| 42 |
| `crawl_web_site` | Multiple pages from an official immigration website section (Firecrawl) |
|
| 43 |
| `update_globe` | Marks, highlights, and flies to countries on the MapLibre globe |
|
| 44 |
|
| 45 |
-
Tool calls stream in the chat so you can follow the agent's
|
| 46 |
|
| 47 |
Sign in with your Hugging Face account to run inference through the Inference API.
|
| 48 |
|
| 49 |
## Features
|
| 50 |
|
|
|
|
| 51 |
- **Agentic research** β multi-turn tool use, not a single-shot prompt
|
| 52 |
-
- **
|
|
|
|
|
|
|
| 53 |
- **Web search** β Exa discovers official immigration pages, visa rules, and policy sources
|
| 54 |
- **Official page scraping** β Firecrawl extracts markdown from government immigration sites
|
| 55 |
- **Country metadata** β REST Countries powers ISO-2 / ISO-3 lookup and map coordinates
|
| 56 |
-
- **Transparent traces** β
|
| 57 |
- **Chat history** β pick up where you left off in the sidebar
|
| 58 |
|
| 59 |
## Example prompts
|
|
@@ -77,6 +82,9 @@ Sign in with your Hugging Face account to run inference through the Inference AP
|
|
| 77 |
|
| 78 |
```
|
| 79 |
app.py # Gradio Blocks entry point
|
|
|
|
|
|
|
|
|
|
| 80 |
ui/
|
| 81 |
chat.py # ChatInterface + globe layout
|
| 82 |
globe.py # MapLibre globe panel
|
|
@@ -86,10 +94,13 @@ ui/
|
|
| 86 |
country_coords.py # Country lookup for globe coordinates
|
| 87 |
apis/
|
| 88 |
rest_countries.py # REST Countries metadata client
|
|
|
|
|
|
|
| 89 |
exa.py # Exa web search client
|
| 90 |
firecrawl.py # Firecrawl scrape/crawl client
|
| 91 |
assets/
|
| 92 |
-
|
|
|
|
| 93 |
```
|
| 94 |
|
| 95 |
## Hackathon fit
|
|
@@ -99,6 +110,8 @@ assets/
|
|
| 99 |
| Model β€ 32B | Qwen3.6-27B (27B) |
|
| 100 |
| Gradio on HF Spaces | Yes β [live Space](https://huggingface.co/spaces/build-small-hackathon/borderless) |
|
| 101 |
| Agentic | Multi-tool research loop with visible traces |
|
|
|
|
|
|
|
| 102 |
|
| 103 |
**Track:** Backyard AI β immigration research is a real, specific problem faced by millions of people weighing where they can live, work, and study.
|
| 104 |
|
|
@@ -118,6 +131,10 @@ For web research tools, set API keys from [dashboard.exa.ai](https://dashboard.e
|
|
| 118 |
|----------|-------|
|
| 119 |
| `EXA_API_KEY` | `search_immigration_info` |
|
| 120 |
| `FIRECRAWL_API_KEY` | `scrape_web_page`, `crawl_web_site` |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 121 |
|
| 122 |
On Hugging Face Spaces, add both as **Space secrets** (Settings β Secrets). Without keys, web tools return a clear error. The agent uses Exa to discover URLs, then Firecrawl to fetch full official page content.
|
| 123 |
|
|
|
|
| 25 |
Immigration research is fragmented across government sites, forums, and spreadsheets. Borderless puts it in one conversational flow:
|
| 26 |
|
| 27 |
1. **Describe yourself** β citizenship, education, work history, languages, budget, and goals in everyday language.
|
| 28 |
+
2. **Use guided intake or chat** β start from a structured profile form, a demo persona, or a free-form message.
|
| 29 |
+
3. **Get a shortlist** β the agent reasons over your profile and surfaces destination countries that fit.
|
| 30 |
+
4. **Explore on a 3D globe** β shortlisted countries appear on an interactive MapLibre globe beside the chat with pathway labels.
|
| 31 |
+
5. **Dig into the details** β visa pathways, required documents, realistic timelines, risks, and source links from official pages.
|
| 32 |
|
| 33 |
No forms to decode. No keyword guessing. Just a research session that meets you where you are.
|
| 34 |
|
|
|
|
| 38 |
|
| 39 |
| Tool | What it fetches |
|
| 40 |
|------|-----------------|
|
| 41 |
+
| `get_country_profile` | Country metadata and official immigration domain hints (REST Countries + curated hints) |
|
| 42 |
+
| `search_immigration_info` | Web search with source-quality labels for official immigration pages, policies, and pathways (Exa) |
|
| 43 |
| `scrape_web_page` | Markdown content from a specific official government or embassy URL (Firecrawl) |
|
| 44 |
| `crawl_web_site` | Multiple pages from an official immigration website section (Firecrawl) |
|
| 45 |
| `update_globe` | Marks, highlights, and flies to countries on the MapLibre globe |
|
| 46 |
|
| 47 |
+
Tool calls stream in the chat so you can follow the agent's progress. Globe updates are also tool-driven: when the agent recommends destinations or the user asks to mark countries, it sends ISO country codes and pathway labels to the map. The default research budget is seven tool rounds, then Borderless synthesizes a clear answer with pathways, documents, timelines, risks, and cited sources.
|
| 48 |
|
| 49 |
Sign in with your Hugging Face account to run inference through the Inference API.
|
| 50 |
|
| 51 |
## Features
|
| 52 |
|
| 53 |
+
- **Guided intake** β form fields turn citizenship, education, work, languages, budget, and goals into a complete research prompt
|
| 54 |
- **Agentic research** β multi-turn tool use, not a single-shot prompt
|
| 55 |
+
- **Structured recommendations** β shortlist, pathways, documents, risks, timelines, next steps, and official sources
|
| 56 |
+
- **Tool-driven 3D globe** β MapLibre GL globe projection with markers, highlights, pathway labels, fly-to camera moves, drag, rotate, and zoom
|
| 57 |
+
- **Source quality** β search results identify likely official government, embassy, and unofficial context sources
|
| 58 |
- **Web search** β Exa discovers official immigration pages, visa rules, and policy sources
|
| 59 |
- **Official page scraping** β Firecrawl extracts markdown from government immigration sites
|
| 60 |
- **Country metadata** β REST Countries powers ISO-2 / ISO-3 lookup and map coordinates
|
| 61 |
+
- **Transparent traces** β tool progress is visible in chat, and JSONL traces can be sanitized and shared
|
| 62 |
- **Chat history** β pick up where you left off in the sidebar
|
| 63 |
|
| 64 |
## Example prompts
|
|
|
|
| 82 |
|
| 83 |
```
|
| 84 |
app.py # Gradio Blocks entry point
|
| 85 |
+
FIELD_NOTES.md # Build notes and award narrative
|
| 86 |
+
DEMO_SCRIPT.md # Short demo-video script
|
| 87 |
+
TRACE_SHARING.md # How to sanitize and share agent traces
|
| 88 |
ui/
|
| 89 |
chat.py # ChatInterface + globe layout
|
| 90 |
globe.py # MapLibre globe panel
|
|
|
|
| 94 |
country_coords.py # Country lookup for globe coordinates
|
| 95 |
apis/
|
| 96 |
rest_countries.py # REST Countries metadata client
|
| 97 |
+
country_profile.py # Country profile tool wrapper
|
| 98 |
+
official_sources.py # Official-domain hints and source classification
|
| 99 |
exa.py # Exa web search client
|
| 100 |
firecrawl.py # Firecrawl scrape/crawl client
|
| 101 |
assets/
|
| 102 |
+
app.css # Gradio branding
|
| 103 |
+
globe.js / globe.css # Globe rendering, loading, and empty states
|
| 104 |
```
|
| 105 |
|
| 106 |
## Hackathon fit
|
|
|
|
| 110 |
| Model β€ 32B | Qwen3.6-27B (27B) |
|
| 111 |
| Gradio on HF Spaces | Yes β [live Space](https://huggingface.co/spaces/build-small-hackathon/borderless) |
|
| 112 |
| Agentic | Multi-tool research loop with visible traces |
|
| 113 |
+
| Sharing is Caring | JSONL tool traces can be sanitized and published |
|
| 114 |
+
| Field Notes | See `FIELD_NOTES.md` |
|
| 115 |
|
| 116 |
**Track:** Backyard AI β immigration research is a real, specific problem faced by millions of people weighing where they can live, work, and study.
|
| 117 |
|
|
|
|
| 131 |
|----------|-------|
|
| 132 |
| `EXA_API_KEY` | `search_immigration_info` |
|
| 133 |
| `FIRECRAWL_API_KEY` | `scrape_web_page`, `crawl_web_site` |
|
| 134 |
+
| `BORDERLESS_MODEL_ID` | Optional model override, default `Qwen/Qwen3.6-27B` |
|
| 135 |
+
| `BORDERLESS_MAX_TOOL_ROUNDS` | Optional tool-round budget, default `7` |
|
| 136 |
+
| `BORDERLESS_TRACE_DIR` | Optional JSONL trace output directory |
|
| 137 |
+
| `BORDERLESS_DISABLE_TRACE_LOGS` | Set to `1` to disable local trace logs |
|
| 138 |
|
| 139 |
On Hugging Face Spaces, add both as **Space secrets** (Settings β Secrets). Without keys, web tools return a clear error. The agent uses Exa to discover URLs, then Firecrawl to fetch full official page content.
|
| 140 |
|
TRACE_SHARING.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Trace Sharing
|
| 2 |
+
|
| 3 |
+
Borderless writes non-blocking JSONL tool traces to `agent_traces/` by default.
|
| 4 |
+
These traces are ignored by git so local demos do not accidentally commit noisy
|
| 5 |
+
runtime files.
|
| 6 |
+
|
| 7 |
+
Each line includes:
|
| 8 |
+
|
| 9 |
+
- Timestamp
|
| 10 |
+
- Tool name
|
| 11 |
+
- Tool arguments
|
| 12 |
+
- Duration
|
| 13 |
+
- Truncated tool result
|
| 14 |
+
|
| 15 |
+
Use these traces to support the Build Small **Sharing is Caring** badge:
|
| 16 |
+
|
| 17 |
+
1. Run a polished demo prompt in the Space or locally.
|
| 18 |
+
2. Review the generated `agent_traces/borderless-YYYYMMDD.jsonl` file.
|
| 19 |
+
3. Remove any personal information from the user profile or tool results.
|
| 20 |
+
4. Publish the sanitized trace as a Hugging Face dataset, gist, or appendix to a
|
| 21 |
+
field-notes post.
|
| 22 |
+
|
| 23 |
+
Configuration:
|
| 24 |
+
|
| 25 |
+
- `BORDERLESS_TRACE_DIR`: output directory, default `agent_traces`.
|
| 26 |
+
- `BORDERLESS_DISABLE_TRACE_LOGS=1`: disable trace logging.
|