Pyoogle is a Python-specific search engine for discovering high-quality articles, tutorials, release notes, and technical writing from the Planet Python ecosystem. It combines live source feeds, resumable web crawling, Common Crawl history, full-text ranking, and semantic retrieval in a self-hostable application.
Codex Hackathon submission: Pyoogle was built primarily in one long-running OpenAI Codex thread powered by GPT-5.6.
Codex was the primary engineering agent for the project. I used /goal to keep the central
objective active across a long implementation cycle: analyze, build, measure, and continuously
optimize Pyoogle's initial ingestion pipeline and background-job system. Keeping that work in
mostly one thread gave Codex the architectural and operational context needed to improve the
system without repeatedly rediscovering earlier decisions.
- End-to-end implementation: Codex wrote all code in this repository, including the FastAPI backend, crawler and ingestion pipelines, SQL migrations, search ranking, worker orchestration, frontend, deployment configuration, maintenance commands, and automated tests.
- Goal-driven iteration:
/goalwas used to sustain the multi-stage effort around initial ingestion and background jobs instead of treating each optimization as an isolated prompt. - Performance analysis: Codex inspected query plans, job leases, Common Crawl range reads, CockroachDB transaction behavior, R2 uploads, embedding work, and worker concurrency to find the actual throughput and reliability bottlenecks.
- Resumability and production hardening: Codex designed checkpointed jobs, retryable transactions, lease recovery, bounded concurrency, graceful shutdown, approval gates, and safe fallbacks so multi-hour ingestion work survives failures and deployments.
- Continuous verification: Codex repeatedly reviewed the repository, added regression tests, ran the full suite, and tightened security and deployment behavior as the system evolved.
My role was to define the product direction, provide operational constraints and live benchmark feedback, make trade-off decisions, and steer the goal. Codex and GPT-5.6 turned that direction into the working application.
- FastAPI backend.
- Plain HTML/CSS/JS frontend.
pydantic-settingsfor all env management throughpyoogle.config.Settings.- CockroachDB for canonical SQL data, resumable jobs, full-text search, and vectors.
- Cloudflare R2/S3-compatible storage for artifacts.
- Real embeddings with
fastembed.
You need Python 3.11 or newer, a CockroachDB database, and an S3-compatible bucket such as Cloudflare R2.
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
cp sample.env .envFill these values in .env:
DATABASE_URLS3_ENDPOINT_URLS3_BUCKETS3_ACCESS_KEY_IDS3_SECRET_ACCESS_KEY
The remaining settings have local defaults in sample.env. HF_TOKEN is optional
but helps avoid anonymous model-download rate limits on a fresh machine.
pyoogle migrate
pyoogle startOpen http://localhost:8000. pyoogle start runs the web app and one
worker in the same process. Migrations and ingestion jobs are resumable after interruption.
The service does not enqueue crawl work on startup.
Planet Python defines Pyoogle's accepted source list. Crawl flags can narrow a test run, but they do not expand that source list.
For the full initial bootstrap:
pyoogle enqueue-initial-allFor a small, single-domain trial:
pyoogle enqueue-planet --domain blog.python.org
pyoogle enqueue-source-feeds --domain blog.python.org
pyoogle enqueue-domain-crawl --domain blog.python.org
pyoogle enqueue-commoncrawl --domain blog.python.org --limit 25If pyoogle start is not running, process one queued batch with:
pyoogle worker-onceUnbounded Common Crawl imports estimate each domain first. Small domains are automatically allowed; high-volume shared domains wait for operator review before any broad historical fetch. See Crawling for the job flow, source policy, and review gate.
| Use case | Command |
|---|---|
| Local web app and worker | pyoogle start |
| Production web process | pyoogle-web |
| Production worker process | pyoogle-worker |
| One finite worker batch | pyoogle worker-once |
| Inspect resolved settings | pyoogle config |
Worker leases, retries, and checkpoints live in CockroachDB. A clean shutdown releases active leases so another worker can resume immediately. For concurrency, queue draining, maintenance, alerts, and profiling, use the Operations guide.
- CockroachDB is the canonical lexical and vector search backend.
- Lexical ranking weights title, URL, lead text, and document body separately.
- Semantic retrieval searches document chunks and combines results with lexical matches.
- AI overview mode sends bounded hybrid context to the OpenAI Responses API, validates every
source-number citation, and caches successful answers by query, exact sources, model, and
prompt version. Leave
AI_API_KEYempty to disable it. - Manticore is an optional, rebuildable lexical serving index; search falls back to CockroachDB whenever it is incomplete or unavailable.
Implementation and ranking details live in Architecture: Search.
Start the web app and worker with Docker Compose:
docker compose -f infra/compose.yml up --buildCockroachDB and R2 remain external services configured through .env. Production deployments
normally run pyoogle-web and pyoogle-worker separately.
- Architecture diagram — components and data flow.
- Architecture — system boundaries, persistence, and search.
- Crawling — Planet source policy, crawl jobs, and Common Crawl behavior.
- Operations — queueing, worker tuning, repairs, cleanup, and monitoring.
- Deployment — Docker, Coolify, VM setup, and production configuration.
- Contributing — local development, checks, and crawl-policy changes.