This release is a pre-release and may not be stable for production use.
ovos-wikipedia-plugin
This plugin connects OpenVoiceOS to Wikipedia. It provides a retrieval engine for RAG pipelines and an agent toolbox for tool-using agents. Both ship as standard OPM plugins.
Installation
pip install ovos-wikipedia-plugin
OPM Entry Points
| Entry point | Class | Use case |
|---|---|---|
opm.agents.retrieval (ovos-wikipedia-plugin) |
WikipediaRetrievalEngine |
Retrieval. Returns ranked (passage, score) tuples |
opm.agents.toolbox (ovos-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, and scores them for relevance. It can also apply 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. Any OPM-compatible agent loop, such as
ovos-agentic-loop, can discover and call it.
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)
Related Projects
- OpenVoiceOS/ovos-plugin-manager: the plugin manager that discovers OPM entry points
- TigreGotico/ovos-agentic-loop: agent loop that consumes toolbox plugins like this one
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ovos_wikipedia_plugin-1.0.1a2.tar.gz.
File metadata
- Download URL: ovos_wikipedia_plugin-1.0.1a2.tar.gz
- Upload date:
- Size: 7.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a56cef11e71bc6c01676788eafc96ef46bce400ef9e42891cb993ccab34d81f1
|
|
| MD5 |
3e6bffdef6d0ffc5db03ba98d2ac45d4
|
|
| BLAKE2b-256 |
4836bd5a0ab956a2ef288c503cbf9b43150e0a56241aa4043e81579ddda4e2c3
|
File details
Details for the file ovos_wikipedia_plugin-1.0.1a2-py3-none-any.whl.
File metadata
- Download URL: ovos_wikipedia_plugin-1.0.1a2-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3e52282f945ebb17161f1b7c1d4c01fb2af0929b2a878cd0b6c855b0b874ad9
|
|
| MD5 |
e7ccada1bfaa99e21fe22aeb2bb8afa7
|
|
| BLAKE2b-256 |
a24d8a3ac34afad9c569ef36e091a2a44656bb4360bcf8ad864f9d30d9bce975
|