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.0

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.0
File Size Uploaded Provenance Actions
brongtus-0.1.0.tar.gz 18.3 kB Without provenance Details for brongtus-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 40.1 kB

Release files / brongtus-0.1.0.tar.gz

Download URL brongtus-0.1.0.tar.gz
Size 18.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1da5a723dbb1946996cf4a14af551082656793167294c2b879d1d4600c7e8587
BLAKE2b-256 checksum
How to use checksums
e43a13d6333a2b55441a74457100674d46020cda428bc970df13af2b9691b55d
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.0-py3-none-any.whl

Download URL brongtus-0.1.0-py3-none-any.whl
Size 21.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
08a998a405a4d3286f29f53c77c5ace8cc58d8ab6add31e429464c5947518344
BLAKE2b-256 checksum
How to use checksums
de6a2072e25f013df55ed86950010beec59c9c921b2a634367c1807093c2eb1e
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.0

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.0 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