Logo vun Wikipedia Search

Wikipedia Search

Organisatioun
InternScience
wikipedia-search

Search and fetch structured content from Wikipedia using the MediaWiki API for reliable, encyclopedic information

Iwwersiicht

EditeurInternScience
RepositoryMolClaw
Skill-Nummwikipedia-search
Stären
39
Forks
5
Matgeliwwert Fichieren
2
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 2 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    Vum InternScience op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Wikipedia Search an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/InternScience/MolClaw/tree/main/skills/LR_research/tools/wikipedia-search
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/InternScience/MolClaw.git /tmp/MolClaw
mkdir -p .claude/skills
cp -r /tmp/MolClaw/skills/LR_research/tools/wikipedia-search .claude/skills/wikipedia-search
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Wikipedia Search an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Wikipedia Search automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Wikipedia Search net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

Wikipedia Search Skill

This skill enables Claude to search and fetch content from Wikipedia using the MediaWiki API. It provides more reliable, structured access to Wikipedia than general web search, with support for summaries, full article content, and multi-language access.

When to Use

Use this skill when you need:

  • Encyclopedic knowledge — Factual information about people, places, events, concepts
  • Historical information — Well-documented historical facts, dates, and events
  • Scientific and technical concepts — Definitions, explanations, and overviews
  • Biographical information — Details about notable people
  • Geographic information — Countries, cities, landmarks, and their details
  • Quick fact verification — Cross-checking encyclopedic facts
  • Structured content — Need article sections, categories, and links
  • Multi-language content — Access Wikipedia in languages other than English

When NOT to Use

Avoid using this skill for:

  • Current events or breaking news — Wikipedia may not be up-to-date for very recent events (use web-search instead)
  • Controversial or disputed topics — Wikipedia can have bias or edit wars; use multiple sources
  • Opinions or analysis — Wikipedia aims for neutral point of view, not opinion
  • How-to guides or tutorials — Wikipedia is encyclopedic, not instructional (look for specialized resources)
  • Code examples or technical documentation — Use official docs or specialized sites
  • Personal or local information — Wikipedia only covers notable topics
  • Real-time data — Stock prices, weather, sports scores (use web-search instead)

Usage

The skill is invoked by running the wiki script with a query:

bash
python ~/.openclaw/skills/wikipedia-search/scripts/wiki.py "your query" [options]

Options

  • --mode [search|summary|full] — Operation mode (default: summary)
    • search: Search for page titles matching the query
    • summary: Get a concise summary of a specific page
    • full: Get the complete article with sections and structure
  • --sentences N — Number of sentences for summary mode (default: 5)
  • --lang CODE — Language code (default: en)

Common Language Codes

  • en — English
  • es — Spanish
  • fr — French
  • de — German
  • it — Italian
  • ja — Japanese
  • zh — Chinese
  • ru — Russian
  • ar — Arabic
  • pt — Portuguese

Examples

1. Search for Page Titles

Search for Wikipedia articles matching a term:

bash
python ~/.openclaw/skills/wikipedia-search/scripts/wiki.py "quantum computing" --mode search

Output:

json
{
  "mode": "search",
  "query": "quantum computing",
  "results": [
    {
      "title": "Quantum computing",
      "description": "Study of computers based on quantum phenomena",
      "url": "https://en.wikipedia.org/wiki/Quantum_computing"
    },
    ...
  ],
  "count": 10
}

2. Get a Summary

Get a concise summary of a Wikipedia page:

bash
python ~/.openclaw/skills/wikipedia-search/scripts/wiki.py "Python (programming language)" --mode summary

Or with custom sentence count:

bash
python ~/.openclaw/skills/wikipedia-search/scripts/wiki.py "Albert Einstein" --mode summary --sentences 3

Output:

json
{
  "mode": "summary",
  "title": "Albert Einstein",
  "exists": true,
  "url": "https://en.wikipedia.org/wiki/Albert_Einstein",
  "summary": "Albert Einstein was a German-born theoretical physicist...",
  "categories": ["1879 births", "1955 deaths", "German physicists", ...]
}

3. Get Full Article Content

Retrieve the complete article with sections:

bash
python ~/.openclaw/skills/wikipedia-search/scripts/wiki.py "Machine learning" --mode full

Output:

json
{
  "mode": "full",
  "title": "Machine learning",
  "exists": true,
  "url": "https://en.wikipedia.org/wiki/Machine_learning",
  "summary": "Machine learning is a field of study in artificial intelligence...",
  "sections": [
    {
      "title": "History and relationships to other fields",
      "level": 0,
      "text": "..."
    },
    ...
  ],
  "categories": [...],
  "links": ["Artificial intelligence", "Neural network", ...]
}

4. Search in Different Languages

Search or fetch content in other languages:

bash
python ~/.openclaw/skills/wikipedia-search/scripts/wiki.py "Paris" --mode summary --lang fr
bash
python ~/.openclaw/skills/wikipedia-search/scripts/wiki.py "東京" --mode summary --lang ja

Workflow

When using this skill, follow this workflow:

For Unknown Topics (Search First)

  1. Search for titles — Use --mode search to find relevant articles
  2. Choose the right article — Pick the most relevant title from results
  3. Get summary or full content — Fetch the article with --mode summary or --mode full
  4. Parse JSON output — Extract relevant information from structured data
  5. Cite the source — Include Wikipedia URL when presenting information

For Known Topics (Direct Fetch)

  1. Use exact or close title — Wikipedia is good at matching similar titles
  2. Fetch summary — Use --mode summary for quick facts
  3. Get full content if needed — Use --mode full for comprehensive information
  4. Extract sections — Parse specific sections for focused information

JSON Output Structure

Search Mode
json
{
  "mode": "search",
  "query": "original query",
  "results": [
    {
      "title": "Page Title",
      "description": "Brief description",
      "url": "https://en.wikipedia.org/wiki/Page_Title"
    }
  ],
  "count": 10
}
Summary Mode
json
{
  "mode": "summary",
  "title": "Article Title",
  "exists": true,
  "url": "https://en.wikipedia.org/wiki/Article_Title",
  "summary": "Summary text...",
  "categories": ["Category1", "Category2"]
}
Full Mode
json
{
  "mode": "full",
  "title": "Article Title",
  "exists": true,
  "url": "https://en.wikipedia.org/wiki/Article_Title",
  "summary": "Summary text...",
  "sections": [
    {
      "title": "Section Name",
      "level": 0,
      "text": "Section content..."
    }
  ],
  "categories": ["Category1", "Category2"],
  "links": ["Related Page 1", "Related Page 2"]
}
Error Response
json
{
  "mode": "summary",
  "title": "Nonexistent Page",
  "exists": false,
  "error": "Page not found"
}

Best Practices

Query Formulation

  • Use specific titles — "Python (programming language)" not just "Python"
  • Try exact names — Wikipedia handles disambiguation well
  • Use search mode for exploration — When unsure of exact title, search first
  • Check for disambiguation pages — Some terms have multiple meanings

Mode Selection

  • search — When you don't know the exact page title or want to explore topics
  • summary — For quick facts, definitions, or overviews (most common use case)
  • full — When you need detailed information, specific sections, or comprehensive coverage

Multi-Language Usage

  • Start with English — English Wikipedia is often most comprehensive
  • Use native language for local topics — Local events, culture, geography may be better in native language
  • Cross-reference languages — Different language versions may have different information
  • Match query language — If searching in French, use --lang fr

Information Extraction

  • Use sections strategically — In full mode, target specific sections for focused information
  • Check categories — Categories help understand topic classification
  • Follow links — Related links can lead to more detailed subtopics
  • Verify with summary — Always present in page summary for quick fact-checking

Attribution Guidelines

When presenting Wikipedia content to users:

  • Always cite Wikipedia — Include the page URL: [Article Title](URL)
  • Note it's from Wikipedia — Be transparent: "According to Wikipedia..."
  • Include publication status — Wikipedia is continuously edited; information may change
  • Cross-reference for important facts — For critical information, verify with additional sources

Example:

According to Wikipedia, Python is a high-level, general-purpose programming
language that emphasizes code readability with the use of significant indentation.

Source:
- [Python (programming language) - Wikipedia](https://en.wikipedia.org/wiki/Python_(programming_language))

Error Handling

The script handles common errors gracefully:

Page Not Found

If a page doesn't exist:

  • JSON will include "exists": false and "error": "Page not found"
  • Try using search mode first to find the correct title
  • Check spelling and try variations
  • Consider disambiguation pages

Network Failures

If the API request fails:

  • Error message printed to stderr
  • Exit code will be non-zero
  • Retry after a moment or check internet connection

Import Errors

If Wikipedia-API library is missing:

  • Script automatically attempts to install it
  • Requires pip to be available
  • May require --break-system-packages flag in some environments
  • If auto-install fails, manually install: pip install Wikipedia-API

Rate Limiting

Wikipedia's API is generally permissive:

  • No authentication required for reading
  • Reasonable use limits (shouldn't hit them in normal usage)
  • If rate limited, wait a few seconds before retrying

Technical Details

Dependencies

  • Python 3.x — Required (python3 command must be available)
  • Wikipedia-API — Auto-installed if missing
  • pip — Required for dependency installation

Auto-Installation

The script automatically installs missing dependencies:

python
subprocess.check_call([
    sys.executable, "-m", "pip", "install",
    "Wikipedia-API", "--break-system-packages", "--quiet"
])

The --break-system-packages flag is needed for externally-managed Python environments (common on modern Linux distributions and macOS with Homebrew Python).

API Details

  • Uses the MediaWiki API via the Wikipedia-API Python library
  • OpenSearch API for title search functionality
  • User agent: OpenClaw-WikipediaSearch/1.0
  • No API key required
  • Free and open access

Exit Codes

  • 0 — Success
  • 1 — General error (page not found, network failure, invalid query, etc.)
  • 2 — Import error (dependency installation failed)

Limitations

Wikipedia Constraints

  • Not always current — Wikipedia can lag behind breaking news by hours or days
  • Coverage varies — Obscure topics may have minimal or no articles
  • Neutral POV — Wikipedia strives for neutrality, which may omit certain perspectives
  • No original research — Wikipedia doesn't contain new analysis or unpublished information
  • Notability requirements — Many topics aren't notable enough for Wikipedia inclusion

Technical Limitations

  • Section text truncated — In full mode, sections limited to 5000 characters each to prevent huge responses
  • Limited links — Only first 50 links returned in full mode
  • Limited categories — Only first 10 categories returned
  • No images — Script returns text only, not images or media
  • No infobox data — Structured infobox data not easily accessible via this API

Language Support

  • Quality varies by language — English Wikipedia is most comprehensive
  • Translation issues — Titles don't always translate directly between languages
  • Script mixing — Some languages use different scripts (Arabic, Chinese, etc.)

Troubleshooting

Script Not Executable

If you get "Permission denied" error:

bash
chmod +x ~/.openclaw/skills/wikipedia-search/scripts/wiki.py

Python Not Found

If python3 command doesn't exist, create an alias or use full path to Python interpreter.

Installation Fails in Virtual Environment

If auto-install fails due to venv restrictions, manually install globally:

bash
python3 -m pip install Wikipedia-API --user

Page Not Found for Valid Topic

  • Try search mode first: --mode search to find exact title
  • Check for spelling variations
  • Try disambiguation: add context in parentheses (e.g., "Mercury (planet)" vs "Mercury (element)")
  • Verify the page exists by visiting Wikipedia directly

Non-English Characters Not Displaying

  • Ensure your terminal supports UTF-8 encoding
  • JSON output uses ensure_ascii=False for proper Unicode support
  • May need to set LANG=en_US.UTF-8 or similar environment variable

Use Cases and Examples

Research Starting Point

bash
# Start with search
python ~/.openclaw/skills/wikipedia-search/scripts/wiki.py "neural networks" --mode search

# Get summary of main article
python ~/.openclaw/skills/wikipedia-search/scripts/wiki.py "Artificial neural network" --mode summary

# Get full content for deep dive
python ~/.openclaw/skills/wikipedia-search/scripts/wiki.py "Artificial neural network" --mode full

Quick Facts

bash
# Who is someone?
python ~/.openclaw/skills/wikipedia-search/scripts/wiki.py "Marie Curie" --mode summary --sentences 2

# What is something?
python ~/.openclaw/skills/wikipedia-search/scripts/wiki.py "Blockchain" --mode summary --sentences 3

# Where is something?
python ~/.openclaw/skills/wikipedia-search/scripts/wiki.py "Machu Picchu" --mode summary

Historical Information

bash
# Historical events
python ~/.openclaw/skills/wikipedia-search/scripts/wiki.py "World War II" --mode full

# Historical figures
python ~/.openclaw/skills/wikipedia-search/scripts/wiki.py "Leonardo da Vinci" --mode summary --sentences 10

Scientific Concepts

bash
# Physics
python ~/.openclaw/skills/wikipedia-search/scripts/wiki.py "Quantum entanglement" --mode summary

# Biology
python ~/.openclaw/skills/wikipedia-search/scripts/wiki.py "DNA" --mode full

# Chemistry
python ~/.openclaw/skills/wikipedia-search/scripts/wiki.py "Periodic table" --mode summary

See Also

Notes

  • This skill complements the web-search skill: use Wikipedia for encyclopedic knowledge and web-search for current events
  • Wikipedia content is licensed under CC BY-SA, always attribute properly
  • For critical information, cross-reference with other authoritative sources
  • Wikipedia's strength is breadth of coverage and structured information, not real-time updates

Matgeliwwert Fichieren

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Wikipedia Search?

Search and fetch structured content from Wikipedia using the MediaWiki API for reliable, encyclopedic information

Firwat Wikipedia Search op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Wikipedia Search besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Wikipedia Search an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/InternScience/MolClaw/tree/main/skills/LR_research/tools/wikipedia-search an. TypingMind liest d'Datei SKILL.md, bündelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Wikipedia Search benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Wikipedia Search benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Wikipedia Search domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Wikipedia Search gratis?

Jo. De Skill gëtt vum InternScience ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇