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
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
venv/
.ipynb_checkpoints
.__pycache__
__pycache__
__pycache__/
*.pyc
*.pyo
*.pyd
*.log
tmp*
temp*
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ dependencies = [
"rich>=14.2.0",
"asyncpg>=0.31.0",
"chromadb>=1.3.5",
"pyseekdb>=1.2.0",
"dashscope>=1.25.1",
"elasticsearch>=9.2.0",
"fastapi>=0.121.3",
Expand Down
24 changes: 22 additions & 2 deletions reme/core/embedding/base_embedding_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import asyncio
import hashlib
import json
import os
import time
from abc import ABC
from collections import OrderedDict
Expand Down Expand Up @@ -55,8 +56,8 @@ def __init__(
enable_cache: Whether to enable embedding cache
**kwargs: Additional model-specific parameters
"""
self.api_key: str = api_key
self.base_url: str = base_url
self._api_key: str | None = api_key
self._base_url: str | None = base_url
self.model_name = model_name
self.dimensions = dimensions
self.use_dimensions = use_dimensions
Expand All @@ -77,6 +78,25 @@ def __init__(
self.cache_path: Path = Path(self.cache_dir)
self.cache_path.mkdir(parents=True, exist_ok=True)

@property
def api_key(self) -> str | None:
"""Get API key from environment variable."""
return (
os.getenv("REME_EMBEDDING_API_KEY")
or os.getenv("EMBEDDING_API_KEY")
or os.getenv("OPENAI_API_KEY")
or self._api_key
)

@property
def base_url(self) -> str | None:
"""Get base URL from environment variable."""
return (
os.getenv("REME_EMBEDDING_BASE_URL")
or os.getenv("EMBEDDING_BASE_URL")
or self._base_url
)

def _truncate_text(self, text: str) -> str:
"""Truncate text to max_input_length if it exceeds the limit."""
if len(text) > self.max_input_length:
Expand Down
12 changes: 10 additions & 2 deletions reme/core/file_store/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""File store module for persistent memory management.

This module provides storage backends for memory chunks and file metadata,
including SQLite-based, ChromaDB-based, and pure-Python local implementations
with vector and full-text search.
including SQLite-based, ChromaDB-based, seekdb-based, and pure-Python local
implementations with vector and full-text search.
"""

from .base_file_store import BaseFileStore
Expand All @@ -21,3 +21,11 @@
R.file_stores.register("sqlite")(SqliteFileStore)
R.file_stores.register("chroma")(ChromaFileStore)
R.file_stores.register("local")(LocalFileStore)

try:
from .seekdb_file_store import SeekdbFileStore

R.file_stores.register("seekdb")(SeekdbFileStore)
__all__.append("SeekdbFileStore")
except ImportError:
pass
Loading