Works with the AI Agents you already use

    ChromaDB Doctor: Fix Lost Vectors & Embedding Errors

    by Abhineet Sharma

    1

    Finds why your Chroma-backed RAG app loses data, throws dimension errors, or returns duplicate or empty results, then fixes it and proves it with a query.

    Free

    Security scanned

    What it does

    • Scans your code to find where data might be getting lost during updates
    • Checks your database files for mismatched data sizes and search settings
    • Identifies duplicate text chunks that make your AI results messy and repetitive
    • Provides specific setup steps for cloud platforms like Railway, Render, and Fly
    • Suggests the exact code needed to fix outdated database versions or imports
    • Verifies every fix with a test search to ensure your data is actually there

    Who it's for

    Developers building AI apps

    Fix vector database errors that cause missing data or wrong search results.

    Try asking: “Fix the dimension mismatch error in my ChromaDB collection.”

    Founders with a launched AI product

    Ensure your chatbot doesn't lose its memory after you redeploy your code.

    Try asking: “Why does my AI forget all its data every time I push an update to Railway?”

    Data engineers managing RAG systems

    Clean up duplicate documents and fix slow queries in your vector store.

    Try asking: “My vector database is growing too fast and returning the same result multiple times.”

    ChromaDB Doctor: Fix Lost Vectors & Embedding Errors

    ChromaDB Doctor: Fix Lost Vectors & Embedding Errors

    Example session with this skill installed

    My FastAPI RAG bot on Railway forgets everything after each deploy, and when it does have data the top 5 results are the same paragraph. Repo is in ./bot, DB folder is ./bot/chroma_db.

    • Read your context and instructions
    • Compiled the chromadb doctor

    Ran: python scripts/chroma_doctor.py --repo ./bot --db ./bot/chroma_db

    Collections
    name count dim space embedding fn dupes
    kb 3120 1536 l2 openai 2340

    [HIGH] DB_ON_CONTAINER_DISK ingest.py:3, Procfile
    Path "./chroma_db" is hardcoded and the app deploys to a container platform. The filesystem is wiped on every redeploy.
    [HIGH] RANDOM_IDS_ADD ingest.py:41
    uuid4 IDs + add(): every ingest run duplicates the corpus.
    [HIGH] DUPLICATE_DOCUMENTS kb: 2340 of 3120 records (75%) are exact duplicates.
    [MEDIUM] L2_COLLECTION kb uses L2 distance.

    Cause: Ingestion runs on every boot (main.py startup hook) with random IDs, onto a disk Railway wipes on deploy.
    Fixed: Mounted Railway volume at /data, CHROMA_PATH=/data/chroma; IDs now sha1(source|chunk|text) with upsert(); ingestion moved out of startup; deduped kb (3120 -> 780).
    Verified: Known-answer query "refund window" returns the refunds policy chunk at #1 (distance 0.21). count()=780 before and after a redeploy.
    Still open: Collection is still L2. Migration to cosine is in references/fixes.md if you want it.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Your RAG chatbot worked yesterday. Today it returns nothing, returns the same chunk five times, or throws "Collection expecting embedding with dimension of 1536, got 384". This skill finds the real cause instead of guessing.

    It ships a read-only checker that does two things:

    Scans your code for the mistakes behind most Chroma bugs:

    • Data that doesn't survive. In-memory chromadb.Client(), relative paths that change with the working directory, and hardcoded paths on container disks (Railway, Render, Fly, Docker) that get wiped on every redeploy.
    • Embedding mismatches. Collections opened without the embedding function they were built with, and the silent fallback to Chroma's default 384-dim model (which also downloads ~80 MB at runtime and breaks offline containers).
    • Duplicate floods. Random uuid4 IDs plus add(), or Chroma.from_documents() on every startup, re-ingesting the whole corpus each run.
    • Wrong metric. Collections stuck on L2 when your embeddings want cosine (fixed at creation, so it tells you how to migrate).
    • Multi-worker setups where 4 gunicorn workers each hold their own PersistentClient on one folder.
    • LangChain breakage. Deprecated imports, removed .persist(), and the default "langchain" collection name that makes retrievers return [] with no error.
    • SQLite < 3.35, a missing pysqlite3 swap, and unpinned chromadb versions that migrate your data on the next build.

    Inspects your persisted database without importing chromadb or writing anything: every collection's count, vector dimension, distance metric, recorded embedding function, and exact-duplicate texts. It catches things code review can't, like a 1536-dim collection registered with the 384-dim default model.

    It includes an error-signature reference (real Chroma 1.x error strings mapped to causes) and tested fix recipes: volume setup per platform, deterministic IDs with upsert, a dedupe script, a no-re-embed migration to cosine, and a Chroma server setup for multi-worker apps. Every fix ends with a known-answer query, a count check, and a restart test, so you get proof, not a suggestion.

    Local/persistent Chroma only: it can't inspect Chroma Cloud or a remote Chroma server's data (code scanning still works). Static code checks are heuristics and can miss unusual setups. Doesn't fix retrieval quality problems caused by chunking or prompts, and doesn't migrate you to another vector database.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 7 days ago

    • Free with an Agensi account

    Software
    Python 3.9+
    Optional
    chromadb (to apply and verify fixes)

    Permissions

    Terminal / Shell
    Read Files
    Write Files

    File Scopes

    The
    project
    repo
    being
    diagnosed
    (read-only
    scan)
    Chroma
    persist
    folder
    (opened
    read-only
    by
    the
    checker)

    The checker script is stdlib-only, never imports chromadb, opens chroma.sqlite3 in read-only mode, writes nothing and makes no network calls. The agent edits code or data only when applying a fix the user agreed to, and backs up the persist folder before any destructive step.

    Listed7 days ago

    What's inside

    Frequently Asked Questions

    Not during diagnosis. The checker opens chroma.sqlite3 read-only and never imports chromadb, so no schema migration can run. Fixes that touch data (dedupe, metric migration) are only run after you agree, and after a backup of the persist folder.

    Yes. It checks langchain / langchain_community / langchain_chroma usage, including the default 'langchain' collection name, removed .persist() calls and from_documents re-ingestion.

    The database inspector reads the on-disk format from 0.4 through 1.x and tolerates schema differences. It was tested against Chroma 1.5. Pre-0.4 DuckDB databases are detected and pointed at chroma-migrate.

    If you can run the checker inside the service (railway ssh / run) or copy the persist folder down, yes. Otherwise it scans your code and tells you whether the data could survive a deploy at all.

    New in LLM Ops

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for LLM Ops.

    Free