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

Method vault_embed_all

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

Embed all vault entries.

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

Source from the content-addressed store, hash-verified

130
131 /// Embed all vault entries.
132 pub fn vault_embed_all<F>(
133 &self,
134 embed_fn: &F,
135 config: &EmbedConfig,
136 ) -> Result<usize, RepositoryError>
137 where
138 F: Fn(&str) -> Vec<f32>,
139 {
140 let entries = self.vault_list("", None)?;
141 let mut total = 0;
142 for meta in &entries {
143 // Only embed text content types
144 match meta.entry_type {
145 VaultEntryType::Memory
146 | VaultEntryType::Intent
147 | VaultEntryType::Session
148 | VaultEntryType::Skill => match self.vault_embed(&meta.path, embed_fn, config) {
149 Ok(count) => total += count,
150 Err(e) => log::warn!("Failed to embed {}: {}", meta.path, e),
151 },
152 _ => {}
153 }
154 }
155 Ok(total)
156 }
157
158 /// Search vault embeddings for similar content.
159 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