Skip to main content

Token-Efficient Ingestion Middleware & Concept-Diff Engine for Deep Research AI Agents.

Project description

DeepResearch-Lite ⚡

Token-Efficient Ingestion Middleware & Concept-Diff Engine for Deep Research AI Agents

License: MIT Python 3.10+ Token Savings

DeepResearch-Lite is an intelligent, high-performance gatekeeper layer designed for AI Research Agents (such as langchain-ai/open_deep_research, smolagents, AutoGPT, CrewAI, or custom LangGraph workflows).

It solves the Extreme Token Bloat & Repetitive Fluff flaw in existing deep research systems by shifting the paradigm from "Read raw 5,000-word scraped web pages" to "Compile knowledge incrementally as it arrives."


🚀 Key Features

  • Dual-Layer Extraction Architecture:
    • Layer 1 (LLM Mode): Sub-second structured JSON triplet extraction (Subject ──► Predicate ──► Object) via Gemini 2.5 Flash or OpenAI Mini when an API key is available.
    • Layer 2 (Professional Local NLP Mode): 0-ms offline local NLP parser (regex metric extraction, grammar triplet matching, entity resolution) when running without API keys.
  • Session Knowledge Graph: Maintains an in-memory graph state of all entities, metrics, and claims learned during a research session.
  • Concept-Diff Engine: Classifies scraped facts into 3 categories:
    • DISCARD: Repetitive background fluff deleted immediately ($0 LLM tokens spent).
    • DIFF_ADD: Novel assertions added to graph & passed in Diff Payload.
    • DIFF_CONFLICT: Contradictory statements (e.g. $110 vs $140/kWh) explicitly flagged.
  • 80%+ Token & Cost Reduction: Delivers a ~150-word Diff Payload to the main reasoning model instead of 5,000 words of background history.

⚡ Quickstart

1. Installation

pip install -e .

2. Basic Usage (Python API)

import asyncio
from open_deep_research.concept_diff import ConceptDiffEngine

async def main():
    # Automatically uses GEMINI_API_KEY if present, otherwise uses Professional Local NLP
    engine = ConceptDiffEngine()

    raw_scraped_text = """
    Electric vehicles have become popular over the last decade... 
    Lithium-ion batteries were invented by John Goodenough...
    In 2026, researchers demonstrated a solid-state cell achieving 500 Wh/kg energy density.
    Target production cell cost is $110/kWh.
    """

    # Process raw scrape into a condensed Diff Payload
    diff_payload = await engine.process_observation(
        raw_text=raw_scraped_text,
        source_url="https://tech-news.com/ev-batteries",
        source_title="EV Battery 2026 Report"
    )

    print(diff_payload)

if __name__ == "__main__":
    asyncio.run(main())

📊 Benchmark & Scorecard

Running DeepResearch-Lite on real web searches (2026 solid state battery Wh/kg breakthroughs):

===========================================================================
🏆 DEEPRESEARCH-LITE HACKATHON SCORECARD
===========================================================================
METRIC                         | BASELINE AGENT     | DEEPRESEARCH-LITE 
---------------------------------------------------------------------------
Live Web Words Fetched         | 9,159 words        | 1,083 words       
Input Tokens Passed to LLM     | 11,906 tokens      | 1,407 tokens      
Estimated Cost per Search Run  | $0.0298            | $0.0035           
Token Reduction                | 0% (Full Bloat)    | 88.2% SAVED ⚡     
Fact-to-Fluff Signal Ratio     | ~15% High Signal   | ~95% High Signal ⚡
===========================================================================

🛠️ Framework Integration

LangGraph / open_deep_research Integration

DeepResearch-Lite integrates seamlessly into open_deep_research/deep_researcher.py at the researcher_tools() node:

from open_deep_research.concept_diff import ConceptDiffEngine

diff_engine = ConceptDiffEngine()

# In researcher_tools():
processed_observations = []
for obs, tool_call in zip(observations, tool_calls):
    if len(obs) > 100:
        diff_payload = await diff_engine.process_observation(obs, source_title=tool_call['name'])
        processed_observations.append(diff_payload)

🧪 Testing & Demonstration Scripts

  • Run Unit Tests:

    python -m pytest tests/test_concept_diff.py
    
  • Run Side-by-Side Hackathon Benchmark:

    python demo_comparison.py
    
  • Run Live Internet Search Comparison:

    python run_live_test.py "your custom research prompt"
    

📄 License

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

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

open_research_lite-0.1.0.tar.gz (70.9 kB view details)

Uploaded Source

Built Distribution

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

open_research_lite-0.1.0-py3-none-any.whl (78.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for open_research_lite-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8811e8c696b93cd5d4f82be7accac27fb80c008b8265a0e40fcf794e54b9d43f
MD5 755e51633558a6cd04983c95972a35e7
BLAKE2b-256 7de57c0497af2678a9f0fee17c61b225b52c7ec4cc8f2b3c90c8ea94be3dcc29

See more details on using hashes here.

Provenance

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

Publisher: pypi-publish.yml on vishal-raaj-dnd/open-research-lite

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

File details

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

File metadata

File hashes

Hashes for open_research_lite-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 59938b629c3cf2da5c7a3fc39f26422c921c1c5e4993613978cb53b422631d4d
MD5 abbadf8e6b67c7aa344091043e1c4b88
BLAKE2b-256 4d2e5f5ab840afe3d3b34ef9257db3571dd0f60cf88a7bb0446278881dea3137

See more details on using hashes here.

Provenance

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

Publisher: pypi-publish.yml on vishal-raaj-dnd/open-research-lite

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