Catalog PyPI
Back to packageRELEASE DETAILS

0.1.3

PyPI

ailocalconnection

Web search and RAG capabilities for local AI models.

Published3 Aug 2026
Direct dependencies7
Transitive dependenciesNot calculated

README

Version 0.1.3 documentation

AILocalConnection 🌐

Give your local AI models the power to browse the internet.

AILocalConnection is a lightweight Python library that allows local Large Language Models (like Ollama, vLLM, LM Studio) to perform real-time web searches and use the internet as context to answer questions accurately. It acts as an instant Retrieval-Augmented Generation (RAG) agent.

Features ✨

  • 100% Free Search: Uses DuckDuckGo under the hood. No API keys required.
  • Smart Scraping: Fetches search results and scrapes the content of the pages, automatically removing ads, scripts, and navbars.
  • Graceful Fallback: If a website blocks the scraper, it automatically falls back to the search engine's snippet.
  • AILocalMemory Integration: Works flawlessly with ailocalmemory for a complete RAG + Chat History experience.

Installation 📦

You can install AILocalConnection using pip:

pip install ailocalconnection

Quick Start 🚀

1. Generating a Search Prompt

You can use AILocalConnection independently to just build the context prompt, then send it to any AI endpoint manually.

from ailocalconnection import SearchAgent

agent = SearchAgent(max_results=3)

# Automatically searches the web, scrapes the top 3 links, 
# and builds a comprehensive context prompt.
prompt = agent.build_prompt("Who won the UEFA Euro 2024?")

print(prompt) 

If you have ailocalmemory installed, you can combine internet searching with persistent chat history.

from ailocalconnection import SearchAgent
from ailocalmemory import ChatSession, OllamaAdapter

agent = SearchAgent(max_results=2)

with ChatSession(session_id="user_123", storage="memory") as session:
    chat = OllamaAdapter(model="llama3", memory_session=session)
    
    query = "What is the current price of Bitcoin?"
    
    # 1. Search the web and build the RAG prompt
    augmented_prompt = agent.build_prompt(query)
    
    # 2. Send the augmented prompt to Ollama
    response_stream = chat.send(augmented_prompt, stream=True)
    
    for chunk in response_stream:
        print(chunk, end="", flush=True)

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 7

Native requirements
7 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
duckduckgo-search
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
duckduckgo-search>=6.2.0runtime
beautifulsoup4
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
beautifulsoup4>=4.12.0runtime
httpx
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
httpx>=0.27.0runtime
pytest
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
pytest>=7.0; extra == "dev"runtime
pytest-asyncio
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
pytest-asyncio>=0.21.0; extra == "dev"runtime
pytest-httpx
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
pytest-httpx>=0.22.0; extra == "dev"runtime
black
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
black>=22.0; extra == "dev"runtime

Distribution files

2 collected
ailocalconnection-0.1.3-py3-none-any.whl

bdist_wheel · 6.14 KB · Python py3

Source file
ailocalconnection-0.1.3.tar.gz

sdist · 5.74 KB · Python source

Source file

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 11:11 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:3cdbefc84a8ca82a0e152fa84ed3afb4d5e833751b393b6e8d8a19a2b8e53edb

Other collected versions

View all collected versions →