Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Agentic Search Engine

An local search and research agent built in Python. This project lets a local LLM run multi-step web searches, re-rank search results, maintain long-term memory across sessions, and audit its own responses against retrieved source text to avoid hallucinations.

I built this project to experiment with local agentic workflows without depending on closed API ecosystems or paid search services. Everything runs locally on top of Ollama.

How It Works

  1. Planning: Given a prompt, the agent breaks down the problem into sub-queries and execution steps
  2. Search & Scraping: It queries DuckDuckGo, Jina, Tavily, Google CSE, or Bing depending on what keys are configured, falling back automatically if a provider fails.
  3. Re-Ranking: Results are re-ranked using FastEmbed to make sure the context window gets the most relevant snippets.
  4. Memory: ChromaDB stores past search chunks and answered prompts so the agent can recall context from prior searches.
  5. Grounding Audit: The agent evaluates its response against the retrieved source texts. If claims are unsupported or context is missing, it should refrain from guessing and issues a refusal.

Features

  • Plan and Execute Framework: Generates structured step-by-step search plans before synthesis
  • Persistent Vector Memory: Uses ChromaDB for storing and retrieving prior research context
  • Multi-Provider Web Search: Supports DuckDuckGo, Jina Search, Tavily, Google Custom Search and Bing Search
  • Cross-Encoder Re-Ranking: Filters noise out of web search results before passing them into the model's context window
  • Anti-Hallucination Guardrails: Audits output sentences against retrieved text and adds citations
  • AST Math Sandbox: Evaluates math expressions safely without using raw eval()

Requirements

Python 3.10 or higher

Ollama installed and running locally

Installation

  1. Install Dependencies

Clone the repository and install the Python requirements:

pip install -r requirement.txt

  1. Pull Required Models

Make sure the Ollama daemon is running, then pull the target LLM and embedding model:

ollama serve
ollama pull qwen3:8b
ollama pull qwen3-embedding:0.6b 
  1. Run a Search Query

Run a single search query directly from your command line:

python -m agentic_search.cli "your_prompt"

  1. Interactive Mode

Start an interactive shell session:

python -m agentic_search.cli --interactive

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages