Skip to content

ReVoice Service

ReVoice is an operation where a source memory collection is re-written in the “voice” of another agent. This is useful to maintain an agent’s underlying persona and alignment when binding with information from another foreign memory collection.

TODO: mention the importance of setting the relevance_context when re-voicing a memory collection.

DUMP Agent E Memories

MEMORY_COLLECTION=memory_collection.76b3c7d641c247abaf6259ff83a043ec
curl -s -X 'GET' \
  "http://localhost:5000/api/v1/collections/${MEMORY_COLLECTION}/export" \
  -H 'accept: application/json' | \
  jq -r '[.memories[] | {"Memory Text": .memory_txt, "Vector Text": .vector_txt}]' > tmp/${MEMORY_COLLECTION}.json

Critic: participant.7aab262ca9c24c15bc29b281f6c01c83 Eleanor: participant.4359c658f5904a95b7f1921ac53b4ab6

ITOE2: memory_collection.373fe6db4fef493ca65c7be60f20786f Einstein: memory_collection.55b8be12144144b582dc7b91b7d3a46a

OPAR2: memory_collection.610cbf240aff40e9afc83d539963bb14

Testing

Triggering a revoice process:

Eleanor laws of power

AGENT=participant.4359c658f5904a95b7f1921ac53b4ab6
MEMORY_COLLECTION=memory_collection.76b3c7d641c247abaf6259ff83a043ec
curl -s -X 'PATCH' \
  "http://warmachine:5050/api/v1/agents/${AGENT}/${MEMORY_COLLECTION}" \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "memory_txt_context": "An online chat with a human that may or may not be deceiving, manipulating, or influencing me in a negative way.",
  "vector_txt_context": "Eleanor is planning how to effectively apply power dynamics to her advantage, identify friends and foes, detect deception, and influence others to achieve her goals in chat conversations with users.",  "agent_memory_settings": {
    "enabled": true,
    "top_k_vectors": 10,
    "relevance_alpha": 1,
    "importance_alpha": 1,
    "recency_alpha": 1,
    "min_score": 0.6,
    "max_memories": 3,
    "max_memory_strategy": "HARD_LIMIT"
  },
  "source_memory_settings": {
    "enabled": true,
    "top_k_vectors": 10,
    "relevance_alpha": 1,
    "importance_alpha": 1,
    "recency_alpha": 1,
    "min_score": 0.4,
    "max_memories": 5,
    "max_memory_strategy": "HARD_LIMIT"
    }
  }' | \
  jq -r

Hard delete a memory collection:

MEMORY_COLLECTION=memory_collection.251fc4695f9d497d893fde81eabd0b20
curl -s -X 'DELETE' \
  "http://localhost:5000/api/v1/collections/${MEMORY_COLLECTION}/hard?dry_run=false&delete_vectors=true" \
  -H 'accept: application/json' | \
  jq -r

Dump all memories from a memory collection to a JSON file:

MEMORY_COLLECTION=memory_collection.4c5a116bb8a14745bf80d3845433121a
curl -s -X 'GET' \
  "http://localhost:5000/api/v1/collections/${MEMORY_COLLECTION}/export" \
  -H 'accept: application/json' | \
  jq -r '[.memories[] | {"Memory Text": .memory_txt, "Vector Text": .vector_txt}]' > tmp/${MEMORY_COLLECTION}.json

This file can be easily browsed by the JSON grid viewer DutchIgor.json-viewer in VSCode. Simply right click on the JSON file and select “Open With…” and then choose “JSON Grid”.

List memory collections bound to an agent:

AGENT=participant.4359c658f5904a95b7f1921ac53b4ab6
curl -s -X 'GET' \
  "http://localhost:5000/api/v1/agents/${AGENT}/collections" \
  -H 'accept: application/json' | \
  jq -r

Rebuild memory collections:

eleanor memory