Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Agent conversational systems rely on limited context windows — once the Token

- **Semantic Retrieval & Conflict Detection**: Unified cross-type vector semantic retrieval; `MemUpdateChecker` uses LLM to analyze semantic conflicts and intelligently decide ADD/DELETE strategies; LLM outputs UPDATE/DELETE directives validated via semantic checks before execution, ensuring memory consistency and controllable operations.

- **Full-Stack Storage Backend System**: Coverage across five storage categories — KV (InMemoryKV/ShelveStore/DbBasedKV/Redis), Vector (ChromaDB/Milvus/Elasticsearch/GaussVector), Relational (SQLite/PostgreSQL/MySQL/GaussDB), Message (SqlMessageStore), and Graph (Milvus GraphStore) — adapting from local single-node to cloud cluster scenarios.
- **Full-Stack Storage Backend System**: Coverage across five storage categories — KV (InMemoryKV/ShelveStore/DbBasedKV/Redis), Vector (ChromaDB/Milvus/Elasticsearch/GaussVector/Qdrant), Relational (SQLite/PostgreSQL/MySQL/GaussDB), Message (SqlMessageStore), and Graph (Milvus GraphStore) — adapting from local single-node to cloud cluster scenarios.

- **Data Migration Framework**: Supports versioned schema migration for KV/vector/SQL/message/index stores and cross-BaseMemoryIndex batch data migration, with an operation registry for custom migration extensions.

Expand Down Expand Up @@ -80,6 +80,9 @@ pip install JiuwenMemory[redis]
# ChromaDB vector store
pip install JiuwenMemory[chromadb]

# Qdrant vector store
pip install JiuwenMemory[qdrant]

# File-system memory backend (sqlite-vec + watchdog + jieba)
# Required for INDEX_BACKEND=file; missing deps silently degrade:
pip install JiuwenMemory[file-index]
Expand Down Expand Up @@ -330,7 +333,7 @@ Graph Memory is an independent knowledge graph memory module. It turns input con

### **Flexible Storage Backends and Data Migration**

- **Full-Stack Storage Backends**: Coverage across five storage categories — KV (InMemoryKV/ShelveStore/DbBasedKV/Redis), Vector (ChromaDB/Milvus/Elasticsearch/GaussVector), Relational (SQLite/PostgreSQL/MySQL/GaussDB), Message (SqlMessageStore), and Graph (Milvus GraphStore) — adapting from local single-node to cloud cluster scenarios.
- **Full-Stack Storage Backends**: Coverage across five storage categories — KV (InMemoryKV/ShelveStore/DbBasedKV/Redis), Vector (ChromaDB/Milvus/Elasticsearch/GaussVector/Qdrant), Relational (SQLite/PostgreSQL/MySQL/GaussDB), Message (SqlMessageStore), and Graph (Milvus GraphStore) — adapting from local single-node to cloud cluster scenarios.
- **Versioned Migration**: A complete migration framework supporting SQL schema changes, vector field renaming, KV data updates, message data transformation, and index field operations.
- **Cross-index Migration**: Supports batch migration of memory data between different BaseMemoryIndex instances for smooth storage engine switching, with an operation registry for custom migration extensions.

Expand Down
7 changes: 5 additions & 2 deletions README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Agent对话系统依赖有限的上下文窗口,一旦超出 Token 限制或

- **语义检索与冲突检测**:跨记忆类型统一向量语义检索;`MemUpdateChecker` 通过 LLM 分析语义冲突智能决定 ADD/DELETE 策略,LLM 输出 UPDATE/DELETE 指令经语义校验后执行,确保记忆一致与操作可控。

- **全栈存储后端体系**:覆盖 KV(InMemoryKV/ShelveStore/DbBasedKV/Redis)、向量(ChromaDB/Milvus/Elasticsearch/GaussVector)、关系型(SQLite/PostgreSQL/MySQL/GaussDB)、消息(SqlMessageStore)、图(Milvus GraphStore)五大存储类别,适配本地单机到云端集群全场景。
- **全栈存储后端体系**:覆盖 KV(InMemoryKV/ShelveStore/DbBasedKV/Redis)、向量(ChromaDB/Milvus/Elasticsearch/GaussVector/Qdrant)、关系型(SQLite/PostgreSQL/MySQL/GaussDB)、消息(SqlMessageStore)、图(Milvus GraphStore)五大存储类别,适配本地单机到云端集群全场景。

- **数据迁移框架**:支持 KV/向量/SQL/消息/索引的版本化 schema 迁移与跨 BaseMemoryIndex 实例批量数据迁移,操作注册表支持自定义迁移扩展。

Expand Down Expand Up @@ -80,6 +80,9 @@ pip install JiuwenMemory[redis]
# ChromaDB 向量存储
pip install JiuwenMemory[chromadb]

# Qdrant 向量存储
pip install JiuwenMemory[qdrant]

# 文件系统记忆后端(sqlite-vec + watchdog + jieba)
# 用 INDEX_BACKEND=file 时需要,缺失则静默降级
pip install JiuwenMemory[file-index]
Expand Down Expand Up @@ -322,7 +325,7 @@ Graph Memory 是独立的知识图谱记忆模块,可将输入内容沉淀为

### **灵活的存储后端与数据迁移**

- **全栈存储后端**:覆盖 KV(InMemoryKV/ShelveStore/DbBasedKV/Redis)、向量(ChromaDB/Milvus/Elasticsearch/GaussVector)、关系型(SQLite/PostgreSQL/MySQL/GaussDB)、消息(SqlMessageStore)、图(Milvus GraphStore)五大存储类别,适配本地单机到云端集群全场景。
- **全栈存储后端**:覆盖 KV(InMemoryKV/ShelveStore/DbBasedKV/Redis)、向量(ChromaDB/Milvus/Elasticsearch/GaussVector/Qdrant)、关系型(SQLite/PostgreSQL/MySQL/GaussDB)、消息(SqlMessageStore)、图(Milvus GraphStore)五大存储类别,适配本地单机到云端集群全场景。
- **版本化迁移**:提供完整的迁移框架,支持 SQL schema 变更、向量字段重命名、KV 数据更新、消息数据转换和索引字段操作等多种迁移类型。
- **跨索引迁移**:支持在不同 BaseMemoryIndex 实例之间批量迁移记忆数据,操作注册表支持自定义迁移扩展,实现存储引擎的平滑切换。

Expand Down
7 changes: 6 additions & 1 deletion docs/en/API Docs/memory_server.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ If neither `.env` file is found, the service automatically creates the `~/.jiuwe
| `DB_STORE_TYPE` | `default` | DB Store type. Supported values: `default` / `gauss`. |
| `INDEX_BACKEND` | `simple` | Memory index backend. Supported values: `simple` (vector, KV+Vector) / `file` (markdown+SQLite). When `file`, long-term memories are persisted to markdown files; see `FILE_MEMORY_DATA_DIR`. |
| `FILE_MEMORY_DATA_DIR` | `~/.jiuwenmemory/file_memory_data` | `FileMemoryIndex` data root directory. Only effective when `INDEX_BACKEND=file`. |
| `VECTOR_STORE_TYPE` | `chroma` | Vector Store type. Supported values: `chroma` / `milvus` / `elasticsearch` / `gauss`. Under `INDEX_BACKEND=file`, the vector store is only used for middle-term memory / dreaming and may be left unconfigured. |
| `VECTOR_STORE_TYPE` | `chroma` | Vector Store type. Supported values: `chroma` / `milvus` / `elasticsearch` / `gauss` / `qdrant`. Under `INDEX_BACKEND=file`, the vector store is only used for middle-term memory / dreaming and may be left unconfigured. |
| `VECTOR_CHROMA_PERSIST_DIR` | `MEMORY_DATA_DIR` | Chroma persistence directory. |
| `VECTOR_MILVUS_URI` | empty string | Milvus service URI. |
| `VECTOR_MILVUS_TOKEN` | empty string | Milvus token; optional. |
Expand All @@ -124,6 +124,11 @@ If neither `.env` file is found, the service automatically creates the `~/.jiuwe
| `VECTOR_GAUSS_DATABASE` | `postgres` | Gauss vector store database name. |
| `VECTOR_GAUSS_USER` | `postgres` | Gauss vector store user. |
| `VECTOR_GAUSS_PASSWORD` | empty string | Gauss vector store password. |
| `VECTOR_QDRANT_URL` | `http://localhost:6333` | Qdrant HTTP endpoint. |
| `VECTOR_QDRANT_API_KEY` | empty string | Qdrant API key; optional for unsecured local deployments. |
| `VECTOR_QDRANT_COLLECTION_PREFIX` | `agent_vector` | Prefix used to isolate JiuwenMemory collections. |
| `VECTOR_QDRANT_PREFER_GRPC` | `false` | Prefer Qdrant's gRPC transport when set to `true`. |
| `VECTOR_QDRANT_TIMEOUT` | client default | Request timeout in seconds; leave empty to use the client default. |

#### `INDEX_BACKEND=file` notes

Expand Down
7 changes: 6 additions & 1 deletion docs/zh/API文档/memory_server.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ IP=127.0.0.1 PORT=8000 python -m jiuwen_memory.server.memory_server
| `DB_STORE_TYPE` | `default` | DB Store 类型,支持 `default` / `gauss`。 |
| `INDEX_BACKEND` | `simple` | 记忆索引后端,支持 `simple`(向量,KV+Vector)/ `file`(markdown+SQLite)。`file` 时长期记忆落 markdown 文件,配合 `FILE_MEMORY_DATA_DIR`。 |
| `FILE_MEMORY_DATA_DIR` | `~/.jiuwenmemory/file_memory_data` | FileMemoryIndex 数据根目录,仅 `INDEX_BACKEND=file` 时生效。 |
| `VECTOR_STORE_TYPE` | `chroma` | Vector Store 类型,支持 `chroma` / `milvus` / `elasticsearch` / `gauss`。`INDEX_BACKEND=file` 时仅用于中间记忆 / dreaming,可不配。 |
| `VECTOR_STORE_TYPE` | `chroma` | Vector Store 类型,支持 `chroma` / `milvus` / `elasticsearch` / `gauss` / `qdrant`。`INDEX_BACKEND=file` 时仅用于中间记忆 / dreaming,可不配。 |
| `VECTOR_CHROMA_PERSIST_DIR` | `MEMORY_DATA_DIR` | Chroma 向量库持久化目录。 |
| `VECTOR_MILVUS_URI` | 空字符串 | Milvus 服务地址。 |
| `VECTOR_MILVUS_TOKEN` | 空字符串 | Milvus Token,可为空。 |
Expand All @@ -124,6 +124,11 @@ IP=127.0.0.1 PORT=8000 python -m jiuwen_memory.server.memory_server
| `VECTOR_GAUSS_DATABASE` | `postgres` | Gauss 向量库数据库名。 |
| `VECTOR_GAUSS_USER` | `postgres` | Gauss 向量库用户名。 |
| `VECTOR_GAUSS_PASSWORD` | 空字符串 | Gauss 向量库密码。 |
| `VECTOR_QDRANT_URL` | `http://localhost:6333` | Qdrant HTTP 服务地址。 |
| `VECTOR_QDRANT_API_KEY` | 空字符串 | Qdrant API Key;本地无鉴权部署可留空。 |
| `VECTOR_QDRANT_COLLECTION_PREFIX` | `agent_vector` | JiuwenMemory collection 隔离前缀。 |
| `VECTOR_QDRANT_PREFER_GRPC` | `false` | 设为 `true` 时优先使用 Qdrant gRPC 传输。 |
| `VECTOR_QDRANT_TIMEOUT` | 客户端默认值 | 请求超时秒数;留空使用客户端默认值。 |

#### `INDEX_BACKEND=file` 说明

Expand Down
9 changes: 6 additions & 3 deletions jiuwen_memory/foundation/store/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

# Built-in backends. Closed to extension by design — use register_vector_store
# or the entry_points mechanism for 3rd-party backends.
_BUILTIN_VECTOR_STORE_NAMES = frozenset({"chroma", "milvus", "gaussvector", "elasticsearch"})
_BUILTIN_VECTOR_STORE_NAMES = frozenset({"chroma", "milvus", "gaussvector", "elasticsearch", "qdrant"})

# Explicit in-process registrations (register_vector_store).
# Maps backend name -> factory callable (typically a class).
Expand All @@ -48,7 +48,7 @@ def register_vector_store(
Use this in application init code when shipping a plugin via
entry_points is not practical (e.g., private in-repo backend).

Built-in names (chroma, milvus, gaussvector) cannot be overridden — a
Built-in names (chroma, milvus, gaussvector, elasticsearch, qdrant) cannot be overridden — a
register call with a built-in name is kept in the registry but the
built-in still wins in ``create_vector_store()`` resolution.

Expand Down Expand Up @@ -78,6 +78,9 @@ def _resolve_builtin(store_type: str, kwargs: dict) -> "BaseVectorStore | None":
if store_type == "elasticsearch":
from jiuwen_memory.foundation.store.vector.es_vector_store import ElasticsearchVectorStore
return ElasticsearchVectorStore(**kwargs)
if store_type == "qdrant":
from jiuwen_memory.foundation.store.vector.qdrant_vector_store import QdrantVectorStore
return QdrantVectorStore(**kwargs)
return None


Expand Down Expand Up @@ -122,7 +125,7 @@ def create_vector_store(store_type: str, **kwargs) -> "BaseVectorStore | None":
"""Factory for vector-store backends.

Resolution order:
1. Built-in (chroma, milvus, gaussvector) — always wins, closed set.
1. Built-in (chroma, milvus, gaussvector, elasticsearch, qdrant) — always wins, closed set.
2. Explicit registrations via ``register_vector_store()``.
3. Entry_points in group ``openjiuwen.vector_stores``.

Expand Down
Loading