Ingestion Pipeline
Understand how Rephole processes your codebase from repository to searchable vectors.
Pipeline Overviewβ
Repository β Clone β Parse β Chunk β Embed β Store β Index
When you submit a repository for ingestion, Rephole automatically:
- Clones your repository to local storage
- Parses code files using AST (Abstract Syntax Tree) analysis
- Chunks code intelligently at function/class level
- Generates embeddings using OpenAI's
text-embedding-3-smallmodel - Stores vectors in ChromaDB and metadata in PostgreSQL
- Indexes for fast retrieval
Supported Languagesβ
Rephole supports 20+ programming languages through Tree-sitter parsing:
| Category | Languages |
|---|---|
| Web | JavaScript, TypeScript, HTML, CSS |
| Backend | Python, Java, Go, Rust, C#, Ruby, PHP |
| Systems | C, C++, Rust |
| Data | SQL, JSON, YAML |
| Mobile | Swift, Kotlin |
| Other | Bash, Markdown |
Chunking Strategyβ
Rephole uses intelligent code chunking rather than simple text splitting:
Function-Level Chunkingβ
// Each function becomes a separate chunk
function authenticate(user, password) { // β Chunk 1
// ...
}
function validateToken(token) { // β Chunk 2
// ...
}
Class-Level Chunkingβ
// Classes are chunked with their methods
class UserService { // β Single chunk with context
constructor() { }
findOne(id) { }
create(data) { }
}
Parent-Child Retrievalβ
Rephole implements a parent-child retrieval strategy:
- Child Chunks: Small, precise code segments for accurate matching
- Parent Documents: Full file content for complete context
When you search:
- The query matches against child chunks for precision
- Results return the parent document for full context
This ensures you get both accurate matches AND understand the surrounding code.
Embedding Modelβ
Rephole uses OpenAI's text-embedding-3-small model:
| Property | Value |
|---|---|
| Dimensions | 1536 |
| Max Tokens | 8191 |
| Cost | $0.00002 / 1K tokens |
Processing Flowβ
βββββββββββββββ βββββββββββββββ βββββββββββββββ
β Client ββββββΆβ API Server ββββββΆβ Redis Queue β
βββββββββββββββ βββββββββββββββ ββββββββ¬βββββββ
β
βββββββββββββββ ββββββββΌβββββββ
β ChromaDB βββββββ Worker β
βββββββββββββββ ββββββββ¬βββββββ
β
βββββββββββββββ ββββββββΌβββββββ
β PostgreSQL βββββββ
βββββββββββββββ
Next Stepsβ
- Learn about the Query Flow to understand how searches work
- See the Architecture Overview for system design