Skip to main content
Repo Storage is in Early Beta
This feature is actively being developed and refined. While stable for testing and development, expect improvements and potential changes as we optimize performance and capabilities.
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: "{user.morphApiKey}" });

// 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',
  metadata: { issueId: 'PROJ-123', source: 'agent' }
});

// Push with indexing enabled for semantic search
await morph.git.push({ dir: './my-project', branch: 'main', index: true });

// Search immediately
const results = await morph.codebaseSearch.search({
  query: 'authentication logic'
});
Set index: true to enable code embedding for semantic search. Each commit is indexed separately, letting you search specific branches or historical commits. See Semantic Search for search usage.
By default, push does not generate embeddings. Set index: true to enable:
// Push with indexing (enables semantic search)
await morph.git.push({ 
  dir: './my-project', 
  branch: 'main',
  index: true
});

// Push without indexing (default)
await morph.git.push({ 
  dir: './my-project', 
  branch: 'main',
  index: false  // Skip embedding generation
});
When to index:
  • Production commits you want to search
  • Feature branches ready for review
  • Any code you want semantically searchable
When to skip indexing:
  • Work-in-progress commits
  • Binary file updates
  • High-frequency automated commits
Commits pushed without index: true cannot be searched. You’ll receive an error if you try to search an unindexed commit.

Waiting for Embeddings

Indexing happens in the background. For testing or when you need immediate search results:
// Push with indexing
await morph.git.push({ dir: './project', branch: 'main', index: true });

// Wait for completion
await morph.git.waitForEmbeddings({
  repoId: 'my-project',
  timeout: 120000,
  onProgress: (p) => console.log(`${p.filesProcessed}/${p.totalFiles} files`)
});

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

Blocking Push

For testing/CI, you can make push wait until embeddings complete:
await morph.git.push({ 
  dir: './my-project', 
  branch: 'main',
  index: true,
  waitForEmbeddings: true
});

How It Works

Indexing — When you push with index: true:
1

Smart Chunking

Tree-sitter parses your code into semantic units (functions, classes) instead of arbitrary splits.
2

Code Embedding

Each chunk is converted to vectors using morph-v4-embed, optimized for code understanding.
3

Ready to Search

Indexed and searchable in 3-100 seconds. Content-addressable caching means identical chunks share embeddings across repos.
Searching — Two-stage retrieval for speed and precision:
  1. Fast Retrieval — Find 50 candidates by embedding similarity (~130ms)
  2. Precision Reranking — Score each candidate with morph-v4-rerank (~700ms)
Two-stage retrieval: fast embedding similarity finds candidates, then cross-attention reranking scores each one precisely.
Content-addressable caching. Identical code chunks share embeddings across repos and commits. Most pushes only embed changed code.
Tree-sitter parsing extracts semantic chunks (functions, classes) instead of arbitrary splits.

Commit Metadata

Store arbitrary metadata with your commits:
await morph.git.commit({
  dir: './my-project',
  message: 'Fix authentication bug',
  metadata: {
    issueId: 'PROJ-456',
    source: 'ai-agent',
    model: 'claude-3.5-sonnet'
  }
});

// Retrieve later
const notes = await morph.git.getCommitMetadata({
  dir: './my-project',
  commitSha: 'abc123...'
});

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.

Next Steps