classifiers.migrate_embeddings_redisearch module
Copy monolithic tool/skill embedding hashes into per-key RediSearch HASH docs.
Run after ensure_indexes has created idx:tool_embeddings and
idx:skill_embeddings. Safe to re-run (overwrites tool_emb:* /
skill_emb:* keys from legacy hash data).
Usage:
python -m classifiers.migrate_embeddings_redisearch
- classifiers.migrate_embeddings_redisearch.main()[source]
CLI entrypoint that resolves the Redis URL and drives the migration.
Parses
--redis-urlfromargv, loads configuration viaConfig.load(), and resolves the effective Redis URL with the precedence--redis-url>cfg.redis_url>$REDIS_URL>redis://localhost:6379/0. It derives connection keyword arguments throughConfig.redis_connection_kwargs_for_url()and then runs the async_run()coroutine viaasyncio.run()to perform the actual hash migration.Side effects: triggers the Redis writes performed by
_run()and logs an error (with traceback) if the migration raises. Any exception is caught here and converted into a non-zero return code rather than propagating.Invoked from the module’s
__main__guard viaraise SystemExit(main()). No other internal callers were found.- Return type:
- Returns:
0on a successful migration,1if_run()raised.