Skip to main content

Brongtus

PyPI version License: MIT Python 3.10+

A free, local, intelligent search tool mimicking Exa with Playwright, LangGraph, up to 90% algorithmic token pruning, and optional Gemini enhancement with Reddit community fact-checking.


Highlights

  • 100% Free & Open-Source: No mandatory API subscriptions.
  • Playwright Powered: Renders modern JavaScript, SPAs, and dynamic web pages.
  • Up to 90% Algorithmic Token Pruning: Uses justext, trafilatura, and BM25 Okapi passage ranking to strip boilerplates, ads, and navigation noise without hardcoded lists.
  • Hybrid Intelligence (Local + Gemini):
    • Local Mode: Runs offline via Ollama (qwen2.5, llama3.2, deepseek-r1) or built-in heuristic extractors.
    • Gemini Hybrid Mode: Pass your GEMINI_API_KEY (defaults to gemini-3.6-flash) to unlock ultra-sharp curation and Reddit community discussion cross-verification (filtering out rumors while capturing verified community consensus).
  • First-Class LangChain Integration: Natively implements BaseTool and BaseRetriever ready for AI agents and RAG pipelines.

Installation

pip install brongtus
playwright install chromium

To enable Gemini enhancement and local LLM drivers:

pip install "brongtus[gemini,local-llm]"

Quickstart

1. Pure Local Search (100% Free)

Runs completely offline without external APIs:

from brongtus import Brongtus

engine = Brongtus(local_model="qwen2.5:7b")

response = engine.search("solid state battery commercialization", num_results=3)

print(f"Token savings: {response.token_savings_percent}%\n")
for r in response.results:
    print(f"[{r.score}] {r.title}")
    print(f"URL: {r.url}")
    print(f"Summary: {r.summary}")
    for h in r.highlights:
        print(f"  - {h}")
    print("-" * 50)

2. Hybrid Mode (Gemini 3.6 Flash + Reddit Fact-Checking)

Add your GEMINI_API_KEY (in .env or passed directly) to unlock ultra-smart curation and Reddit community cross-verification:

import os
from brongtus import Brongtus

engine = Brongtus(
    gemini_api_key=os.getenv("GEMINI_API_KEY"),
    gemini_model="gemini-3.6-flash",  # Default model
    enable_compression=True
)

response = engine.search("lenovo legion series laptops battery life")

# Standard Web Results
for r in response.results:
    print(f"[{r.score}] {r.title} ({r.url})")
    print(f"Summary: {r.summary}\n")

# Fact-Checked Community Insights
if response.community_insights:
    ci = response.community_insights
    print("Community Consensus:\n", ci["community_sentiment"])
    print("\nVerified Takeaways:")
    for v in ci["verified_takeaways"]:
        print(f"  [+] {v}")
    print("\nDebunked Rumors / Myths:")
    for d in ci["debunked_or_unverified"]:
        print(f"  [!] {d}")

LangChain & Agent Integration

LangChain AI Agent Tool (BrongtusSearchResults)

Bind BrongtusSearchResults directly to tool-calling agents:

from brongtus.langchain import BrongtusSearchResults
from langchain_google_genai import ChatGoogleGenerativeAI
from langchain_core.messages import HumanMessage

# Initialize tool
search_tool = BrongtusSearchResults(num_results=3)

# Bind tool to model
llm = ChatGoogleGenerativeAI(model="gemini-3.6-flash").bind_tools([search_tool])

# Run query
ai_msg = llm.invoke([HumanMessage(content="Find real-world experiences with Lenovo Legion battery life")])

LangChain RAG Retriever (BrongtusRetriever)

Plug local search directly into RAG chains:

from brongtus.langchain import BrongtusRetriever
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.output_parsers import StrOutputParser
from langchain_google_genai import ChatGoogleGenerativeAI

retriever = BrongtusRetriever(k=3)
llm = ChatGoogleGenerativeAI(model="gemini-3.6-flash")

prompt = ChatPromptTemplate.from_template("""
Answer the question based ONLY on the following context:
{context}

Question: {question}
""")

chain = (
    {"context": retriever, "question": lambda x: x}
    | prompt
    | llm
    | StrOutputParser()
)

answer = chain.invoke("What are the real-world battery experiences with Lenovo Legion laptops?")
print(answer)

API Reference

Brongtus Parameters

Parameter Type Default Description
gemini_api_key str | None None Google Gemini API key. Automatically reads from .env or system environment.
gemini_model str "gemini-3.6-flash" Gemini model identifier (e.g. gemini-3.6-flash, gemini-2.5-flash, gemini-1.5-pro).
local_model str "qwen2.5:7b" Name of local Ollama model to use for query planning and offline extraction.
custom_llm BaseChatModel None Any custom LangChain chat model instance.
enable_compression bool True Enables algorithmic 3-tier token reduction (pruning ~60–90% of junk tokens).
target_compression_words int 500 Target word budget per page for compressed passages.
headless bool True Runs Playwright in headless browser mode.
enable_hitl bool False Enables LangGraph Human-in-the-Loop review gates for candidate URLs.

SearchResponse & SearchResult Fields

response = engine.search("quantum computing milestones")

# Response Metadata
response.query                 # Original query string
response.token_savings_percent # Percentage of tokens pruned (e.g. 74.2%)
response.community_insights    # Fact-checked Reddit insights (when Gemini is active)

# Results
for r in response.results:
    r.title                    # Web page title
    r.url                      # Web page URL
    r.score                    # Relevance score (0.0 to 1.0)
    r.summary                  # Factual, concise summary
    r.highlights               # Key verbatim highlight snippets
    r.text                     # Algorithmic compressed text

License

MIT License. Free for open-source and commercial use.

Metadata

Release files for brongtus 0.1.1

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

Source distribution (sdist)

Source distribution for brongtus 0.1.1
File Size Uploaded Provenance Actions
brongtus-0.1.1.tar.gz 18.2 kB Without provenance Details for brongtus-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for brongtus 0.1.1
File Interpreter ABI Platform Actions
brongtus-0.1.1-py3-none-any.whl Python 3 none any Details for brongtus-0.1.1-py3-none-any.whl

Total release size: 40.0 kB

Release files / brongtus-0.1.1.tar.gz

Download URL brongtus-0.1.1.tar.gz
Size 18.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ff91223741271b0f29c038e20c91e491b92cb862a752cd479ed0bebd618f9960
BLAKE2b-256 checksum
How to use checksums
0c12986ab0699fa0cf0d285e428763bea8d7044cefd65513b3e7538823c1a72b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Release files / brongtus-0.1.1-py3-none-any.whl

Download URL brongtus-0.1.1-py3-none-any.whl
Size 21.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
34852687b6e9dc000d41f4fbc0a3937606c09be7b718bd354910d1eda97eeda6
BLAKE2b-256 checksum
How to use checksums
ef8369b90f82ef3dfec5699a6143eb1d2c6d2789d3f0eac864adf98f2ba83e16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.15

Security for brongtus 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

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