Skip to main content

The framework for agent memory

Project description

simplememory

This will be the memory of the agents and agency

To use this package:

Ensure that a .env exists with below parameters.

OPENAI_API_KEY=sk-"ADD YOUR API KEY HERE"
PINECONE_API_KEY = "ADD YOUR API KEY HERE"
PINECONE_INDEX="ADD YOUR INDEX NAME HERE"

If using entity memory, below parameters are needed

OPENAI_API_KEY = "ADD YOUR API KEY HERE"
NEO4J_URI = "ADD YOUR NEO4J URI HERE"
NEO4J_USERNAME = "ADD YOUR NEO4J USERNAME HERE"
NEO4J_PASSWORD = "ADD YOUR NEO4J PASSWORD"

How to add to semantic memory:

from memory.semantic_memory import SemanticMemory
if __name__=="__main__":
    sc= SemanticMemory()
    semantic_val,memory_item = sc.add_memory_item(mem_key="What is the capital of india?",mem_val="The capital of India is New Delhi"
    print(semantic_val)
    print(memory_item)

How to retrieve semantic memory:

from memory.semantic_memory import SemanticMemory
if __name__=="__main__":
    sc= SemanticMemory()
    result = sc.retrieve_memory_item(mem_key="what is the capital of India?")
    print(result['matches'][0]['metadata']['key'])
    print(result['matches'][0]['metadata']['value'])
    print(result['matches'][0]['score'])

How to add entity memory:

from memory.entity_memory import EntityMemory

if __name__=="__main__":
    sc= EntityMemory()
    sc.add_memory_item(mem_key="What is the capital of India?",mem_val="The capital of India is New Delhi")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simplememory-0.0.2.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

simplememory-0.0.2-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file simplememory-0.0.2.tar.gz.

File metadata

  • Download URL: simplememory-0.0.2.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.7

File hashes

Hashes for simplememory-0.0.2.tar.gz
Algorithm Hash digest
SHA256 91220583321d87c6a3a9cda16b8272f88fab36ab2347fe8710aa6adcd06bd7d4
MD5 701c35d1d6ab4c468829881acbe43bdf
BLAKE2b-256 cc81b214ad32f1b9d511c5b36c03dfd32029994548ac8607782dfcff6f6c66ad

See more details on using hashes here.

File details

Details for the file simplememory-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: simplememory-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.7

File hashes

Hashes for simplememory-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b1598d74a776f4f1e993fc9fc3af1e4622c036edabcde36ec57e702cc7cde5ae
MD5 278dc65a656c347c46b003d19fb89244
BLAKE2b-256 22766c894da712f081f253f6d8d5d8e07852364a2abeb17bf606084de49b8d76

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page