Medox reindex-gold
Rebuild ChromaDB Gold layer indexes after source data changes. Invoke manually — deletes and recreates collections, do NOT trigger automatically.
install
source · Clone the upstream repo
git clone https://github.com/spideystreet/medox
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/spideystreet/medox "$T" && mkdir -p ~/.claude/skills && cp -r "$T/.claude/skills/reindex-gold" ~/.claude/skills/spideystreet-medox-reindex-gold && rm -rf "$T"
manifest:
.claude/skills/reindex-gold/SKILL.mdsource content
Skill: Rebuild the ChromaDB Gold Index
Use when: BDPM/ANSM source data has changed, Silver models were updated, or ChromaDB collections are missing/stale.
Steps
-
Ensure Docker stack is running:
docker compose up -d docker ps # verify chromadb and postgres containers are healthy -
Ensure Silver is up to date (run if source data changed):
uv run dotenv -f dbt/.env run -- uv run dbt run --project-dir dbt --profiles-dir dbt uv run dotenv -f dbt/.env run -- uv run dbt test --project-dir dbt --profiles-dir dbt -
Materialize the Gold asset:
uv run dotenv -f .env run -- uv run dagster asset materialize --select gold_embeddings -
Verify collections via chromadb-inspector agent or directly:
uv run dotenv -f .env run -- python -c " import chromadb, os c = chromadb.HttpClient(host=os.environ['CHROMA_HOST'], port=int(os.environ['CHROMA_PORT'])) for name in ['idx_bdpm_medicament_v1', 'idx_ansm_interaction_v1']: print(name, c.get_collection(name).count()) " -
Smoke-test the agent tools:
uv run dotenv -f .env run -- python -c " from medox.agent.tools.tool_search_drug import search_drug from medox.agent.tools.tool_check_interactions import check_interactions print(search_drug.invoke({'query': 'doliprane'})) print(check_interactions.invoke({'substance_a': 'warfarine', 'substance_b': 'ibuprofene'})) "
Collection naming
| Collection | Content | Rebuilt from |
|---|---|---|
| Drug denominations + metadata | |
| ANSM interaction pairs | |
Rules
- Always run dbt tests before reindexing — bad Silver data produces bad embeddings
- Full reindex deletes and recreates the collection — expect a few minutes
- If
fails: checkgold_embeddings
/CHROMA_HOST
inCHROMA_PORT
and Docker status.env