User:SpinachBot

From Wikidata
Jump to navigation Jump to search
Wikidata Bot

PythonPywikibot

This user account is a bot with a bot flag. The bot is operated by HTriedman (WMF).
  • Block this bot if it is malfunctioning.
  • Check its work.
  • Contact the operator about mistakes.
  • See all Requests for Permissions related to this bot: 1
  • Type of execution: periodically
  • Source: Wikimedia Gitlab repo

This bot is an auto-responding SPARQL generation and question answering bot created by User:HTriedman (WMF) and Stanford's Open Virtual Assistant Lab (OVAL) — specifically Shicheng Liu, Sina Semnani, Jialiang Xu, Isaac Dan Zhao, and Monica Lam.

When tagged and prompted by you, SpinachBot will try to write a SPARQL query based on your input request and send it to Wikidata Query Service. It will then post its response — either a query and result set, or a list of steps it tried that failed. You can tag it to provide feedback on the query and it will iteratively refine the query.

Presently, this agent runs on OpenAI's GPT-4o model. In the future, we may offer a choice of various models and/or distill a smaller, faster local model for this purpose.

You can also interact with the bot in a chat format at https://spinach.genie.stanford.edu/.

User guide

[edit]

SpinachBot supports both one-off question answering and conversational back-and-forth with users on-wiki. You can trigger a response from the bot as follows:

  1. On any Wikidata page where you have a question to ask of SpinachBot, enclose your question in the spinachbot top and spinachbot bottom templates, tag SpinachBot, and hit publish.
  2. In 10-20 minutes, SpinachBot will respond to your query with its best guess of a SPARQL query that answers your question and a set of results from that query. If it cannot answer your question, it will summarize the steps it took and some potential future directions to explore. All SpinachBot responses will be wrapped in spinachbot response and spinachbot response end templates.
  3. Every SpinachBot response will include a link to a "trace of reasonings and actions" page for that query, which shows the query that the bot received and lists every single step it took, as well as intermediate results. Here's an example of a trace of reasonings and actions page.
  4. If you aren't satisfied with the results of the response from SpinachBot or would like to suggest a new direction for the bot to explore, just add a new line to your spinachbot top/bottom block tagging SpinachBot and telling it what you'd like it to do next. It will get back to you soon!

Example

[edit]

Below is an example of a back and forth between a user and SpinachBot. In it, you can see an initial query, an initial response from the bot, a slight amendment to that query, and an updated response from the bot.

More examples:

Background

[edit]

SpinachBot is the result of a collaboration between User:HTriedman (WMF) and Stanford's Open Virtual Assistant Lab (OVAL). It uses a large language model (LLM) combined with a limited set of executable actions on Wikidata to achieve agentic behavior in searching Wikidata and creating high-quality SPARQL queries.

SpinachBot is only the latest in a line of Wikimedia project-based LLMs and agents. Under the direction of Monica Lam, OVAL has produced Wikichat (an LLM grounded in Wikipedia content), STORM (an agent that creates Wikipedia-like reports on subjects), and SpinachBot. This bot is the first project that is the result of informal collaboration between the Wikimedia Foundation and OVAL.