async def test_aput_with_duplicate_facts(mock_extraction_llm, sample_messages):
    """Test aput method with duplicate facts."""
    memory_block = FactExtractionMemoryBlock(llm=mock_extraction_llm)
    memory_block.facts = ["John lives in New York"]

    await memory_block.aput(sample_messages)

    # Verify only new facts were added (no duplicates)
    assert len(memory_block.facts) == 2
    assert memory_block.facts == [
        "John lives in New York",
        "John is a software engineer",
    ]
Test aput method with duplicate facts.
llama-index-core/tests/memory/blocks/test_fact.py