Run the Indexer

Run the updated app.py against a docs folder and verify the output

💻

Writing code and entering commands is only available on desktop. Open this page on a larger screen to complete this chapter.

The assistant can now index a folder of text files. Run it against the pre-loaded docs folder to see the indexer in action.

The docs folder contains three files: api-reference.md, python-course-notes.md, and readme.md. When you run the command below, the assistant walks the folder, reads each file, splits the content into chunks, embeds them, and saves the result to a cache file.

You should see output like this:

Indexing docs/...
Indexed 8 chunks from 3 files.
Cache saved to docs.cache.json

After this run, docs.cache.json contains the embeddings for all three files. The next time you run the same command, the assistant loads from cache instead of re-embedding.

Instructions

Run python3 app.py ./docs to index the folder and verify the output.