中文

LOTUS

LOTUS, from Stanford University and UC Berkeley, introduced and optimizes semantic operators.

Verified

Core facts

Read by a script from the official API, not rewritten by a model.

License
Apache-2.0
Languages
Python
Maintainer
lotus-data
Verified

What it is

LOTUS stands for LLMs Over Text, Unstructured and Structured Data. LOTUS comes from Stanford University and UC Berkeley. LOTUS introduced and optimizes semantic operators.

Semantic operators let you process large datasets with LLMs and natural language instructions. The project says that LOTUS makes agentic and LLM bulk processing fast, easy, and robust, which is the project's own description of what the tool offers to its users.

Main features

  1. Each semantic operator implements an LLM-based transformation over a dataset.

  2. A semantic operator is specified with a natural language instruction, and its operations can be transparently optimized.

  3. LOTUS supports two classes of semantic operators.

  4. Agentic operators run tool-using agents over a corpus.

  5. LLM operators include sem_map, sem_filter, sem_agg, sem_join, sem_extract and others.

  6. The project says it optimizes semantic operators for higher accuracy and lower cost.

  7. The project reports that across diverse tasks, its optimized pipelines match or exceed the accuracy of high-quality baselines while running substantially faster and cheaper than those baselines.

Getting started

  1. In the Quickstart, you give LOTUS a corpus and a task.

  2. In the Quickstart, LOTUS shards the corpus and spawns an agent per shard.

  3. In the Quickstart, each agent has a sandboxed Python REPL for exact computation.

  4. In the Quickstart, after an agent runs on each shard, LOTUS reduces the per-shard findings into one answer for the corpus and the task that were given.

From the README · bash
pip install lotus-ai
From the README · python
import lotus
from lotus.models import LM
from lotus.tools import PythonREPLTool

# Configure the LM — export your API key first (e.g. export OPENAI_API_KEY=sk-...)
lotus.settings.configure(lm=LM(model="gpt-5", reasoning_effort="low"))

# A corpus can be inline documents, a DataFrame, files, or one large text.
# Here: a few small functions, some of them subtly buggy.
snippets = [
    "def average(nums): return sum(nums) / (len(nums) - 1)",
    "def word_count(s): return len(s.split())",
    "def percent(part, whole): return part / whole",
    "def reverse(s): return s[::-1]",
]
corpus = lotus.Corpus.from_documents(snippets)

# Each agent actually *runs* its function in a sandboxed REPL to find bugs —
# then LOTUS reduces the per-function results into one report.
result = corpus.agent(
    task="Test each function on example inputs and report which ones are buggy, "
         "with a counterexample for each bug.",
    ops=["map", "reduce"],       # compose agentic ops: map, filter, reduce
    tools=[PythonREPLTool()],
)

print(result.output)   # the reduced bug report

Who it is for

You express what you want over a dataset using high-level semantic operators. The LOTUS optimizer decides how to run the work, including batching calls. In deciding how to run the work, the LOTUS optimizer is also described as applying model cascades and proxies, and lazily planning the whole pipeline.

Deep research and synthesis involves fanning out over a corpus, extracting, and synthesizing. Agent-trace failure analysis mines large volumes of agent logs for failure modes. Document extraction and unstructured analysis produce structured fields and insights from text.

LLM-judge evals score model outputs, app responses, and content quality, row by row. RAG retrieves the relevant context and generates grounded answers over your data.

Sources

This page is written from the official sources below. Open them to check the original text.

Verified ·

This page is written by AI from the official sources above and checked automatically. This site has not tested it. Found a mistake? Tell us.