MCPcopy Create free account
hub / github.com/InternScience/InternAgent / run_tests

Function run_tests

tasks/AutoMem/code/memory_layer.py:899–938  ·  view source on GitHub ↗

Run system tests

()

Source from the content-addressed store, hash-verified

897 return memory_str
898
899def run_tests():
900 """Run system tests"""
901 print("Starting Memory System Tests...")
902
903 # Initialize memory system with OpenAI backend
904 memory_system = AgenticMemorySystem(
905 model_name='all-MiniLM-L6-v2',
906 llm_backend='openai',
907 llm_model='gpt-4o-mini'
908 )
909
910 print("\nAdding test memories...")
911
912 # Add test memories - only content is required
913 memory_ids = []
914 memory_ids.append(memory_system.add_note(
915 "Neural networks are composed of layers of neurons that process information."
916 ))
917
918 memory_ids.append(memory_system.add_note(
919 "Data preprocessing involves cleaning and transforming raw data for model training."
920 ))
921
922 print("\nQuerying for related memories...")
923 query = MemoryNote(
924 content="How do neural networks process data?",
925 llm_controller=memory_system.llm_controller
926 )
927
928 related = memory_system.find_related_memories(query.content, k=2)
929 print("related", related)
930 print("\nResults:")
931 for i, memory in enumerate(related, 1):
932 print(f"\n{i}. Memory:")
933 print(f"Content: {memory.content}")
934 print(f"Category: {memory.category}")
935 print(f"Keywords: {memory.keywords}")
936 print(f"Tags: {memory.tags}")
937 print(f"Context: {memory.context}")
938 print("-" * 50)
939
940if __name__ == "__main__":
941 run_tests()

Callers 1

memory_layer.pyFile · 0.70

Calls 4

add_noteMethod · 0.95
find_related_memoriesMethod · 0.95
AgenticMemorySystemClass · 0.70
MemoryNoteClass · 0.70

Tested by

no test coverage detected