resilient-context-extraction
यह क्या करती है
यह स्किल AI एजेंट को बताती है कि आपकी जोड़ी हुई फ़ाइलें पढ़े और उन्हें तथ्यों का मुख्य स्रोत माने। यह उन लोगों के लिए है जो AI को काम करने के लिए संदर्भ फ़ाइलें देते हैं।
कब इस्तेमाल करें
- ✓जब आप स्प्रेडशीट, PDF या डेटा फ़ाइल जोड़ें और AI से उससे कुछ बनवाएँ।
- ✓जब AI का जवाब आपकी दी हुई फ़ाइल को नज़रअंदाज़ करता लगे।
- ✓जब फ़ाइल पढ़ने पर वह अधूरी लगे और आप चाहें कि AI उसे खोलने के दूसरे तरीके आज़माए।
Skill का लिंक
https://github.com/HKUDS/AgentPilot/blob/main/openspace/benchmarks/gdpval/skills/prioritize-context-data-enhanced/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मेरी रिपोर्ट के लिए संलग्न सेल्स फ़ाइल के आँकड़े इस्तेमाल कीजिए, और उनके लिए वेब पर खोज मत कीजिए।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट आपकी दी हुई हर फ़ाइल सूचीबद्ध करता है, देखता है कि कौन सी काम से मेल खाती है, और कहीं और देखने से पहले उन्हें पढ़ता है। अगर पढ़ना अधूरा लगे, तो वह दूसरा तरीका आज़माता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
Resilient Context Extraction
Objective
Prevent data hallucination and inefficiency by mandating that agents inspect, validate, and fully extract data from provided reference files before attempting web searches or generating synthetic data. When extraction is incomplete, use fallback strategies before making assumptions.
Critical Rule
If a reference file is provided in the task context, it is the source of truth. Do not fabricate data or search the web for information that may exist within the provided attachments. If extraction appears incomplete, attempt alternative methods before proceeding.
Workflow Steps
1. Scan Context for Attachments
At the start of every task, explicitly list all files provided in the context window or attachment panel.
- Check for spreadsheets (
.xlsx,.csv), documents (.pdf,.docx,.pptx), or data dumps (.json,.txt,.xml,.yaml). - Note the filename, file size (if available), and inferred content type.
- Record this list for later verification.
2. Evaluate Relevance
Determine if any provided file contains the data required to complete the task.
- Match Keywords: Do filenames or expected column headers match task requirements?
- Check Scope: Does the data cover the necessary timeframe or region?
- Prioritize: Rank files by likelihood of containing required data.
3. Extract Data with Validation
If relevant files are found:
- Read the file content using appropriate tools (e.g.,
read_file,pandas,pdf_reader). - Validate Extraction Completeness (NEW CRITICAL STEP):
- Check if output appears truncated (e.g., sudden cutoff mid-sentence, character limits hit).
- Compare expected data points vs. extracted data points (e.g., "Task mentions pricing tiers; did extraction include pricing numbers?").
- Look for structural indicators of incompleteness (e.g., unclosed tables, missing document endings).
- If extraction is incomplete or suspicious, proceed to Step 4 (Fallback Strategies) before using the data.
4. Apply Fallback Extraction Strategies
When initial extraction is incomplete or critical data is missing, attempt these strategies in order before making assumptions:
4a. Alternative Library/Tool Approach
- For
.docx: Trypython-docxdirectly viaexecute_code_sandboxifread_filewas truncated. - For
.xlsx/.csv: Trypandaswith explicit sheet selection oropenpyxldirectly. - For
.pdf: Trypdfplumber,PyPDF2, or shell-basedpdftotextif available. - For any format: Try reading as raw bytes/text via shell commands (
cat,xxd,strings).
4b. Shell-Based Extraction
- Use
shell_agentorrun_shellfor format-specific tools:unzip -p file.docx word/document.xml | xmllint --format -(extract raw docx XML)in2csv file.xlsx(convert Excel to CSV via shell)pdftotext file.pdf -(extract PDF text via command line)
- This bypasses potential sandbox or library limitations in
read_file.
4c. Targeted Re-Reading
- If specific sections are missing (e.g., "pricing table on page 3"), attempt to re-read with focus on that region.
- Use tools that support page/section ranges if available.
4d. Document What's Missing
- Before any assumptions or external searches, explicitly document:
- What data was expected but not found.
- What extraction methods were attempted.
- Why each method failed or what portions remain unavailable.
- Example: "Attempted
read_fileonPricing_email.docx(truncated at 980 chars). Attemptedpython-docxextraction via sandbox—pricing table in section 2 not present in file. Pricing numbers unavailable from provided context."
5. Cite Source Explicitly
When presenting data in the final output:
- Explicitly state which file the data came from.
- Example: "According to
Massabama_active_listings.xlsx..." - If fallback methods were used, note this: "Extracted via shell-based
pdftotextfromreport.pdf..." - This verifies to the user that real data was used, not hallucinated.
6. Fallback to Search (Last Resort Only)
If all extraction strategies fail to provide the specific data needed:
- State clearly what was missing from the files.
- Document all extraction methods attempted and why they failed.
- Then proceed with web search or estimation.
- Mark any non-file data clearly as "External Search" or "Estimated (file data unavailable)".
- Never present estimated data as if it came from the file.
Che
अक्सर पूछे जाने वाले सवाल
अगर मेरी फ़ाइल में तथ्य न हो, तो क्या एजेंट फिर भी वेब खोजेगा?
स्किल एजेंट से कहती है कि पहले पक्का करे कि फ़ाइल में सच में वह तथ्य नहीं है। तभी उसे कहीं और देखना चाहिए।
यह स्किल किन फ़ाइल प्रकारों को कवर करती है?
यह स्प्रेडशीट, PDF, Word फ़ाइलें, CSV, JSON और टेक्स्ट फ़ाइलों को जाँचने वाले प्रकारों के रूप में बताती है।
अगर एजेंट फिर भी मेरी फ़ाइल नज़रअंदाज़ करे तो?
उससे कहिए कि वह उन फ़ाइलों की सूची दे जो उसे दिख रही हैं, और आगे बढ़ने से पहले वह फ़ाइल पढ़े जिसकी आपको ज़रूरत है।
जानकारी
लेखक का मूल विवरण
Ensures agents extract data from context files with validation and fallback strategies before resorting to assumptions or external searches.
repo: HKUDS/AgentPilot
लोकप्रियता
- GitHub स्टार
- 7.8k
- रैंकिंग में स्थान
- #12951
- लाइसेंस
- MIT
- अपडेट की गई
- 1/11/2026
कमेंट
- …
इस repository की और skills
agentpilot
7.8kआपके एजेंट को AgentPilot से प्रोजेक्ट को चरण-दर-चरण सुधारने में मदद करती है, जिसमें बदलाव सुझाए, परखे और स्कोर किए जाते हैं।
openspace
7.8kआपके एजेंट को OpenSpace सेट करने में मदद करती है, जो एजेंट स्किल्स सहेजता और वापस लाता है, और MCP के ज़रिए आपके AI ऐप से जुड़ता है।
rsi-arena
7.8kआपके एजेंट को AIME और Terminal-Bench जैसे मानक AI बेंचमार्क टेस्ट सेट करने और चलाने में मदद करती है, ताकि सुधार के तरीकों की तुलना हो सके।
experiment-guide
7.8kआपके एजेंट को छोटे प्रयोग बनाने, उनके नतीजे पढ़ने और जाँच के दौरान उपयोगी निष्कर्ष लिखने में मदद करती है।
मिलती-जुलती skills
add-model-provider
394kयह आपके एजेंट को सुरक्षित कमांड से OpenClaw में नया AI मॉडल प्रोवाइडर जोड़ने, API कीज़ को सादे टेक्स्ट से बचाने और लाइव टेस्ट चलाने देती है।
acp-router
394kयह आपके एजेंट को OpenClaw के ज़रिए Claude Code या Cursor जैसे कोडिंग असिस्टेंट को काम भेजने देती है, ताकि काम उसी टूल में चले।
browser-automation
394kयह आपके एजेंट को लॉगिन, टैब और अटकी वेब पेज से उबरने समेत, वेबसाइट पर चरण-दर-चरण काम करना सिखाती है।