async def test_vector_memory_block_get(vector_memory_block):
    """Test getting messages from the vector memory block."""
    # Create and store some messages
    history_messages = [
        ChatMessage(role="user", content="What's the capital of France?"),
        ChatMessage(role="assistant", content="The capital of France is Paris."),
        ChatMessage(role="user", content="What about Germany?"),
        ChatMessage(role="assistant", content="The capital of Germany is Berlin."),
    ]

    await vector_memory_block.aput(messages=history_messages)

    # Create a new query
    query_messages = [ChatMessage(role="user", content="Tell me about Paris.")]

    # Get relevant information
    result = await vector_memory_block.aget(messages=query_messages)

    # Check that we got a result
    assert result != ""
    assert "capital of France is Paris" in result
Test getting messages from the vector memory block.
llama-index-core/tests/memory/blocks/test_vector.py