Skip to content
andydataguy
AI & SYSTEMS

My agents retrieved topic-specific passages from a private library

Different document types were split where their topics changed and exposed through a local retrieval tool.

Transcripts are cut where the topic changes, so each piece an AI agent gets back holds one topic.

A video transcript flows as a ribbon with a colour for each topic. A fixed-size blade cuts through topics; a second blade cuts only where the colour changes. An AI agent probes both piles: five pieces rise from the fixed-size pile, three of them off topic, then two rise from the topic pile, each holding one topic.
5M
words, by my count
4
task-typed embeddings
MCP
exposed
3
source types, each cut its own way
Case Studies

Context

My own knowledge base and agent workflows: over 5M words by my count, across hundreds of mostly Markdown files, plus textbooks in PDF and YouTube content (transcripts and comments). All of it needed to be queryable locally by whatever agents I was experimenting with.

Problem

Vanilla RAG stacks with static chunking and a single generic embedding couldn't handle the mix. Long essays, structured SOPs, noisy transcripts, and comment threads all got chopped poorly. Retrieval felt random, and nothing integrated cleanly with locally run agent tooling.

Approach

I built on the open-source Archon platform and replaced its default pipelines with document-type-specific ones. The default cut every 5,000 characters and split topics apart. For each source (Markdown, PDF, YouTube), my chunker cuts where the topic changes instead. For retrieval I used Google's Gemini Embedding 001 question-answering and document-query task types. The whole thing is exposed through a locally run MCP so any agent in my IDE can use it as a tool.

Stack

  • Archon
  • Gemini Embedding 001 (cluster, semantic, QA, query task types)
  • Python stack (Pydantic, FastAPI, Logfire, Hypothesis)
  • Local MCP integration
  • Vector indexing inside Archon

Result

5M+ words
historical library size by Andy's count

I have a retrieval engine that pulls passages from my own writing, external textbooks and YouTube data on demand. Each piece an agent gets back holds one topic, and agents draft, fact-check and explore ideas against the corpus I actually care about.

Impact

My content systems and agent experiments all pull from this engine, and I control the corpus behind it.

Lessons

Document-type-specific chunking and task-typed embeddings matter as much as the base model. If you treat RAG as an afterthought, everything built on top of it inherits the sloppiness.

Who this is for

For teams who want their agents grounded in a large private corpus and want to own the retrieval stack instead of renting it.

Get a quote
On this page

The method behind this result