Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

ovos-wikipedia-plugin

PyPI License Python

Wikipedia integration for OpenVoiceOS. Provides a retrieval engine for RAG pipelines and an agent toolbox for tool-using agents, both as standard OPM plugins.


Installation

pip install ovos-wikipedia-plugin

OPM Entry Points

Entry point Class Use case
opm.agents.retrievalovos-wikipedia-plugin WikipediaRetrievalEngine Retrieval — returns ranked (passage, score) tuples
opm.agents.toolboxovos-wikipedia-tool WikipediaToolbox Agent tool use — exposes search_wikipedia

Retrieval Engine

WikipediaRetrievalEngine implements the RetrievalEngine OPM interface. It searches Wikipedia, fetches article summaries in parallel, scores them for relevance, and optionally applies extractive QA and reranking sub-plugins.

from ovos_wikipedia import WikipediaRetrievalEngine

engine = WikipediaRetrievalEngine()

# Returns List[WikipediaResult] sorted by relevance
for result in engine.search("Ada Lovelace", lang="en"):
    print(result.title, result.conf)
    print(result.summary)
    if result.image:
        print(result.image)

# RAG interface: List[Tuple[str, float]]  (passage, score)
passages = engine.query("who was Ada Lovelace", lang="en", k=3)

Optional sub-plugins

Config key OPM type Effect
extractive_qa opm.agents.extractive_qa Extract the best passage from each article summary
reranker opm.agents.reranker Re-score results with a cross-encoder
keyword_extractor opm.plugin.keywords Rewrite the query when the initial search returns nothing
engine = WikipediaRetrievalEngine(config={
    "extractive_qa": "ovos-bm25-solver",
    "reranker": "ovos-bm25-reranker",
    "keyword_extractor": "ovos-rake-keywords",
})

Agent Toolbox

WikipediaToolbox exposes a single search_wikipedia tool that any OPM-compatible agent loop ( e.g. ovos-agentic-loop) can discover and call.

Loading via entry point (recommended)

Any agent loop that supports opm.agents.toolbox entry points will auto-discover this toolbox by name:

{
  "name": "ResearchAgent",
  "solvers": [
    "ovos-react-loop"
  ],
  "ovos-react-loop": {
    "brain": "ovos-chat-openai-plugin",
    "ovos-chat-openai-plugin": {
      "api_url": "http://localhost:11434/v1/chat/completions"
    },
    "toolboxes": [
      "ovos-wikipedia-tool"
    ]
  }
}

Direct usage

from ovos_wikipedia import WikipediaToolbox, SearchWikipediaArgs

tb = WikipediaToolbox()

# Discover the tool (used internally by agent loops)
tools = tb.discover_tools()
# [AgentTool(name="search_wikipedia", description="Search Wikipedia for information about a topic...")]

# Call directly
output = tb.search_wikipedia(SearchWikipediaArgs(query="Ada Lovelace", lang="en"))
for title, summary in output.results:
    print(title)
    print(summary)

License

Apache 2.0 — see LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ovos_wikipedia_plugin-1.0.1a1.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ovos_wikipedia_plugin-1.0.1a1-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file ovos_wikipedia_plugin-1.0.1a1.tar.gz.

File metadata

  • Download URL: ovos_wikipedia_plugin-1.0.1a1.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for ovos_wikipedia_plugin-1.0.1a1.tar.gz
Algorithm Hash digest
SHA256 280f49e09d6e80a710e8b085b9974ada5b89c612c35b02b857824e0d601b7569
MD5 a4ac09fbe126c8978e169e3a97148628
BLAKE2b-256 4fb31acee1f29262aee09f5d985178e0a90849397f08381000373570e72b6ac6

See more details on using hashes here.

File details

Details for the file ovos_wikipedia_plugin-1.0.1a1-py3-none-any.whl.

File metadata

File hashes

Hashes for ovos_wikipedia_plugin-1.0.1a1-py3-none-any.whl
Algorithm Hash digest
SHA256 3346fbbcc4feae6aa46577504228100c308783566b45a285b20398f82ad6c601
MD5 58199298906394c9aff0a5c9148ef180
BLAKE2b-256 06289c39ae5d0689291268b59be449a179c6fd9627a7b7a790773956b7c1896c

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.0.1a1 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page