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

Function store_memory

atomic-cli/src/commands/memory/list.rs:565–588  ·  view source on GitHub ↗

Store a memory via the GENERIC vault path (as `memory write`/attest do).

(repo: &Repository, id: &str, kind: &str, about: &[&str], body: &str)

Source from the content-addressed store, hash-verified

563
564 /// Store a memory via the GENERIC vault path (as `memory write`/attest do).
565 fn store_memory(repo: &Repository, id: &str, kind: &str, about: &[&str], body: &str) {
566 let mut spine = Map::new();
567 spine.insert("uid".into(), Value::String(id.to_string()));
568 spine.insert("memoryKind".into(), Value::String(kind.to_string()));
569 spine.insert("status".into(), Value::String("active".into()));
570 spine.insert(
571 "createdAt".into(),
572 Value::String("2026-07-01T00:00:00+00:00".into()),
573 );
574 if !about.is_empty() {
575 spine.insert(
576 "about".into(),
577 Value::Array(about.iter().map(|a| Value::String(a.to_string())).collect()),
578 );
579 }
580 let path = bridge::normalize_memory_path(id);
581 repo.vault_store(
582 &path,
583 VaultEntryType::Memory,
584 body.as_bytes().to_vec(),
585 serde_json::to_string(&spine).unwrap(),
586 )
587 .unwrap();
588 }
589
590 /// Lift+attest a stored memory with the given keypair.
591 fn attest_with(repo: &Repository, id: &str, kp: &KeyPair) -> MemoryNode {

Calls 8

normalize_memory_pathFunction · 0.85
vault_storeMethod · 0.80
insertMethod · 0.45
is_emptyMethod · 0.45
collectMethod · 0.45
iterMethod · 0.45
unwrapMethod · 0.45
as_bytesMethod · 0.45