`save_to_memory` routes by file extension: files with `.py`, `.js`, `.ts`, `.css`, `.html`, or `.md` are processed via tree-sitter entity extraction (the `extract_entities` flow in `code_indexer.py`). Other extensions fall through to DeepSeek/Ollama LLM summarization. For the tree-sitter path, tree-sitter parses the source and extracts one `CodeEntity` per function/method/class -- each holding signature, docstring/JSDoc, and metadata. These entities are upserted into ChromaDB with deterministic md5 IDs (so re-scans overwrite duplicates), and token usage is logged to the SQLite tracker (`zerikai.db`). Sources: main.py:1072, README.md:279, code_indexer.py:169, code_indexer.py:204, code_indexer.py:30