MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / vault_embed_all

Method vault_embed_all

atomic-repository/src/repository/vault_embeddings.rs:146–170  ·  view source on GitHub ↗

Embed all vault entries.

(
        &self,
        embed_fn: &F,
        config: &EmbedConfig,
    )

Source from the content-addressed store, hash-verified

144
145 /// Embed all vault entries.
146 pub fn vault_embed_all<F>(
147 &self,
148 embed_fn: &F,
149 config: &EmbedConfig,
150 ) -> Result<usize, RepositoryError>
151 where
152 F: Fn(&str) -> Vec<f32>,
153 {
154 let entries = self.vault_list("", None)?;
155 let mut total = 0;
156 for meta in &entries {
157 // Only embed text content types
158 match meta.entry_type {
159 VaultEntryType::Memory
160 | VaultEntryType::Intent
161 | VaultEntryType::Session
162 | VaultEntryType::Skill => match self.vault_embed(&meta.path, embed_fn, config) {
163 Ok(count) => total += count,
164 Err(e) => log::warn!("Failed to embed {}: {}", meta.path, e),
165 },
166 _ => {}
167 }
168 }
169 Ok(total)
170 }
171
172 /// Search vault embeddings for similar content.
173 pub fn vault_search(

Callers 2

runMethod · 0.80
test_vault_embed_allFunction · 0.80

Calls 2

vault_listMethod · 0.80
vault_embedMethod · 0.80

Tested by 1

test_vault_embed_allFunction · 0.64