Skip to main content

A simple AI local memory logic implementation

Project description

简介

相比于那些更繁杂的ai本地化记忆agent,ezmem提供了一个超轻量级,无需额外挂载数据库的简单记忆逻辑

使用 pip 安装

pip install ezmem

功能示例

Example 1 Example 2

简易上手

from ezmem import EasyMemory #导入包



config = OpenAI(

    api_key="填入您自己的api",

    base_url="填入您自己的url",

)#api_key 以及 base_url配置



m = EasyMemory(config) #创建memory实例



m.add(text,user_id)#将记忆信息记录进user_id中



memory = m.query(user_id)#根据user_id查询记忆内容



answer = m.chat(text,rule)#text:用户聊天信息,rule:ai遵循规则



m.delete_all(user_id)#删除user_id的所有记忆信息

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

easymemoryai-0.1.0.tar.gz (6.5 kB view details)

Uploaded Source

File details

Details for the file easymemoryai-0.1.0.tar.gz.

File metadata

  • Download URL: easymemoryai-0.1.0.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.8

File hashes

Hashes for easymemoryai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8bd1af3971348581c678bd54d900f020be9905611568d6b1e08436b63cb601f4
MD5 7f59c03e17e5712736d10db875902676
BLAKE2b-256 b490273d1ccd4f70ede70aa6864a83b1a6f868ce68b9368e24f8fbf2aedc6886

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