Skip to main content
← All Tags

Codexity Series

8 articles in this category

PythonFastAPIDocker

Codexity Part 8: The Complete Answer Engine

The final chapter. Assemble every module into a running application. Complete source code, Docker deployment, configuration, testing, and performance tuning for the full Codexity answer engine.

Read more
PythonFastAPISSE

Codexity Part 7: Server-Sent Events and Streaming

Implement production-grade SSE streaming in FastAPI. Handle connection drops, heartbeats, backpressure, error recovery, and the HTTP details that make streaming reliable.

Read more
PythonLLMAI

Codexity Part 6: Small Model Inference with llama-cpp-python

Run a quantized 7B model locally to generate cited answers from scraped web content. Choose between Qwen, Mistral, Phi, and Llama models. Build prompts that make small models behave like large ones.

Read more
PythonNLPSearch

Codexity Part 5: Content Processing and Relevance Ranking

Take raw scraped text from 12 web pages and transform it into a focused context window for an LLM. Chunk text, score relevance with BM25, select the best fragments, and format them with source citations.

Read more
PythonWeb ScrapingPlaywright

Codexity Part 4: Web Scraping, Proxies, and Anti-Bot Warfare

Fetch and extract content from 15 web pages concurrently. Handle JavaScript rendering with Playwright, dodge anti-bot systems, rotate proxies, and strip HTML down to clean text using readability-lxml and BeautifulSoup.

Read more
PythonAsyncSearch

Codexity Part 3: Async Web Search with DuckDuckGo

Fire multiple search queries in parallel using DuckDuckGo's Python library and asyncio. Handle rate limiting, deduplicate results, and build a resilient search layer that does not depend on paid APIs.

Read more
PythonAILLM

Codexity Part 2: Query Rewriting with LLMs

A user types a vague question. The query rewriter transforms it into targeted search queries using a local LLM. We cover intent classification, query decomposition, and prompt engineering that actually works with small models.

Read more
PythonAISearch

Codexity Part 1: Architecture of an Answer Engine

The first chapter in a series on building a Perplexity-style answer engine from scratch in Python. We lay out the full architecture, set up the project skeleton, and understand every component before writing a single line of business logic.

Read more