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.
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
- 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
Release history Release notifications | RSS feed
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
331661b7cd2ff8b20808aa009b86e347199991ee656e739a50527141c16db82f
|
|
| MD5 |
de3abdf7716277b6fdf484c6fef4eadc
|
|
| BLAKE2b-256 |
7eeb660a27eee3cb65b80a6b5f37f0b84b520fa09adda2ae05461c7c04354099
|
Provenance
The following attestation bundles were made for grag_search-0.1.0.tar.gz:
Publisher:
python-publish.yml on Teral-Americas/grag
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
grag_search-0.1.0.tar.gz -
Subject digest:
331661b7cd2ff8b20808aa009b86e347199991ee656e739a50527141c16db82f - Sigstore transparency entry: 1399212161
- Sigstore integration time:
-
Permalink:
Teral-Americas/grag@243f9a476868dd21394de7249afb56d0099bdf2b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Teral-Americas
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@243f9a476868dd21394de7249afb56d0099bdf2b -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b277112f6c30895f5a23633c765f35d1eda777da4d95e98245a339ee83cd82d
|
|
| MD5 |
eb102403227bb905ffad95c2adea13a0
|
|
| BLAKE2b-256 |
6242a7765af47356b65b96196015012d29ba711625d5a2b915d52b9e11045d24
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
grag_search-0.1.0-py3-none-any.whl -
Subject digest:
2b277112f6c30895f5a23633c765f35d1eda777da4d95e98245a339ee83cd82d - Sigstore transparency entry: 1399212165
- Sigstore integration time:
-
Permalink:
Teral-Americas/grag@243f9a476868dd21394de7249afb56d0099bdf2b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Teral-Americas
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@243f9a476868dd21394de7249afb56d0099bdf2b -
Trigger Event:
release
-
Statement type: