Semantic Memory

Understanding Semantic Memory

Semantic memory is one of the types of memory an agent has, corresponding to non-salient, fact based memory. This can be any sort of information-based knowledge, such as PDFs, documents, news articles, or just plain text.

Using Semantic Memory

You can add any kind of information, whether plain text, local file path, or remote URL, using the SemanticMemory.ingest method.

1

Initialize Memory

python
from swiftagent.memory import SemanticMemory

memory = SemanticMemory()
2

Add Semantic Memory

python
agent.add_semantic_memory_section(memory)
3

Add information

python
memory.ingest("Sample text")

memory.ingest("https://arxiv.org/pdf/2304.04370"

Last updated