Skip to main content

verbatim-core

Lightweight verbatim span extraction -- the RAG-agnostic core of verbatim-rag.

Extract exact, verbatim text spans from documents that answer a question. No vector databases, no embeddings, no heavy ML dependencies -- just openai and pydantic.

Installation

pip install verbatim-core

Quick Start

from verbatim_core import VerbatimTransform

vt = VerbatimTransform()
response = vt.transform(
    question="What is the main finding?",
    context=[
        {"content": "The study found that X leads to Y.", "title": "Paper A"},
        {"content": "Results show Z is statistically significant.", "title": "Paper B"},
    ],
)

print(response.answer)

# Access individual highlights and citations
for doc in response.documents:
    for highlight in doc.highlights:
        print(f"  [{highlight.start}:{highlight.end}] {highlight.text}")

What This Package Includes

  • VerbatimTransform -- question + context -> cited, grounded answer
  • LLMSpanExtractor -- extract verbatim spans using an LLM
  • LLMClient -- unified OpenAI API wrapper (sync + async)
  • TemplateManager -- response formatting with multiple template strategies
  • @verbatim_enhance -- decorator to enhance existing RAG functions
  • CLI (verbatim-enhance) -- batch processing from the command line

Model-Based Extraction

For ModernBERT or Zilliz semantic highlight extractors (adds torch, transformers):

pip install verbatim-core[model]

Environment

export OPENAI_API_KEY=your_api_key_here

Full RAG System

For the complete RAG pipeline with vector indexing, embeddings, and document processing, install the full package:

pip install verbatim-rag

Metadata

Release files for verbatim-core 0.2.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for verbatim-core 0.2.8
File Size Uploaded
verbatim_core-0.2.8.tar.gz 47.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for verbatim-core 0.2.8
File Interpreter ABI Platform
verbatim_core-0.2.8-py3-none-any.whl Python 3 none any Details

Total release size: 110.2 kB

Release files / verbatim_core-0.2.8.tar.gz

Download URL verbatim_core-0.2.8.tar.gz
Size 47.8 kB
Tags Source
SHA-256 checksum
How to use checksums
6030ffa14a6bd918db82ac317e1a4b6babd3566b2d2aaabcef6f25f6b91f133f
BLAKE2b-256 checksum
How to use checksums
c507126ccb196962c9e08a096fe5dfae1791f2fdb09082747f5fa101140ce570
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.13

Release files / verbatim_core-0.2.8-py3-none-any.whl

Download URL verbatim_core-0.2.8-py3-none-any.whl
Size 62.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
16e79e02cc87b9733503b0a7dccb09cbd0c60d1ad84a5399fc787a1221fe2ba1
BLAKE2b-256 checksum
How to use checksums
d5f623fe1a765607a2d735f94a67f2a4242f80bfddd5eecdc65792a48ae35754
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.13

Release history Release notifications | RSS feed

This release

0.2.8 This release

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.9

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page