reindex-gold

Rebuild ChromaDB Gold layer indexes after source data changes. Invoke manually — deletes and recreates collections, do NOT trigger automatically.

14 stars

Best use case

reindex-gold is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Rebuild ChromaDB Gold layer indexes after source data changes. Invoke manually — deletes and recreates collections, do NOT trigger automatically.

Teams using reindex-gold should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/reindex-gold/SKILL.md --create-dirs "https://raw.githubusercontent.com/spideystreet/medox/main/.claude/skills/reindex-gold/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/reindex-gold/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How reindex-gold Compares

Feature / Agentreindex-goldStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Rebuild ChromaDB Gold layer indexes after source data changes. Invoke manually — deletes and recreates collections, do NOT trigger automatically.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# 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

1. **Ensure Docker stack is running**:
   ```bash
   docker compose up -d
   docker ps    # verify chromadb and postgres containers are healthy
   ```

2. **Ensure Silver is up to date** (run if source data changed):
   ```bash
   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
   ```

3. **Materialize the Gold asset**:
   ```bash
   uv run dotenv -f .env run -- uv run dagster asset materialize --select gold_embeddings
   ```

4. **Verify collections** via chromadb-inspector agent or directly:
   ```bash
   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())
   "
   ```

5. **Smoke-test the agent tools**:
   ```bash
   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 |
|------------|---------|--------------|
| `idx_bdpm_medicament_v1` | Drug denominations + metadata | `silver_bdpm__medicament` |
| `idx_ansm_interaction_v1` | ANSM interaction pairs | `silver_ansm__interaction` |

## 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 `gold_embeddings` fails: check `CHROMA_HOST`/`CHROMA_PORT` in `.env` and Docker status

Related Skills

We are still matching the closest adjacent skills for this page. In the meantime, continue through the full directory.