mirror of
https://github.com/agentscope-ai/ReMe.git
synced 2026-09-07 08:26:06 +00:00
author sync to all files revision
This commit is contained in:
parent
95e776c766
commit
430b4d8180
11 changed files with 120 additions and 2713 deletions
|
|
@ -90,8 +90,13 @@ Reference to cite if you use MemoryScope in a paper:
|
|||
|
||||
```
|
||||
@software{MemoryScope,
|
||||
author = {},
|
||||
month = {08},
|
||||
author = {Li Yu and
|
||||
Tiancheng Qin and
|
||||
Qingxu Fu and
|
||||
Sen Huang and
|
||||
Xianzhe Xu and
|
||||
Zhaoyang Liu},
|
||||
month = {09},
|
||||
title = {{MemoryScope}},
|
||||
url = {https://github.com/modelscope/MemoryScope},
|
||||
year = {2024}
|
||||
|
|
|
|||
26
clear-vector-store.py
Normal file
26
clear-vector-store.py
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
"""
|
||||
Warning!
|
||||
|
||||
This script purges the entire vector store !
|
||||
|
||||
"""
|
||||
|
||||
import sys
|
||||
sys.path.append(".")
|
||||
from memoryscope import MemoryScope, Arguments
|
||||
|
||||
arguments = Arguments(
|
||||
language="en",
|
||||
human_name="user",
|
||||
assistant_name="AI",
|
||||
memory_chat_class="api_memory_chat",
|
||||
generation_backend="openai_generation",
|
||||
generation_model="gpt-4o",
|
||||
embedding_backend="openai_embedding",
|
||||
embedding_model="text-embedding-3-small",
|
||||
enable_ranker=False,
|
||||
)
|
||||
|
||||
ms = MemoryScope(arguments=arguments)
|
||||
msms = ms._context.memory_store.es_store
|
||||
msms.sync_delete_all()
|
||||
|
|
@ -80,7 +80,7 @@
|
|||
|
||||
2. Install
|
||||
```bash
|
||||
poetry install
|
||||
pip install -e .
|
||||
```
|
||||
|
||||
3. Run Elasticsearch service, refer to [elasticsearch documents](https://www.elastic.co/guide/en/elasticsearch/reference/current/getting-started.html).
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@
|
|||
3. 测试英文 / OpenAI 对话配置:
|
||||
```bash
|
||||
export OPENAI_API_KEY="sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
||||
python quick-start-demo.py --config_path=memoryscope/core/config/demo_config.yaml
|
||||
memoryscope --config_path=memoryscope/core/config/demo_config.yaml
|
||||
```
|
||||
|
||||
|
||||
|
|
@ -74,7 +74,7 @@
|
|||
|
||||
2. 安装依赖
|
||||
```bash
|
||||
poetry install
|
||||
pip install -e .
|
||||
```
|
||||
|
||||
3. 运行 Elasticsearch 服务,参照 [Elasticsearch 文档](https://www.elastic.co/guide/cn/elasticsearch/reference/current/getting-started.html)。
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
""" Version of MemoryScope."""
|
||||
__version__ = "0.1.0.8"
|
||||
__version__ = "0.1.1.1"
|
||||
import fire
|
||||
|
||||
from memoryscope.core.config.arguments import Arguments # noqa: F401
|
||||
|
|
|
|||
|
|
@ -41,11 +41,13 @@ def get_memoryscope_uuid():
|
|||
if ms_context.memory_scope_uuid:
|
||||
return ms_context.memory_scope_uuid
|
||||
else:
|
||||
raise RuntimeError("MemoryscopeContext is not initialized yet. Please initialize it first.")
|
||||
# raise RuntimeError("MemoryscopeContext is not initialized yet. Please initialize it first.")
|
||||
return "memory_scope_uuid_not_registered"
|
||||
|
||||
def get_memoryscope_context():
|
||||
ms_context = MemoryscopeContext()
|
||||
if ms_context.memory_scope_uuid:
|
||||
return ms_context
|
||||
else:
|
||||
raise RuntimeError("MemoryscopeContext is not initialized yet. Please initialize it first.")
|
||||
# raise RuntimeError("MemoryscopeContext is not initialized yet. Please initialize it first.")
|
||||
return "memory_scope_uuid_not_registered"
|
||||
|
|
|
|||
|
|
@ -74,8 +74,8 @@ contra_repeat_few_shot:
|
|||
3 Charles is {user_name}'s supervisor.
|
||||
4 Charles is {user_name}'s supervisor.
|
||||
5 Charles is {user_name}'s supervisor and the branch manager of a bank.
|
||||
5 {user_name} loves playing basketball with classmates.
|
||||
6 {user_name} likes playing basketball.
|
||||
6 {user_name} loves playing basketball with classmates.
|
||||
7 {user_name} likes playing basketball.
|
||||
|
||||
Thought: The first sentence does not have any contradictions or complete repetitions with the previously numbered sentences.
|
||||
Judgment: <1> <None>
|
||||
|
|
|
|||
2646
poetry.lock
generated
2646
poetry.lock
generated
File diff suppressed because it is too large
Load diff
|
|
@ -1,53 +0,0 @@
|
|||
[build-system]
|
||||
requires = ["poetry-core"]
|
||||
build-backend = "poetry.core.masonry.api"
|
||||
|
||||
[tool.codespell]
|
||||
check-filenames = true
|
||||
check-hidden = true
|
||||
ignore-words-list = "astroid,gallary,momento,narl,ot,rouge"
|
||||
skip = "./examples,*.csv,*.html,*.json,*.jsonl,*.pdf,*.txt,*.ipynb"
|
||||
|
||||
[tool.poetry]
|
||||
name = "memoryscope"
|
||||
version = "0.1.0.8"
|
||||
description = "MemoryScope for LLM Agentic Application."
|
||||
authors = [
|
||||
"jinli <jinli.yl@alibaba-inc.com>",
|
||||
"qiantiancheng <qiantiancheng.qtc@alibaba-inc.com>",
|
||||
"fuqingxu <fuqingxu.fqx@alibaba-inc.com>"
|
||||
]
|
||||
license = "Apache"
|
||||
readme = "README.md"
|
||||
keywords = ["Memory", "LLM"]
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = ">=3.10,<4.0"
|
||||
llama-index-core = ">=0.10.45"
|
||||
llama-index-embeddings-dashscope = ">=0.1.3"
|
||||
llama-index-llms-dashscope = ">=0.1.2"
|
||||
llama-index-postprocessor-dashscope-rerank-custom = ">=0.1.0"
|
||||
llama-index-vector-stores-elasticsearch = ">=0.2.0"
|
||||
pyfiglet = ">=1.0.2"
|
||||
termcolor = ">=2.4.0"
|
||||
llama-index = ">=0.10.45"
|
||||
fire = ">=0.6.0"
|
||||
questionary = ">=2.0.1"
|
||||
pydantic = ">=2.7.1"
|
||||
dashscope = ">=1.19.1"
|
||||
elasticsearch = ">=8.14.0"
|
||||
pyyaml = ">=6.0.1"
|
||||
numpy = ">=1.26.4"
|
||||
rich = ">=13.0.0"
|
||||
|
||||
[tool.poetry.group.dev.dependencies]
|
||||
pre-commit = "^3.7.1"
|
||||
codespell = "^2.3.0"
|
||||
|
||||
[tool.poetry.scripts]
|
||||
memoryscope = "memoryscope:cli"
|
||||
|
||||
[[tool.poetry.source]]
|
||||
name = "aliyun"
|
||||
url = "http://mirrors.aliyun.com/pypi/simple/"
|
||||
priority = "supplemental"
|
||||
|
|
@ -1,16 +1,15 @@
|
|||
llama-index-core>=0.10.45
|
||||
llama-index==0.10.45
|
||||
llama-index-embeddings-dashscope>=0.1.3
|
||||
llama-index-llms-dashscope>=0.1.2
|
||||
llama-index-postprocessor-dashscope-rerank-custom>=0.1.0
|
||||
dashscope>=1.19.1
|
||||
llama-index-vector-stores-elasticsearch>=0.2.0
|
||||
elasticsearch>=8.14.0
|
||||
pyfiglet>=1.0.2
|
||||
termcolor>=2.4.0
|
||||
llama-index>=0.10.45
|
||||
fire>=0.6.0
|
||||
questionary>=2.0.1
|
||||
pydantic>=2.7.1
|
||||
dashscope>=1.19.1
|
||||
elasticsearch>=8.14.0
|
||||
pyyaml>=6.0.1
|
||||
numpy>=1.26.4
|
||||
rich>=13.0.0
|
||||
74
setup.py
Normal file
74
setup.py
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
"""
|
||||
# 1. remove old temp folders
|
||||
rm -rf dist build
|
||||
|
||||
# 2. then, build
|
||||
python setup.py sdist bdist_wheel
|
||||
|
||||
# 3. finally, upload
|
||||
twine upload dist/*
|
||||
"""
|
||||
|
||||
import setuptools, glob, os
|
||||
|
||||
with open("README.md", "r", encoding="utf-8") as fh:
|
||||
long_description = fh.read()
|
||||
|
||||
def _process_requirements():
|
||||
packages = open('requirements.txt').read().strip().split('\n')
|
||||
requires = []
|
||||
for pkg in packages:
|
||||
if pkg.startswith('git+ssh'):
|
||||
return_code = os.system('pip install {}'.format(pkg))
|
||||
assert return_code == 0, 'error, status_code is: {}, exit!'.format(return_code)
|
||||
else:
|
||||
requires.append(pkg)
|
||||
return requires
|
||||
|
||||
def package_files(directory):
|
||||
paths = []
|
||||
for (path, directories, filenames) in os.walk(directory):
|
||||
for filename in filenames:
|
||||
if filename.endswith('yaml'):
|
||||
paths.append(os.path.join('..', path, filename))
|
||||
return paths
|
||||
|
||||
extra_files = package_files('memoryscope')
|
||||
|
||||
|
||||
authors = [
|
||||
{"name": "Li Yu", "email": "jinli.yl@alibaba-inc.com"},
|
||||
{"name": "Tiancheng Qin", "email": "qiancheng.qtc@alibaba-inc.com"},
|
||||
{"name": "Qingxu Fu", "email": "fuqingxu.fqx@alibaba-inc.com"},
|
||||
{"name": "Sen Huang", "email": "sen.huang@alibaba-inc.com"},
|
||||
{"name": "Xianzhe Xu", "email": "xianzhe.xxz@alibaba-inc.com"},
|
||||
{"name": "Zhaoyang Liu", "email": "zhaoyang.liu@alibaba-inc.com"}
|
||||
]
|
||||
|
||||
setuptools.setup(
|
||||
name="memoryscope",
|
||||
version="0.1.1.1",
|
||||
author=', '.join([author['name'] for author in authors]),
|
||||
author_email=', '.join([author['email'] for author in authors]),
|
||||
description="MemoryScope is a powerful and flexible long term memory system for LLM chatbots. It consists of a memory database and three customizable system operations, which can be flexibly combined to provide robust long term memory services for your LLM chatbot.",
|
||||
long_description=long_description,
|
||||
long_description_content_type="text/markdown",
|
||||
url="https://github.com/modelscope/memoryscope",
|
||||
project_urls={
|
||||
"Bug Tracker": "https://github.com/modelscope/memoryscope/issues",
|
||||
},
|
||||
classifiers=[
|
||||
"Programming Language :: Python :: 3",
|
||||
"License :: Apache License",
|
||||
"Operating System :: OS Independent",
|
||||
],
|
||||
package_dir={"": "."},
|
||||
package_data={"": extra_files},
|
||||
include_package_data=True,
|
||||
entry_points = {
|
||||
'console_scripts': ['memoryscope=memoryscope:cli'],
|
||||
},
|
||||
packages=setuptools.find_packages(where="."),
|
||||
python_requires=">=3.10",
|
||||
install_requires=_process_requirements(),
|
||||
)
|
||||
Loading…
Add table
Reference in a new issue