Skip to main content
Git built for AI code. State of the art code chunking, embeddings, and reranking - in 1 import.

Early Beta & Technology

Repo Storage is completely free during our early beta.
Your code is indexed and made searchable using our latest, state-of-the-art embedding and re-rank models with a simple import:
  • morph-v4-embedding for code understanding
  • morph-v4-rerank for top-tier code search quality
No setup or configuration is needed. Enjoy the best results with Morph’s new semantic search stack—at no cost, while in beta.

Quick Start

Use git like normal. We handle the vector database, embeddings, and infrastructure automatically.
import { MorphClient } from '@morphllm/morphsdk';

const morph = new MorphClient({ apiKey: process.env.MORPH_API_KEY });

// Initialize repo
await morph.git.init({
  repoId: 'my-project',
  dir: './my-project'
});

// Make changes, then commit
await morph.git.add({ dir: './my-project', filepath: '.' });
await morph.git.commit({
  dir: './my-project',
  message: 'Add feature',
});

// Push (triggers code embedding in background)
await morph.git.push({ dir: './my-project', branch: 'main' });

// Wait for embeddings (testing/CI)
await morph.git.waitForEmbeddings({ repoId: 'my-project' });

// Search immediately
const results = await morph.codebaseSearch.search({
  query: 'authentication logic'
});
Push automatically triggers code embedding for semantic search—no vector DB setup, no infrastructure management. Use waitForEmbeddings() to know when processing is complete (3-100s depending on repo size).Each commit is indexed separately, letting you search specific branches or historical commits. See Semantic Search for search usage.

Waiting for Embeddings

Push triggers embeddings in the background (fire-and-forget by default). For testing or when you need immediate search results, use waitForEmbeddings():
// Push code
await morph.git.push({ dir: './project', branch: 'main' });

// Wait with progress updates
await morph.git.waitForEmbeddings({
  repoId: 'my-project',
  timeout: 120000,  // 2 minutes max (default)
  onProgress: (progress) => {
    console.log(`${progress.filesProcessed}/${progress.totalFiles} files processed`);
    console.log(`${progress.chunksStored} chunks stored`);
  }
});

// Now search works immediately
const results = await morph.codebaseSearch.search({
  query: 'authentication logic',
  repoId: 'my-project'
});

Blocking Push (Convenience)

For testing/CI, you can make push wait until embeddings complete:
// Blocks until embeddings done (3-100s depending on repo size)
await morph.git.push({ 
  dir: './my-project', 
  branch: 'main',
  waitForEmbeddings: true  // Convenience flag
});

// Search works immediately
const results = await morph.codebaseSearch.search({ query: '...' });

When to Wait

Always wait:
  • CI/testing - ensure search works in tests
  • Demos - immediate results
  • Small repos - 3-8s wait is acceptable
Usually don’t wait:
  • Development - embeddings ready on next run
  • Production agents - search on next execution
  • Large repos - 100s+ wait hurts UX

How It Works

┌──────────────────────────────────────────────────────────────┐
│                    YOUR CODE → SEARCHABLE                    │
└──────────────────────────────────────────────────────────────┘

  morph.git.push()


  ┌─────────────────────────────────────────────────────────┐
  │  1. SMART CHUNKING                                      │
  │     Parse code into semantic units (functions, classes) │
  │     Not arbitrary line splits—real code structure       │
  └─────────────────────────────────────────────────────────┘


  ┌─────────────────────────────────────────────────────────┐
  │  2. CODE EMBEDDING                                      │
  │     Convert chunks to vectors with morph-v4-embed       │
  │     Understands code semantics, not just keywords       │
  └─────────────────────────────────────────────────────────┘


  ┌─────────────────────────────────────────────────────────┐
  │  3. READY TO SEARCH                                     │
  │     Indexed and searchable in 3-100s                    │
  └─────────────────────────────────────────────────────────┘


                         SEARCH FLOW

  morph.codebaseSearch.search({ query: "auth logic" })


  ┌─────────────────────────────────────────────────────────┐
  │  STAGE 1: Fast Retrieval                                │
  │  Find 50 candidates by embedding similarity (~130ms)     │
  └─────────────────────────────────────────────────────────┘


  ┌─────────────────────────────────────────────────────────┐
  │  STAGE 2: Precision Reranking                           │
  │  Score candidates with morph-v4-rerank (~700ms)         │
  │  Return top 10 most relevant results                    │
  └─────────────────────────────────────────────────────────┘


  Results ranked by relevance to your query
Two-stage retrieval: fast embedding similarity finds candidates, then cross-attention reranking scores each one precisely. This beats single-stage approaches.
Content-addressable caching. Identical code chunks share embeddings across repos and commits. Most pushes only embed changed code—unchanged functions are instant.
Tree-sitter parsing extracts semantic chunks (functions, classes) instead of arbitrary splits. Large files don’t create oversized chunks that hurt search quality.
Each commit is indexed separately, so you can search historical versions of your code. Perfect for debugging or comparing implementations across time. Specify commitHash in search to query specific versions.

Why Use Repo Storage?

Zero infrastructure – No vector databases, no embedding pipelines, no DevOps. AI-first design – Store agent conversations and browser recordings alongside code changes. Production-ready – State-of-the-art chunking, embeddings, and reranking built in. Git-native – Works with your existing Git workflow. No new tools to learn. Progress visibility – Know when embeddings are done with polling (Stripe-style async jobs).

Next Steps