Skip to main content

Fast grep-based document search for LLM agents. No embeddings, just speed.

Project description

grag

Fast grep-based document search for LLM agents. No embeddings, just speed.

PyPI version Python versions License: MIT

Why grag?

  • 10x faster than embeddings-based search for exact matches
  • Zero cost - no API calls, no vector databases
  • Precise - finds exact terms, not "similar" content
  • Lightweight - minimal dependencies
  • LLM-ready - returns context windows perfect for prompts

Quick Start

pip install grag
from grag import Grag

# Index your documents
store = Grag("./contracts")

# Search with context
results = store.search("late payment penalty", context_chars=500)

# Use in LLM prompt
for result in results:
    print(result.format_for_llm())

Supported Formats

  • PDF
  • DOCX (Word)
  • XLSX (Excel)
  • CSV
  • TXT
  • Markdown (.md, .markdown)

When to use grag vs RAG

Use grag for:

  • Exact term matching (IDs, dates, specific clauses)
  • Legal/medical documents with precise terminology
  • Cost-sensitive applications
  • Low-latency requirements

Use RAG for:

  • Semantic similarity
  • Multi-lingual fuzzy matching
  • Conceptual queries

Or use both: grag first for exact matches, RAG as fallback.

Development Status

v0.1.0 — Alpha release. The API is functional and tested. Feedback welcome.

Contributing

Contributions welcome. Open an issue or PR on GitHub.

License

MIT License - see LICENSE file for details.

Author

Built by Alan Sepulveda for Teral and the open source community.

Project details


Download files

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

Source Distribution

grag_search-0.1.0.tar.gz (25.1 kB view details)

Uploaded Source

Built Distribution

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

grag_search-0.1.0-py3-none-any.whl (25.5 kB view details)

Uploaded Python 3

File details

Details for the file grag_search-0.1.0.tar.gz.

File metadata

  • Download URL: grag_search-0.1.0.tar.gz
  • Upload date:
  • Size: 25.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for grag_search-0.1.0.tar.gz
Algorithm Hash digest
SHA256 331661b7cd2ff8b20808aa009b86e347199991ee656e739a50527141c16db82f
MD5 de3abdf7716277b6fdf484c6fef4eadc
BLAKE2b-256 7eeb660a27eee3cb65b80a6b5f37f0b84b520fa09adda2ae05461c7c04354099

See more details on using hashes here.

Provenance

The following attestation bundles were made for grag_search-0.1.0.tar.gz:

Publisher: python-publish.yml on Teral-Americas/grag

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file grag_search-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: grag_search-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 25.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for grag_search-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2b277112f6c30895f5a23633c765f35d1eda777da4d95e98245a339ee83cd82d
MD5 eb102403227bb905ffad95c2adea13a0
BLAKE2b-256 6242a7765af47356b65b96196015012d29ba711625d5a2b915d52b9e11045d24

See more details on using hashes here.

Provenance

The following attestation bundles were made for grag_search-0.1.0-py3-none-any.whl:

Publisher: python-publish.yml on Teral-Americas/grag

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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