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: 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' ,
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.
Enabling Semantic Search
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
┌──────────────────────────────────────────────────────────────┐
│ YOUR CODE → SEARCHABLE │
└──────────────────────────────────────────────────────────────┘
morph.git.push({ index: true })
│
▼
┌─────────────────────────────────────────────────────────────┐
│ 1. SMART CHUNKING │
│ Parse code into semantic units (functions, classes) │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ 2. CODE EMBEDDING │
│ Convert chunks to vectors with morph-v4-embed │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ 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) │
└─────────────────────────────────────────────────────────────┘
│
▼
Results ranked by relevance to your query
Why is search so accurate?
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.
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