🤖
FRED-Navigator
Navigate FRED categories and series using fredapi, supporting natural-language queries with intent recognition and double validation.
安全通过
💬Prompt
技能说明
name: fred-navigator description: Navigate FRED categories and series using fredapi, supporting natural-language queries with intent recognition and double validation. metadata: short-description: FRED navigation and lookup
FRED Navigator
Purpose
Provide a reliable workflow to navigate FRED categories and series, with support for:
- Direct
category_id - Direct
series_id - Natural-language
query→ intent recognition → double validation
Inputs
category_id: FRED category idseries_id: FRED series idquery: natural language requestlimit: number of candidates to return (default 5)api_key: read from environmentFRED_API_KEYonly
Required Resources
references/fred_categories_tree.jsonreferences/fred_categories_flat.json- Optional:
references/category_paths.json(precomputed) - Optional:
references/synonyms.json - Helper script:
scripts/fred_query.py - Path builder:
scripts/build_paths.py
Optional Resource Structure Notes
references/category_paths.jsonformat:{ "category_id": { "id": <int>, "name": "<str>", "path": "<str>" }, ... }
references/synonyms.jsonformat:{ "concept": ["alias1", "alias2", ...], ... }
Workflow
1. Category Exploration
- Load
fred_categories_tree.jsonfor hierarchical browsing. - If user provides
category_id, validate it exists. - If user provides
category_name, fuzzy match againstflatnames and return candidates.
2. Series Discovery
- Use
search_by_category(category_id)to list available series. - Prefer
scripts/fred_query.py category <id>for consistent output. - Return key columns:
id,title,frequency,units,seasonal_adjustment,last_updated.
3. Series Retrieval
- Use
get_series(series_id)for time series. - Use
get_series_info(series_id)for metadata. - Prefer
scripts/fred_query.py series <id>andscripts/fred_query.py series-info <id>. - Provide:
- data head/tail
- missing counts
- latest value and date
4. Natural Language Query
4.1 Intent Identification (Top-K)
- Use the IDE agent (Codex) to interpret the natural-language intent.
- Select the single best-matching category.
- If confidence is low, ask the user to confirm the category before proceeding.
- Use
references/category_paths.jsonandreferences/synonyms.jsonas supporting context if available.
4.2 Double Validation
Structural validation
- Candidate must exist in
fred_categories_tree.json. - Pass if at least one:
childrennon-emptysearch_by_category(id)returns >= 1 series- Prefer
scripts/fred_query.py check-category <id>for a quick check
Semantic validation (agent)
- Compare
querywith candidatename/path. - Return
pass/failor numeric relevance score.
4.3 Decision
- If structural + semantic validation both pass → accept category.
- Otherwise:
- return Top-5 candidates
- ask user to choose one explicitly
Failure Handling
- Always provide Top-5 candidates when uncertain.
- Never proceed to series retrieval if category validation fails.
Notes
- Do not hardcode API keys.
- Keep heavy reference data in
references/, not in this file. - When running Python functions for querying, execute them inside the sandbox environment.
Maintenance
- Update workflow or constraints: edit
SKILL.md. - Update category data: replace files in
references/. - Improve natural-language matching: add or edit
references/synonyms.json(key → list of related terms). - Regenerate precomputed paths (optional): run
scripts/build_paths.py. - Add helper scripts (optional): place in
scripts/and document usage here.
如何使用「FRED-Navigator」?
- 打开小龙虾AI(Web 或 iOS App)
- 点击上方「立即使用」按钮,或在对话框中输入任务描述
- 小龙虾AI 会自动匹配并调用「FRED-Navigator」技能完成任务
- 结果即时呈现,支持继续对话优化