Report Abuse

Basic Information

ask.py is a single Python program that implements a search-extract-summarize flow to mimic AI search engines like Perplexity. Given a query it can search the web or use local files, crawl and scrape document text, chunk and store content in a vector store, run a hybrid vector and BM25 full-text search, optionally rerank results, and use an LLM to generate a summarized answer with references. It supports running as a command line tool or launching a Gradio web UI with GradIO sharing and can be scripted or run in cron jobs. The project also supports local inference and embedding providers, separate endpoints for inference and embeddings, and configurable behaviors such as date or site restriction, output language and length, extract mode for structured data, and scraping a specified list of URLs.

Links

Categorization

App Details

Features
The repository provides an end-to-end pipeline: web search and local modes, web crawling and scraping, chunking (Chonkie), storage into a DuckDB-based vector store, hybrid vector plus BM25 full-text search, optional reranker, and LLM-based answer generation. It supports multiple LLM endpoints and embedding providers including local Ollama models, DeepSeek for inference with OpenAI embeddings, and environment-file configuration for switching providers. CLI flags allow fine-grained control (date-restrict, target-site, output-language, output-length, output mode, url list, extract schema). It ships a GradIO/Gradio UI with sharing options and includes demos for common use cases and examples for deployment to HuggingFace Spaces.
Use Cases
ask.py is useful as a lightweight playground to learn and experiment with the components of an AI search assistant. It helps users prototype search-and-answer flows, test hybrid retrieval approaches, and evaluate different inference and embedding providers including local models for privacy. The tool makes it easy to restrict searches by date or site, extract structured data using a Pydantic schema, query local document collections, and automate tasks via CLI or scheduled runs. It also simplifies deploying a demo UI via GradIO or HuggingFace Spaces. The README clarifies that the project is intended for concept demonstration and learning rather than production-scale performance.

Please fill the required fields*