A testable model of AI search retrieval, source selection, answer use, and citations

How AI Search Retrieves and Cites Sources: A Testable GEO Model

The answer first: there is no universal citation algorithm AI search does not expose one shared pipeline that publishers can reverse-engineer into a recipe. Google documents retrieval-augmented generation and query fan-out for AI Overviews and AI Mode. Perplexity documents real-time web search, synthesis, and source links. OpenAI says ChatGPT search uses third-party search providers and content supplied directly by partners. None of those statements proves that the products share the same index, chunker, lexical retriever, vector store, reranker, prompt assembly, or citation policy. ...

July 11, 2026 · 13 min · 2577 words · Xinwei Xiong, Me
A five-layer GEO workflow separating access, usefulness, evidence, extraction, and measurement

GEO in 2026: Evidence, Limits, and a Practical Workflow

The Short Answer Generative engine optimization (GEO) is a useful name for the work of making content eligible, useful, well-supported, and attributable when an AI-assisted search system builds an answer. It is not one ranking algorithm, and it is not a bag of markup tricks. For Google, the official position is deliberately unexciting: AI Overviews and AI Mode are rooted in the same core Search ranking and quality systems, and there are no additional technical requirements or special optimizations for inclusion. Other products have different retrieval stacks and crawler controls, so a responsible GEO practice begins by naming the system rather than speaking about “the AI” as if it were one machine. ...

July 10, 2026 · 13 min · 2681 words · Xinwei Xiong, Me
open-lovable architecture from web scraping through code generation to dual-sandbox preview

Inside open-lovable: Search, Text Protocols, and Sandboxes

open-lovable begins with a compact promise: give it a website, get back a React application you can keep editing. The generated page is the visible trick. The more useful subject is the plumbing underneath—how scraping, model output, and untrusted code execution are joined without surrendering the whole process to the model. First, pin the clock. This article audits firecrawl/open-lovable commit 69bd93bae7a9c97ef989eb70aabe6797fb3dac89 , dated November 19, 2025. “In the project” below means that exact revision. “The platform today” refers to current vendor documentation. A fixed commit is a small discipline, but it prevents later product features from being smuggled into an older implementation. ...

June 29, 2026 · 9 min · 1809 words · Xinwei Xiong, Me
Editorial architecture diagram of Relay with a coordinator, five domain agents, safeguards, browser delivery, and audit boundaries

Relay Agent Architecture in 2026: A Local Implementation Audit

An architecture diagram is a promise. A code audit asks which parts of that promise have acquired weight. My first version of this article treated Relay as a public open-source proposal whose Agent layer had not yet been built. Both claims are now wrong. As of July 31, 2026, the public GitHub URL previously cited by this article returns 404, while I can inspect a private local checkout. This piece is therefore a private/local implementation audit, fixed to local commit 22586e17ccd43cfaff0512511e71a100c5341608. Readers should not assume that repository or commit is publicly downloadable. ...

June 24, 2026 · 11 min · 2298 words · Xinwei Xiong, Me
A wide schematic of context engineering: the Write / Select / Compress / Isolate pillars feeding an AI, a laptop with notes, and a local-first world line

Context Engineering: The New Foundation for AI Agents

Context engineering is the set of strategies for curating, ordering, and evicting the tokens that enter an LLM’s context window on each inference call—system instructions, retrieved documents, conversation history, tool definitions, and memory. The short version is this: prompt engineering optimizes the wording of an instruction; context engineering optimizes the wiring of the whole window. Anthropic has articulated this distinction in its engineering guidance, and Karpathy helped popularize the term. The rest of this article takes the emerging discipline apart. ...

June 22, 2026 · 18 min · 3654 words · Xinwei Xiong, Me
A technical diagram with a tiny agent loop at the center, surrounded by concentric rings of the eight pillars: orchestration, context, memory, tools, reliability, evaluation, cost, governance

Agent Engineering Harness: The Eight Pillars Behind the 98.4%

A small model loop becomes a system only after we decide what it may remember, touch, spend, and survive. An agent demo can be a loop around an API call. A production agent is the surrounding discipline: state, tools, permissions, recovery, evaluation, and cost. This article offers a map of that discipline rather than a framework tutorial. Each pillar is described through the gap it fills, a minimal implementation, and the boundary where it stops helping. ...

June 17, 2026 · 20 min · 4223 words · Xinwei Xiong, Me
Files, memory, runtime boundaries, and evaluation for continuous agent identity

Agent Identity: From Locke to OpenClaw

A philosophical boundary and an engineering practice for continuity in AI agents Start by Making “Identity” Small Enough to Engineer Agent amnesia first damages the cost of cooperation, not the illusion of personhood. A strong session does not guarantee that the next one will preserve the same judgment. Users repeat preferences, teams restate constraints, and the system struggles to explain where an earlier decision came from. Long-term trust rests on these unglamorous forms of continuity: what the agent remembers, what it forgets, why it changed, and who approved the change. ...

April 5, 2026 · 16 min · 3207 words · Xinwei Xiong, Me
A quiet archive of linked memory cards illustrating Mem0 OSS v3 retrieval

Mem0 OSS v3 in Practice: Memory Architecture, Retrieval, and Trade-offs

This project note is part of my attempt to understand open-source AI systems by building with them, reading their migrations, and writing down where the abstraction holds—and where it leaks. Project learning list The problem is not remembering more An LLM can carry a conversation while the relevant messages still fit inside its context window. That is short-term continuity, not memory in the human sense and not durable application state. When the session ends, the model does not naturally retain that a user prefers terse answers, changed jobs last month, or abandoned an earlier plan. ...

May 9, 2025 · 12 min · 2421 words · Xinwei Xiong, Me
Blank cards passing through a wooden ranking staircase toward a reader

LLM Recommendation Systems: Retrieval, Ranking, RAG, and Evaluation

Recommendation systems create a tempting illusion: the newer the model, the more advanced the system. Anyone who has operated one knows that the model is only the part above water. Below it sit exposure bias, latency budgets, feature freshness, inventory constraints, exploration risk, and counterfactual evaluation. Large language models add a useful semantic layer, but they do not make those older problems disappear. They also introduce new ones: higher cost, variable output, and explanations that can sound persuasive without reflecting the reasons an item was ranked. ...

April 23, 2025 · 18 min · 3653 words · Xinwei Xiong, Me
A research notebook connecting source pages, citations, and synthesized outputs

Gemini Notebook (Formerly NotebookLM): A Source-Grounded Research Workflow

On July 16, 2026, Google renamed NotebookLM to Gemini Notebook. The old name will remain in search results, screenshots, and habits for a while, but the product did not disappear. Google describes it as the same standalone research tool, now connected more closely to the Gemini app and, eventually, Google Search. The rename also marks a larger change: notebooks are becoming places where software can not only read sources, but also run analysis against them. ...

April 21, 2025 · 18 min · 3787 words · Xinwei Xiong, Me
A red, green, and blue testing loop surrounding an AI system

Test-Driven Development for AI and LLM Applications: A Practical 2026 Guide

Test-driven development is easy to explain when the function under test adds two numbers. Write a failing test, make it pass, then improve the implementation without changing its behavior. The difficulty begins when the function calls a language model and five different answers may all be acceptable. That does not make TDD obsolete. It means the word test has to become more precise. For an AI application, I use TDD as a discipline for discovering contracts. Some contracts are exact: a parser must reject malformed JSON, an authorization check must not leak another tenant’s data, and a tool call must match its schema. Other contracts are statistical: a support assistant should resolve most routine cases, cite the supplied policy, and rarely invent a refund rule. The first group belongs in ordinary tests. The second belongs in evaluations and monitoring. ...

April 21, 2025 · 16 min · 3402 words · Xinwei Xiong, Me
Documents flowing through a measured conversion pipeline into structured Markdown

Microsoft MarkItDown 0.1.6: A Practical Document-to-Markdown Guide

A document converter is a bridge, not a source of truth. The important question is not whether the output looks clean at first glance, but whether the bridge preserves the evidence your next system needs. MarkItDown is easy to demonstrate: install a package, pass it a file, receive Markdown. The difficult work begins one minute later. A PDF may contain selectable text, scanned pages, diagrams, tables, or all four. A slide deck may hide essential numbers inside screenshots. A spreadsheet may be understandable only through formulas, merged cells, and spatial relationships. No single conversion mode handles every case equally well. ...

April 21, 2025 · 15 min · 3073 words · Xinwei Xiong, Me
A checkpointed LangGraph StateGraph with recovery paths

LangGraph Architecture in 2026: StateGraph, Persistence, and Recovery

This project is an ongoing journey — learning AI open source projects with steady, daily progress. Through hands-on work with real projects and AI tooling, the goal is to develop the ability to solve complex problems and document the process. Notion List Basic Information: Project Name: LangGraph GitHub URL: langchain-ai/langgraph Main Tech Stack: Python, JavaScript/TypeScript, LangChain, LangSmith, checkpoint stores, LLM providers 1. What LangGraph Actually Solves LangGraph is the low-level orchestration framework and runtime in the LangChain ecosystem. It is useful when an agent must retain typed state, branch or loop, pause for a person, survive a process failure, or expose each transition to tracing and tests. You can use LangGraph without using LangChain’s model abstractions. ...

April 19, 2025 · 11 min · 2286 words · Xinwei Xiong, Me
A restrained editorial illustration of connected paths representing models, agents, and graph workflows

LangChain 1.x in Production: Choosing Models, Agents, and LangGraph

LangChain used to be introduced as a box of chains, memory classes, prompt templates, loaders, and integrations. That description is historically accurate and operationally unhelpful. As of July 2026, the useful way to understand LangChain 1.x is much narrower: Call a model directly when the task is one inference with a clear input and output. Use create_agent when a model must choose among tools in a conventional model–tool loop. Use LangGraph when your application has durable state, explicit branches, retries, parallel work, long-running steps, or human decisions that are part of the workflow. This is not merely a taxonomy. It is an engineering rule about where complexity should live. Every framework abstraction creates a second system beside your product: another execution model, another vocabulary, and another place for failure to hide. The abstraction earns its place only when it makes the real system easier to operate. ...

April 16, 2025 · 15 min · 3178 words · Xinwei Xiong, Me
Several model pipelines converge at an AI Gateway where cost and governance are weighed

AI Gateway Guide: LiteLLM, Kong, APISIX, Cloudflare, or Portkey?

An AI Gateway is not merely a reverse proxy placed in front of a language model. Once an application reaches production, every model call carries several kinds of uncertainty at once: long-lived streaming connections, token-based billing, provider quotas, sensitive inputs, changing model behavior, and outputs that cannot be trusted by default. A conventional API gateway can handle part of this traffic. It may authenticate clients, terminate TLS, enforce request limits, and route HTTP requests. It does not automatically answer the questions that matter most to an AI product: ...

April 16, 2025 · 16 min · 3223 words · Xinwei Xiong, Me
LangChain 1.x architecture connecting models, agents, memory, retrieval, and observability

LangChain 1.x in Practice: A Developer Guide to Reliable Agents

A framework is most dangerous not when it lacks features, but when its old tutorials still look plausible. Familiar code can cross a version boundary long before it produces an obvious error. This guide follows the current LangChain Python 1.x path: model calls, agents, tools, structured output, middleware, memory, RAG, SQL, Ollama, and LangSmith. It is deliberately different from a framework overview. The aim is to leave you with a compact application architecture, runnable examples, and a way to recognize code that belongs to the 0.x era. ...

May 22, 2024 · 11 min · 2221 words · Xinwei Xiong, Me
From Language Models to RAG: Capabilities, Limits, and Engineering

From Language Models to RAG: Capabilities, Limits, and Engineering

Introduction: Do Not Learn the Model from the Chat Window The first encounter with a large language model creates a powerful illusion. Something on the other side of the screen appears to have read widely, reasoned carefully, and chosen to explain itself. It can write code, summarize papers, preserve a tone across a conversation, and offer a polished rationale for an answer that is completely wrong. The chat window shows behavior, not mechanism. Fluency hides missing evidence. Completeness hides uncertainty. A human voice invites us to overestimate how firmly the model is connected to the world. ...

May 15, 2024 · 20 min · 4118 words · Xinwei Xiong, Me
From 2024 AI field notes to a reliable production RAG system

2024 AI Field Notes, Reassessed: From Emergence to Production RAG

This article began as notes from a large-language-model meetup in January 2024. Back then, the question was what a model could do. Two years later, the harder question is why anyone should trust the system around it. I have not polished the old notes into a story in which every early judgment was right. Mistakes are useful sediment. They remind us that a technical opinion is not a prophecy; it is a bet with an expiry date. Each section therefore keeps the 2024 observation and adds a 2026 reassessment: still true, changed, or wrong at the time. ...

January 14, 2024 · 11 min · 2234 words · Xinwei Xiong, Me
A clockwork cart passing through controlled gates, representing the evolution from AutoGPT Classic to a governed agent platform

AutoGPT in 2026: From the Classic Experiment to the Platform

Status note, verified July 31, 2026: this article originally explained how to install the 2023 stand-alone Auto-GPT agent. Those commands are obsolete. The official project now says that AutoGPT Classic is unsupported, its dependencies will not be updated, and it has known security issues. Treat Classic as a historical laboratory, not a production tool. For new work, use the maintained AutoGPT Platform or another actively maintained workflow system. In the spring of 2023, Auto-GPT made a compelling promise: describe an objective, give a model some tools, and watch it plan its own way forward. I installed it because the idea felt less like a chatbot feature and more like a change in the shape of software. ...

March 18, 2023 · 10 min · 2100 words · Xinwei Xiong, Me