agentleFS
marcusschiessermarcusschiesser/vectorstores/CLAUDE.md

vectorstores

CLAUDE.md18 starsChanged 2 years agoMITView on GitHub

This is a pnpm monorepo using Turborepo. Key packages: Set embeddings via Settings.embedFunc or pass embedFunc to constructors: Supported modes in VectorStoreQueryMode: default, sparse, hybrid, bm25, mmr, semantic_hybrid New packages go in packages/providers/. Use existing package.json and tsconfig.json as templates. Reference new packages in root tsconfig.json. Before PRs, create a changeset:

  • Installs packages

The file

We split this CLAUDE.md into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before PRs, create a changeset:

    line 101

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Build & Development Commands

# Install dependencies (pnpm is required)
pnpm install

# Build all packages
pnpm build

# Watch mode for development (all packages)
pnpm dev

# Watch specific package
pnpm turbo run dev --filter="./packages/core" --concurrency=100

# Run all tests (requires build first)
pnpm test

# Type checking
pnpm typecheck

# Linting
pnpm lint

# Format check / fix
pnpm format
pnpm format:write

# Run a script during development
pnpm exec tsx my_script.ts

# Check for circular dependencies
pnpm circular-check

Monorepo Structure

This is a pnpm monorepo using Turborepo. Key packages:

  • packages/core (@vectorstores/core): Core library with abstract classes, interfaces, and runtime-agnostic code. Contains:

    • indices/ - VectorStoreIndex for building and querying vector indices
    • retriever/ - BaseRetriever and retrieval abstractions
    • vector-store/ - BaseVectorStore, query modes (hybrid, BM25, etc.), and filters
    • embeddings/ - Embedding model abstractions and utilities
    • schema/ - Node types (Document, TextNode, ImageNode), metadata handling
    • ingestion/ - Document processing pipeline and deduplication strategies
    • node-parser/ - Text splitting (SentenceSplitter, etc.)
    • global/ - Settings singleton for configuration (embedFunc, chunkSize, nodeParser)
  • packages/env (@vectorstores/env): Environment compatibility layer for Node.js, Deno, Bun, Edge runtimes
  • packages/providers/ - Vector database integrations:

    • storage/: astra, azure, chroma, elastic-search, firestore, milvus, mongodb, pinecone, postgres, qdrant, supabase, upstash, weaviate
    • Other: assemblyai, cohere, discord, excel, notion
  • packages/readers/ - File readers: csv, docx, html, image, json, markdown, obsidian, pdf, text, xml
  • packages/node-parser/ - Specialized parsers: code, html
  • examples/ - Working examples organized by use case

Architecture Patterns

Embedding Configuration

Set embeddings via Settings.embedFunc or pass embedFunc to constructors:

Settings.embedFunc = async (input: string[]) => {
  // Return embeddings array
};

async (input: string[]) => {
  // Return embeddings array
};

Vector Store Query Modes

Supported modes in VectorStoreQueryMode: default, sparse, hybrid, bm25, mmr, semantic_hybrid

Document Processing Flow

  1. Documents are parsed into nodes via NodeParser (configured via Settings.nodeParser or defaults to SentenceSplitter)
  2. Embeddings are computed via embedFunc
  3. Nodes are stored in vector stores with optional deduplication (DocStoreStrategy)
  4. Retrieval queries the vector store and returns NodeWithScore[]

Adding New Providers

New packages go in packages/providers/. Use existing package.json and tsconfig.json as templates. Reference new packages in root tsconfig.json.

Changesets for Version Bumps

Before PRs, create a changeset:

pnpm changeset

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.