diff --git a/.gitignore b/.gitignore index 6fbfaf3ae1..878769d3b9 100644 --- a/.gitignore +++ b/.gitignore @@ -74,7 +74,7 @@ results/ /thread_monitor_report.csv -# Memory2 autorecord +# Memory autorecord recording*.db # Rerun recordings diff --git a/dimos/cli/dimos.py b/dimos/cli/dimos.py index ee6a92f457..058c35589f 100644 --- a/dimos/cli/dimos.py +++ b/dimos/cli/dimos.py @@ -794,7 +794,7 @@ def dataprep_inspect( map_app.command("replay")(_map_replay_main) map_app.command("replay-marker")(_map_replay_marker_main) -from dimos.memory2.cli.app import mem_app +from dimos.memory.cli.app import mem_app main.add_typer(mem_app, name="mem") diff --git a/dimos/cli/dtop.py b/dimos/cli/dtop.py index f7182b8dba..8798e74519 100644 --- a/dimos/cli/dtop.py +++ b/dimos/cli/dtop.py @@ -213,7 +213,7 @@ def __init__(self, topic_name: str = "/resource_stats", db_path: str | None = No autoconf(check_only=True) if db_path is not None: - from dimos.memory2.store.sqlite import SqliteStore + from dimos.memory.store.sqlite import SqliteStore self._store: SqliteStore | None = SqliteStore(path=db_path) self._store.start() @@ -565,7 +565,7 @@ def main() -> None: parser.add_argument( "--log", action="store_true", - help="Log stats to a memory2 SQLite database (dtop_{timestamp}.ignore.db).", + help="Log stats to a memory SQLite database (dtop_{timestamp}.ignore.db).", ) args = parser.parse_args() diff --git a/dimos/control/benchmarking/paths.py b/dimos/control/benchmarking/paths.py index 8b3ed2e9bc..94c688d5d2 100644 --- a/dimos/control/benchmarking/paths.py +++ b/dimos/control/benchmarking/paths.py @@ -22,8 +22,8 @@ import math -from dimos.memory2.vis.space.elements import Point, Polyline, Text -from dimos.memory2.vis.space.space import Space +from dimos.memory.vis.space.elements import Point, Polyline, Text +from dimos.memory.vis.space.space import Space from dimos.msgs.geometry_msgs.Point import Point as GeoPoint from dimos.msgs.geometry_msgs.PoseStamped import PoseStamped from dimos.msgs.geometry_msgs.Quaternion import Quaternion @@ -41,7 +41,7 @@ def _xy_to_path(executed_xy: list[tuple[float, float]]) -> Path: - """Wrap (x, y) tuples in a nav_msgs.Path so memory2 Polyline can render them.""" + """Wrap (x, y) tuples in a nav_msgs.Path so memory Polyline can render them.""" poses = [ PoseStamped( position=Vector3(x, y, 0.0), @@ -428,7 +428,7 @@ def default_battery() -> dict[str, Path]: def path_to_svg(path: Path, size_px: int = 400, margin_px: int = 20) -> str: - """Render a Path as an SVG polyline via memory2.vis.space. + """Render a Path as an SVG polyline via memory.vis.space. ``size_px`` / ``margin_px`` are kept for API compatibility but ignored; Space picks its own dimensions from world-space content bounds. @@ -449,7 +449,7 @@ def trajectory_to_svg( size_px: int = 500, margin_px: int = 20, ) -> str: - """Reference path (gray) + executed trajectory (blue), via memory2.vis.space.""" + """Reference path (gray) + executed trajectory (blue), via memory.vis.space.""" if not reference.poses or not executed_xy: return Space().to_svg() @@ -470,7 +470,7 @@ def multi_trajectory_to_svg( margin_px: int = 30, title: str | None = None, ) -> str: - """Reference + multiple executed trajectories overlaid, via memory2.vis.space. + """Reference + multiple executed trajectories overlaid, via memory.vis.space. Each cohort gets a distinct color from ``_COHORT_COLORS`` (10 unique entries; no collisions for the current cohort matrix). A small dot at @@ -478,7 +478,7 @@ def multi_trajectory_to_svg( converge. The legend is emitted as ``Polyline`` stubs + ``Text`` labels placed in world space below the plot bounds, so it sits inside the auto-fit viewBox alongside the trajectories. Axes / grid / tick labels - are drawn by memory2's Space renderer (`show_axes=True`). + are drawn by memory's Space renderer (`show_axes=True`). """ if not reference.poses: return Space().to_svg() diff --git a/dimos/experimental/world_belief/recall.py b/dimos/experimental/world_belief/recall.py index 0b74b8f3d0..7d989b0c6b 100644 --- a/dimos/experimental/world_belief/recall.py +++ b/dimos/experimental/world_belief/recall.py @@ -23,13 +23,13 @@ import re from typing import TYPE_CHECKING, Any, cast -from dimos.memory2.embed import EmbedImages +from dimos.memory.embed import EmbedImages from dimos.msgs.sensor_msgs.Image import Image from dimos.utils.logging_config import setup_logger if TYPE_CHECKING: - from dimos.memory2.store.base import Store - from dimos.memory2.type.observation import EmbeddedObservation + from dimos.memory.store.base import Store + from dimos.memory.type.observation import EmbeddedObservation logger = setup_logger() diff --git a/dimos/experimental/world_belief/scene_scan.py b/dimos/experimental/world_belief/scene_scan.py index cdd963d760..f386e32e14 100644 --- a/dimos/experimental/world_belief/scene_scan.py +++ b/dimos/experimental/world_belief/scene_scan.py @@ -30,7 +30,7 @@ from dimos.utils.logging_config import setup_logger if TYPE_CHECKING: - from dimos.memory2.store.base import Store + from dimos.memory.store.base import Store from dimos.perception.detection.detectors.base import Detector from dimos.perception.detection.type.detection2d.imageDetections2D import ImageDetections2D diff --git a/dimos/experimental/world_belief/world_belief.py b/dimos/experimental/world_belief/world_belief.py index cd50808913..dcbe3cf1e3 100644 --- a/dimos/experimental/world_belief/world_belief.py +++ b/dimos/experimental/world_belief/world_belief.py @@ -191,7 +191,7 @@ def __init__( novelty: float, max_views: int, ) -> None: - from dimos.memory2.store.sqlite import SqliteStore + from dimos.memory.store.sqlite import SqliteStore self._store = SqliteStore(path=path) self._namespace = _gallery_namespace(model_id) diff --git a/dimos/experimental/world_belief/worldbelief_module.py b/dimos/experimental/world_belief/worldbelief_module.py index 2b167646c8..0cda1e0e2f 100644 --- a/dimos/experimental/world_belief/worldbelief_module.py +++ b/dimos/experimental/world_belief/worldbelief_module.py @@ -40,7 +40,7 @@ from dimos.experimental.world_belief.worldbelief_recorder import ( WorldBeliefRecorderSpec, ) -from dimos.memory2.module import MemoryModuleConfig +from dimos.memory.module import MemoryModuleConfig from dimos.msgs.sensor_msgs.Image import Image from dimos.msgs.sensor_msgs.PointCloud2 import PointCloud2 from dimos.msgs.vision_msgs.Detection3DArray import Detection3DArray @@ -239,7 +239,7 @@ def scan(self, prompt: list[str] | None = None, window: float = 60.0) -> SkillRe from dimos.experimental.world_belief.scene_scan import ( ScanIncompleteError, ) - from dimos.memory2.store.sqlite import SqliteStore + from dimos.memory.store.sqlite import SqliteStore from dimos.perception.experimental.object import ( aggregate_pointclouds, to_detection3d_array, @@ -340,7 +340,7 @@ def recall(self, text: str, k: int = 20) -> dict[str, Any] | None: from contextlib import nullcontext from dimos.experimental.world_belief.recall import recall as _recall - from dimos.memory2.store.sqlite import SqliteStore + from dimos.memory.store.sqlite import SqliteStore text = text.strip() if not text: diff --git a/dimos/experimental/world_belief/worldbelief_recorder.py b/dimos/experimental/world_belief/worldbelief_recorder.py index ad3117574e..276b0897d1 100644 --- a/dimos/experimental/world_belief/worldbelief_recorder.py +++ b/dimos/experimental/world_belief/worldbelief_recorder.py @@ -21,7 +21,7 @@ from dimos.constants import STATE_DIR from dimos.core.core import rpc from dimos.core.stream import In -from dimos.memory2.module import Recorder, RecorderConfig, pose_setter_for +from dimos.memory.module import Recorder, RecorderConfig, pose_setter_for from dimos.msgs.geometry_msgs.Transform import Transform from dimos.msgs.sensor_msgs.CameraInfo import CameraInfo from dimos.msgs.sensor_msgs.Image import Image diff --git a/dimos/hardware/sensors/lidar/fastlio2/recorder.py b/dimos/hardware/sensors/lidar/fastlio2/recorder.py index 3ac40ae4bf..f6400df354 100644 --- a/dimos/hardware/sensors/lidar/fastlio2/recorder.py +++ b/dimos/hardware/sensors/lidar/fastlio2/recorder.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Record FAST-LIO odometry + lidar into a memory2 SQLite db. +"""Record FAST-LIO odometry + lidar into a memory SQLite db. A ``Recorder`` that records its In ports under their own names (``fastlio_odometry`` / ``fastlio_lidar``) — wire them to FastLio2's @@ -25,7 +25,7 @@ from __future__ import annotations from dimos.core.stream import In -from dimos.memory2.module import OnExisting, Recorder, RecorderConfig, pose_setter_for +from dimos.memory.module import OnExisting, Recorder, RecorderConfig, pose_setter_for from dimos.msgs.geometry_msgs.Pose import Pose from dimos.msgs.nav_msgs.Odometry import Odometry from dimos.msgs.sensor_msgs.PointCloud2 import PointCloud2 diff --git a/dimos/hardware/sensors/lidar/fastlio2/tools/pcap_to_db.py b/dimos/hardware/sensors/lidar/fastlio2/tools/pcap_to_db.py index 6d73c7c0e0..0c42313508 100644 --- a/dimos/hardware/sensors/lidar/fastlio2/tools/pcap_to_db.py +++ b/dimos/hardware/sensors/lidar/fastlio2/tools/pcap_to_db.py @@ -151,7 +151,7 @@ def _write_rrd(db_path: Path, odom_stream: str, lidar_stream: str, voxel: float) import numpy as np import rerun as rr - from dimos.memory2.store.sqlite import SqliteStore + from dimos.memory.store.sqlite import SqliteStore from dimos.msgs.nav_msgs.Odometry import Odometry from dimos.msgs.sensor_msgs.PointCloud2 import PointCloud2 from dimos.visualization.rerun.init import rerun_init @@ -413,7 +413,7 @@ def main(argv: list[str]) -> int: parser.add_argument( "--db", default=None, - help="target memory2 SQLite db. Existing -> append/align; missing -> fetched via " + help="target memory SQLite db. Existing -> append/align; missing -> fetched via " "get_data (LFS), else built from scratch. Omit to default to .db.", ) parser.add_argument( diff --git a/dimos/hardware/sensors/lidar/pointlio/recorder.py b/dimos/hardware/sensors/lidar/pointlio/recorder.py index e859190351..5ef22f8bc1 100644 --- a/dimos/hardware/sensors/lidar/pointlio/recorder.py +++ b/dimos/hardware/sensors/lidar/pointlio/recorder.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Record Point-LIO odometry + lidar into a memory2 SQLite db. +"""Record Point-LIO odometry + lidar into a memory SQLite db. A ``Recorder`` that records its In ports under their own names (``pointlio_odometry`` / ``pointlio_lidar``) — wire them to PointLio's @@ -25,7 +25,7 @@ from __future__ import annotations from dimos.core.stream import In -from dimos.memory2.module import OnExisting, Recorder, RecorderConfig, pose_setter_for +from dimos.memory.module import OnExisting, Recorder, RecorderConfig, pose_setter_for from dimos.msgs.geometry_msgs.Pose import Pose from dimos.msgs.nav_msgs.Odometry import Odometry from dimos.msgs.sensor_msgs.PointCloud2 import PointCloud2 diff --git a/dimos/hardware/sensors/lidar/pointlio/scripts/pcap_to_db.py b/dimos/hardware/sensors/lidar/pointlio/scripts/pcap_to_db.py index c05e497690..3ca9552686 100644 --- a/dimos/hardware/sensors/lidar/pointlio/scripts/pcap_to_db.py +++ b/dimos/hardware/sensors/lidar/pointlio/scripts/pcap_to_db.py @@ -231,7 +231,7 @@ def _write_rrd(db_path: Path, odom_stream: str, lidar_stream: str, voxel: float) import numpy as np import rerun as rr - from dimos.memory2.store.sqlite import SqliteStore + from dimos.memory.store.sqlite import SqliteStore from dimos.msgs.nav_msgs.Odometry import Odometry from dimos.msgs.sensor_msgs.PointCloud2 import PointCloud2 from dimos.visualization.rerun.init import rerun_init @@ -504,7 +504,7 @@ def main(argv: list[str]) -> int: parser.add_argument( "--db", default=None, - help="target memory2 SQLite db. Existing -> append/align; missing -> built from " + help="target memory SQLite db. Existing -> append/align; missing -> built from " "scratch. Omit to default to .db next to the pcap.", ) parser.add_argument( diff --git a/dimos/imitation/collection/blueprint.py b/dimos/imitation/collection/blueprint.py index 04aebdba30..40b5b3ef96 100644 --- a/dimos/imitation/collection/blueprint.py +++ b/dimos/imitation/collection/blueprint.py @@ -14,7 +14,7 @@ """Recording blueprints. -`CollectionRecorder` (a memory2 Recorder) captures the obs/action/status +`CollectionRecorder` (a memory Recorder) captures the obs/action/status streams to a SQLite session DB during the run and flushes it durably on shutdown. DataPrep reads that DB afterwards. """ diff --git a/dimos/imitation/collection/recorder.py b/dimos/imitation/collection/recorder.py index b873815b1e..5337b440d2 100644 --- a/dimos/imitation/collection/recorder.py +++ b/dimos/imitation/collection/recorder.py @@ -12,9 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""CollectionRecorder — captures teleop collection streams to a memory2 DB. +"""CollectionRecorder — captures teleop collection streams to a memory DB. -A `Recorder` (memory2) subscribes each declared `In` port and appends every +A `Recorder` (memory) subscribes each declared `In` port and appends every message to a SQLite store, flushing durably on stop(). Only *connected* streams are recorded, so the same recorder works for any arm whose coordinator publishes `coordinator_joint_state`. @@ -27,7 +27,7 @@ from dimos.core.stream import In from dimos.imitation.collection.episode_monitor import EpisodeStatus -from dimos.memory2.module import Recorder, RecorderConfig +from dimos.memory.module import Recorder, RecorderConfig from dimos.msgs.sensor_msgs.Image import Image from dimos.msgs.sensor_msgs.JointState import JointState diff --git a/dimos/imitation/dataprep/build.py b/dimos/imitation/dataprep/build.py index 1955ec9b69..f535435475 100644 --- a/dimos/imitation/dataprep/build.py +++ b/dimos/imitation/dataprep/build.py @@ -36,7 +36,7 @@ get_writer, iter_episode_samples, ) -from dimos.memory2.store.sqlite import SqliteStore +from dimos.memory.store.sqlite import SqliteStore from dimos.utils.logging_config import setup_logger logger = setup_logger() diff --git a/dimos/imitation/dataprep/core.py b/dimos/imitation/dataprep/core.py index 271cb995ef..3585a36040 100644 --- a/dimos/imitation/dataprep/core.py +++ b/dimos/imitation/dataprep/core.py @@ -39,8 +39,8 @@ from dimos.protocol.service.spec import BaseConfig if TYPE_CHECKING: - from dimos.memory2.store.sqlite import SqliteStore - from dimos.memory2.stream import Stream + from dimos.memory.store.sqlite import SqliteStore + from dimos.memory.stream import Stream # Each `formats//` package's writer/reader expose these, via get_writer/get_inspector. Writer = Callable[[Iterator["Sample"], "OutputConfig"], Path] diff --git a/dimos/mapping/cli/map.py b/dimos/mapping/cli/map.py index 4449431402..6fca8a6a2e 100644 --- a/dimos/mapping/cli/map.py +++ b/dimos/mapping/cli/map.py @@ -24,14 +24,14 @@ if TYPE_CHECKING: from dimos.mapping.loop_closure.pgo import PoseGraph - from dimos.memory2.stream import Stream - from dimos.memory2.type.observation import Observation + from dimos.memory.stream import Stream + from dimos.memory.type.observation import Observation from dimos.msgs.geometry_msgs.Transform import Transform from dimos.msgs.sensor_msgs.Image import Image from dimos.msgs.sensor_msgs.PointCloud2 import PointCloud2 PATH_THICKNESS = 0.01 -# Pin pattern (from dimos/memory2/vis/space/rerun.py): thin vertical line +# Pin pattern (from dimos/memory/vis/space/rerun.py): thin vertical line # from each marker with the label floating at the top so multi-marker # labels never overlap the boxes. MARKER_STEM = 1.0 @@ -183,7 +183,7 @@ def _log_reconstruction( import rerun as rr import rerun.blueprint as rrb - from dimos.memory2.vis.color import Color + from dimos.memory.vis.color import Color from dimos.msgs.geometry_msgs.Transform import Transform rr.send_blueprint(rrb.Blueprint(rrb.Spatial3DView(origin="world"))) @@ -421,9 +421,9 @@ def main( import rerun as rr from dimos.mapping.loop_closure.pgo import PGO - from dimos.memory2.cli.dataset import open_store, resolve_dataset - from dimos.memory2.transform import QualityWindow, SpeedLimit - from dimos.memory2.utils.progress import progress + from dimos.memory.cli.dataset import open_store, resolve_dataset + from dimos.memory.transform import QualityWindow, SpeedLimit + from dimos.memory.utils.progress import progress from dimos.msgs.sensor_msgs.CameraInfo import CameraInfo from dimos.msgs.sensor_msgs.Image import Image from dimos.msgs.sensor_msgs.PointCloud2 import PointCloud2 @@ -449,7 +449,7 @@ def main( # clouds with no tf lookup are dropped. Stored per-frame poses are never # used for registration — only as trajectory metadata (dedup/path) when # the tf stream can't provide a position. - from dimos.memory2.tf import StreamTF + from dimos.memory.tf import StreamTF tf_buf = StreamTF.from_store(store) # Streams are homogeneous: read the cloud frame from the first observation. diff --git a/dimos/mapping/cli/pose_fill.py b/dimos/mapping/cli/pose_fill.py index 1a775bcd74..38465ff59f 100644 --- a/dimos/mapping/cli/pose_fill.py +++ b/dimos/mapping/cli/pose_fill.py @@ -37,9 +37,9 @@ # Heavy dimos imports are deferred (TYPE_CHECKING / inside functions) so that # `dimos map --help` stays fast. See test_cli_startup.py. if TYPE_CHECKING: - from dimos.memory2.backend import Backend - from dimos.memory2.stream import Stream - from dimos.memory2.type.observation import Observation + from dimos.memory.backend import Backend + from dimos.memory.stream import Stream + from dimos.memory.type.observation import Observation from dimos.msgs.geometry_msgs.Transform import Transform @@ -64,7 +64,7 @@ def pose_fill( camera_optical`` so a base-frame odometry source yields an optical-frame image pose. """ - from dimos.memory2.type.observation import _to_tuple + from dimos.memory.type.observation import _to_tuple from dimos.msgs.geometry_msgs.Quaternion import Quaternion from dimos.msgs.geometry_msgs.Transform import Transform from dimos.msgs.geometry_msgs.Vector3 import Vector3 @@ -103,7 +103,7 @@ def pose_fill_db( rtree spatial index is rebuilt from it on insert). Returns a per-stream count of observations written. """ - from dimos.memory2.store.sqlite import SqliteStore + from dimos.memory.store.sqlite import SqliteStore dest_p = Path(dest_path) if dest_p.exists(): diff --git a/dimos/mapping/cli/rename.py b/dimos/mapping/cli/rename.py index acdc73742a..917f912ae3 100644 --- a/dimos/mapping/cli/rename.py +++ b/dimos/mapping/cli/rename.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Copy a memory2 sqlite recording into a new file, renaming streams. +"""Copy a memory sqlite recording into a new file, renaming streams. Iterates each source stream and re-appends every observation under its new name in a fresh destination db. Slower than in-place ``ALTER TABLE`` but @@ -31,10 +31,10 @@ import typer -from dimos.memory2.codecs.base import resolve_payload_type -from dimos.memory2.store.sqlite import SqliteStore -from dimos.memory2.stream import Stream -from dimos.memory2.type.observation import Observation +from dimos.memory.codecs.base import resolve_payload_type +from dimos.memory.store.sqlite import SqliteStore +from dimos.memory.stream import Stream +from dimos.memory.type.observation import Observation from dimos.utils.data import resolve_named_path diff --git a/dimos/mapping/cli/replay.py b/dimos/mapping/cli/replay.py index 386d90200f..9f30e89cfd 100644 --- a/dimos/mapping/cli/replay.py +++ b/dimos/mapping/cli/replay.py @@ -37,10 +37,10 @@ import typer -from dimos.memory2.utils.progress import progress +from dimos.memory.utils.progress import progress if TYPE_CHECKING: - from dimos.memory2.stream import Stream + from dimos.memory.stream import Stream from dimos.msgs.sensor_msgs.PointCloud2 import PointCloud2 TIMELINE = "ts" @@ -177,8 +177,8 @@ def main( import rerun as rr from dimos.mapping.voxels.module import VoxelMapTransformer - from dimos.memory2.cli.dataset import open_store, resolve_dataset, stream_payload_types - from dimos.memory2.transform import throttle + from dimos.memory.cli.dataset import open_store, resolve_dataset, stream_payload_types + from dimos.memory.transform import throttle from dimos.msgs.geometry_msgs.PoseStamped import PoseStamped from dimos.msgs.nav_msgs.Odometry import Odometry from dimos.msgs.sensor_msgs.Image import Image diff --git a/dimos/mapping/cli/replay_marker.py b/dimos/mapping/cli/replay_marker.py index b299c0a26f..d2e72a2bc4 100644 --- a/dimos/mapping/cli/replay_marker.py +++ b/dimos/mapping/cli/replay_marker.py @@ -32,7 +32,7 @@ import typer if TYPE_CHECKING: - from dimos.memory2.stream import Stream + from dimos.memory.stream import Stream TIMELINE = "ts" @@ -64,9 +64,9 @@ def main( """Dump an AprilTag detection replay to .rrd and open it in rerun.""" import rerun as rr - from dimos.memory2.cli.dataset import open_store, resolve_dataset - from dimos.memory2.transform import QualityWindow, SpeedLimit - from dimos.memory2.vis.color import Color + from dimos.memory.cli.dataset import open_store, resolve_dataset + from dimos.memory.transform import QualityWindow, SpeedLimit + from dimos.memory.vis.color import Color from dimos.msgs.sensor_msgs.Image import Image from dimos.msgs.sensor_msgs.PointCloud2 import PointCloud2 from dimos.perception.fiducial.marker_transformer import DetectMarkers diff --git a/dimos/mapping/cli/test_cli.py b/dimos/mapping/cli/test_cli.py index 1652ea42fa..ad7c820499 100644 --- a/dimos/mapping/cli/test_cli.py +++ b/dimos/mapping/cli/test_cli.py @@ -84,7 +84,7 @@ def _run(*args: str, timeout: float = 300.0, group: str = "map") -> SimpleNamesp def _stream_counts(db_path: Path) -> dict[str, int]: - from dimos.memory2.store.sqlite import SqliteStore + from dimos.memory.store.sqlite import SqliteStore store = SqliteStore(path=str(db_path), must_exist=True) try: @@ -151,7 +151,7 @@ def test_pose_fill_snippet(dataset: str, tmp_path: Path) -> None: assert res.returncode == 0, res.stderr assert out.exists() - from dimos.memory2.store.sqlite import SqliteStore + from dimos.memory.store.sqlite import SqliteStore from dimos.msgs.sensor_msgs.PointCloud2 import PointCloud2 store = SqliteStore(path=str(out), must_exist=True) diff --git a/dimos/mapping/cli/test_pose_fill.py b/dimos/mapping/cli/test_pose_fill.py index 7bf6279754..2953d9e13e 100644 --- a/dimos/mapping/cli/test_pose_fill.py +++ b/dimos/mapping/cli/test_pose_fill.py @@ -21,7 +21,7 @@ from __future__ import annotations from dimos.mapping.cli.pose_fill import pose_fill -from dimos.memory2.store.memory import MemoryStore +from dimos.memory.store.memory import MemoryStore from dimos.msgs.geometry_msgs.Quaternion import Quaternion from dimos.msgs.geometry_msgs.Transform import Transform from dimos.msgs.geometry_msgs.Vector3 import Vector3 diff --git a/dimos/mapping/loop_closure/eval.py b/dimos/mapping/loop_closure/eval.py index ddd9d4cb2a..571f94635e 100644 --- a/dimos/mapping/loop_closure/eval.py +++ b/dimos/mapping/loop_closure/eval.py @@ -34,10 +34,10 @@ import typer from dimos.mapping.loop_closure.pgo import PGO -from dimos.memory2.store.sqlite import SqliteStore -from dimos.memory2.stream import Stream -from dimos.memory2.transform import QualityWindow, SpeedLimit -from dimos.memory2.type.observation import Observation +from dimos.memory.store.sqlite import SqliteStore +from dimos.memory.stream import Stream +from dimos.memory.transform import QualityWindow, SpeedLimit +from dimos.memory.type.observation import Observation from dimos.msgs.geometry_msgs.Transform import Transform from dimos.msgs.sensor_msgs.Image import Image from dimos.perception.fiducial.marker_transformer import DetectMarkers diff --git a/dimos/mapping/loop_closure/pgo.py b/dimos/mapping/loop_closure/pgo.py index c36a6099c2..99eda558b5 100644 --- a/dimos/mapping/loop_closure/pgo.py +++ b/dimos/mapping/loop_closure/pgo.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""PGO drift corrections as a memory2 Transformer. +"""PGO drift corrections as a memory Transformer. A lidar/odom stream comes in with poses that drift over time — the robot's estimate of where it is in the world slowly diverges from ground truth as @@ -51,8 +51,8 @@ import numpy as np from scipy.spatial.transform import Rotation, Slerp -from dimos.memory2.transform import Transformer -from dimos.memory2.type.observation import Observation +from dimos.memory.transform import Transformer +from dimos.memory.type.observation import Observation from dimos.msgs.geometry_msgs.Quaternion import Quaternion from dimos.msgs.geometry_msgs.Transform import Transform from dimos.msgs.geometry_msgs.Vector3 import Vector3 @@ -240,7 +240,7 @@ def interp(ts: float) -> Transform: class PGO(Transformer[PointCloud2, "PoseGraph"]): - """Pose-graph optimization as a memory2 Transformer. + """Pose-graph optimization as a memory Transformer. Emits one cumulative :class:`PoseGraph` snapshot per state change. By default (``emit_on="loop"``) that's one emit per accepted loop closure diff --git a/dimos/mapping/loop_closure/pgo_auto.py b/dimos/mapping/loop_closure/pgo_auto.py index 7f9ded4610..03525ef597 100644 --- a/dimos/mapping/loop_closure/pgo_auto.py +++ b/dimos/mapping/loop_closure/pgo_auto.py @@ -61,9 +61,9 @@ import numpy as np from scipy.spatial.transform import Rotation -from dimos.memory2.store.memory import MemoryStore -from dimos.memory2.stream import Stream -from dimos.memory2.type.observation import Observation +from dimos.memory.store.memory import MemoryStore +from dimos.memory.stream import Stream +from dimos.memory.type.observation import Observation from dimos.msgs.geometry_msgs.Quaternion import Quaternion from dimos.msgs.geometry_msgs.Transform import Transform from dimos.msgs.geometry_msgs.Vector3 import Vector3 diff --git a/dimos/mapping/loop_closure/test_pgo.py b/dimos/mapping/loop_closure/test_pgo.py index 47bc6f67dc..0815e65dbf 100644 --- a/dimos/mapping/loop_closure/test_pgo.py +++ b/dimos/mapping/loop_closure/test_pgo.py @@ -26,8 +26,8 @@ _obs_to_pose3, _pose3_to_transform, ) -from dimos.memory2.store.memory import MemoryStore -from dimos.memory2.stream import Stream +from dimos.memory.store.memory import MemoryStore +from dimos.memory.stream import Stream from dimos.msgs.geometry_msgs.Quaternion import Quaternion from dimos.msgs.geometry_msgs.Transform import Transform from dimos.msgs.geometry_msgs.Vector3 import Vector3 @@ -69,7 +69,7 @@ def test_kwargs_typed_dict_matches_config(self) -> None: class TestTransformHelpers: def test_observation_normalizes_transform_pose(self) -> None: """Constructing/deriving with pose=Transform should coerce to 7-tuple.""" - from dimos.memory2.type.observation import Observation + from dimos.memory.type.observation import Observation tf = Transform( translation=Vector3(1.5, -2.0, 0.7), @@ -86,7 +86,7 @@ def test_observation_normalizes_transform_pose(self) -> None: assert derived.pose_tuple == obs.pose_tuple def test_observation_normalizes_posestamped(self) -> None: - from dimos.memory2.type.observation import Observation + from dimos.memory.type.observation import Observation from dimos.msgs.geometry_msgs.PoseStamped import PoseStamped ps = PoseStamped(ts=1.0, position=(1.0, 2.0, 3.0), orientation=(0.0, 0.0, 0.0, 1.0)) @@ -94,7 +94,7 @@ def test_observation_normalizes_posestamped(self) -> None: assert obs.pose_tuple == (1.0, 2.0, 3.0, 0.0, 0.0, 0.0, 1.0) def test_obs_to_pose3_roundtrip(self) -> None: - from dimos.memory2.type.observation import Observation + from dimos.memory.type.observation import Observation rng = np.random.default_rng(4) R = _random_R(rng) diff --git a/dimos/mapping/loop_closure/utils/markers_rrd.py b/dimos/mapping/loop_closure/utils/markers_rrd.py index 3792d52ad2..5b8a27b107 100644 --- a/dimos/mapping/loop_closure/utils/markers_rrd.py +++ b/dimos/mapping/loop_closure/utils/markers_rrd.py @@ -32,10 +32,10 @@ import typer -from dimos.memory2.store.sqlite import SqliteStore -from dimos.memory2.stream import Stream -from dimos.memory2.transform import QualityWindow, SpeedLimit -from dimos.memory2.vis.color import Color +from dimos.memory.store.sqlite import SqliteStore +from dimos.memory.stream import Stream +from dimos.memory.transform import QualityWindow, SpeedLimit +from dimos.memory.vis.color import Color from dimos.msgs.sensor_msgs.Image import Image from dimos.msgs.sensor_msgs.PointCloud2 import PointCloud2 from dimos.perception.fiducial.marker_transformer import DetectMarkers diff --git a/dimos/mapping/ray_tracing/test_transformer.py b/dimos/mapping/ray_tracing/test_transformer.py index e18e980471..fdd5f43a80 100644 --- a/dimos/mapping/ray_tracing/test_transformer.py +++ b/dimos/mapping/ray_tracing/test_transformer.py @@ -22,7 +22,7 @@ from dimos.mapping.ray_tracing.transformer import RayTraceMap from dimos.mapping.ray_tracing.voxel_map import VoxelRayMapper -from dimos.memory2.type.observation import Observation +from dimos.memory.type.observation import Observation from dimos.msgs.sensor_msgs.PointCloud2 import PointCloud2 diff --git a/dimos/mapping/ray_tracing/transformer.py b/dimos/mapping/ray_tracing/transformer.py index 267c69909a..b8dbed054e 100644 --- a/dimos/mapping/ray_tracing/transformer.py +++ b/dimos/mapping/ray_tracing/transformer.py @@ -19,7 +19,7 @@ import numpy as np from dimos.mapping.ray_tracing.voxel_map import VoxelRayMapper, local_bounds -from dimos.memory2.transform import Transformer +from dimos.memory.transform import Transformer from dimos.msgs.geometry_msgs.Quaternion import Quaternion from dimos.msgs.geometry_msgs.Transform import Transform from dimos.msgs.geometry_msgs.Vector3 import Vector3 @@ -31,7 +31,7 @@ from numpy.typing import NDArray - from dimos.memory2.type.observation import Observation + from dimos.memory.type.observation import Observation logger = setup_logger() diff --git a/dimos/mapping/ray_tracing/utils/raytrace_rrd.py b/dimos/mapping/ray_tracing/utils/raytrace_rrd.py index 43ddf870ce..466279e2ba 100644 --- a/dimos/mapping/ray_tracing/utils/raytrace_rrd.py +++ b/dimos/mapping/ray_tracing/utils/raytrace_rrd.py @@ -28,9 +28,9 @@ import typer from dimos.mapping.ray_tracing.voxel_map import VoxelRayMapper -from dimos.memory2.store.sqlite import SqliteStore -from dimos.memory2.transform import FnTransformer -from dimos.memory2.type.observation import Observation +from dimos.memory.store.sqlite import SqliteStore +from dimos.memory.transform import FnTransformer +from dimos.memory.type.observation import Observation from dimos.msgs.nav_msgs.Odometry import Odometry from dimos.msgs.sensor_msgs.PointCloud2 import PointCloud2 from dimos.utils.data import resolve_named_path diff --git a/dimos/mapping/voxels/grid.py b/dimos/mapping/voxels/grid.py index 10886e1797..00b5d345d2 100644 --- a/dimos/mapping/voxels/grid.py +++ b/dimos/mapping/voxels/grid.py @@ -38,7 +38,7 @@ class VoxelGrid: 300k voxels). Both produce identical voxel sets. No Module/framework dependency. Can be used standalone or wrapped - by VoxelGridMapper (Module) or VoxelMapTransformer (memory2 Transformer). + by VoxelGridMapper (Module) or VoxelMapTransformer (memory Transformer). """ def __init__( diff --git a/dimos/mapping/voxels/module.py b/dimos/mapping/voxels/module.py index d275e5b2df..b273889a4c 100644 --- a/dimos/mapping/voxels/module.py +++ b/dimos/mapping/voxels/module.py @@ -20,15 +20,15 @@ from dimos.core.module import ModuleConfig from dimos.core.stream import In, Out from dimos.mapping.voxels.grid import VoxelGrid -from dimos.memory2.module import StreamModule -from dimos.memory2.stream import Stream -from dimos.memory2.transform import Transformer +from dimos.memory.module import StreamModule +from dimos.memory.stream import Stream +from dimos.memory.transform import Transformer from dimos.msgs.sensor_msgs.PointCloud2 import PointCloud2 if TYPE_CHECKING: from collections.abc import Iterator - from dimos.memory2.type.observation import Observation + from dimos.memory.type.observation import Observation class VoxelMapTransformer(Transformer[PointCloud2, PointCloud2]): diff --git a/dimos/memory2/architecture.md b/dimos/memory/architecture.md similarity index 99% rename from dimos/memory2/architecture.md rename to dimos/memory/architecture.md index c4a90a7085..1e8e6316a1 100644 --- a/dimos/memory2/architecture.md +++ b/dimos/memory/architecture.md @@ -74,7 +74,7 @@ Transform-sourced streams (post `.transform()`) always use `StreamQuery.apply()` ## Quick start ```python -from dimos.memory2 import MemoryStore +from dimos.memory import MemoryStore store = MemoryStore() images = store.stream("images") diff --git a/dimos/memory2/backend.py b/dimos/memory/backend.py similarity index 94% rename from dimos/memory2/backend.py rename to dimos/memory/backend.py index 49ba269742..81509ede79 100644 --- a/dimos/memory2/backend.py +++ b/dimos/memory/backend.py @@ -20,22 +20,22 @@ from typing import TYPE_CHECKING, Any, Generic, TypeVar from dimos.core.resource import CompositeResource -from dimos.memory2.codecs.base import Codec, codec_id -from dimos.memory2.notifier.subject import SubjectNotifier -from dimos.memory2.type.observation import _UNLOADED +from dimos.memory.codecs.base import Codec, codec_id +from dimos.memory.notifier.subject import SubjectNotifier +from dimos.memory.type.observation import _UNLOADED if TYPE_CHECKING: from collections.abc import Iterator from reactivex.abc import DisposableBase - from dimos.memory2.blobstore.base import BlobStore - from dimos.memory2.buffer import BackpressureBuffer - from dimos.memory2.notifier.base import Notifier - from dimos.memory2.observationstore.base import ObservationStore - from dimos.memory2.type.filter import StreamQuery - from dimos.memory2.type.observation import Observation - from dimos.memory2.vectorstore.base import VectorStore + from dimos.memory.blobstore.base import BlobStore + from dimos.memory.buffer import BackpressureBuffer + from dimos.memory.notifier.base import Notifier + from dimos.memory.observationstore.base import ObservationStore + from dimos.memory.type.filter import StreamQuery + from dimos.memory.type.observation import Observation + from dimos.memory.vectorstore.base import VectorStore T = TypeVar("T") @@ -222,7 +222,7 @@ def _iterate_live( buf: BackpressureBuffer[Observation[T]], sub: DisposableBase, ) -> Iterator[Observation[T]]: - from dimos.memory2.buffer import ClosedError + from dimos.memory.buffer import ClosedError eager = self.eager_blobs and self.blob_store is not None diff --git a/dimos/memory2/blobstore/base.py b/dimos/memory/blobstore/base.py similarity index 98% rename from dimos/memory2/blobstore/base.py rename to dimos/memory/blobstore/base.py index e4fbc1a272..717a4cfc56 100644 --- a/dimos/memory2/blobstore/base.py +++ b/dimos/memory/blobstore/base.py @@ -18,7 +18,7 @@ from typing import Any from dimos.core.resource import CompositeResource -from dimos.memory2.registry import qual +from dimos.memory.registry import qual from dimos.protocol.service.spec import BaseConfig, Configurable diff --git a/dimos/memory2/blobstore/blobstore.md b/dimos/memory/blobstore/blobstore.md similarity index 100% rename from dimos/memory2/blobstore/blobstore.md rename to dimos/memory/blobstore/blobstore.md diff --git a/dimos/memory2/blobstore/file.py b/dimos/memory/blobstore/file.py similarity index 94% rename from dimos/memory2/blobstore/file.py rename to dimos/memory/blobstore/file.py index 60c8997db0..110fdd0b2a 100644 --- a/dimos/memory2/blobstore/file.py +++ b/dimos/memory/blobstore/file.py @@ -17,8 +17,8 @@ from pathlib import Path from typing import Any -from dimos.memory2.blobstore.base import BlobStore, BlobStoreConfig -from dimos.memory2.utils.validation import validate_identifier +from dimos.memory.blobstore.base import BlobStore, BlobStoreConfig +from dimos.memory.utils.validation import validate_identifier class FileBlobStoreConfig(BlobStoreConfig): diff --git a/dimos/memory2/blobstore/sqlite.py b/dimos/memory/blobstore/sqlite.py similarity index 95% rename from dimos/memory2/blobstore/sqlite.py rename to dimos/memory/blobstore/sqlite.py index 06021dcd9a..2a00e07d4e 100644 --- a/dimos/memory2/blobstore/sqlite.py +++ b/dimos/memory/blobstore/sqlite.py @@ -19,9 +19,9 @@ from pydantic import Field, model_validator -from dimos.memory2.blobstore.base import BlobStore, BlobStoreConfig -from dimos.memory2.utils.sqlite import open_disposable_sqlite_connection -from dimos.memory2.utils.validation import validate_identifier +from dimos.memory.blobstore.base import BlobStore, BlobStoreConfig +from dimos.memory.utils.sqlite import open_disposable_sqlite_connection +from dimos.memory.utils.validation import validate_identifier class SqliteBlobStoreConfig(BlobStoreConfig): diff --git a/dimos/memory2/blobstore/test_blobstore.py b/dimos/memory/blobstore/test_blobstore.py similarity index 97% rename from dimos/memory2/blobstore/test_blobstore.py rename to dimos/memory/blobstore/test_blobstore.py index 2cae1a8a55..7ba360cb50 100644 --- a/dimos/memory2/blobstore/test_blobstore.py +++ b/dimos/memory/blobstore/test_blobstore.py @@ -21,7 +21,7 @@ import pytest if TYPE_CHECKING: - from dimos.memory2.blobstore.base import BlobStore + from dimos.memory.blobstore.base import BlobStore class TestBlobStore: diff --git a/dimos/memory2/buffer.py b/dimos/memory/buffer.py similarity index 100% rename from dimos/memory2/buffer.py rename to dimos/memory/buffer.py diff --git a/dimos/memory2/cli/app.py b/dimos/memory/cli/app.py similarity index 77% rename from dimos/memory2/cli/app.py rename to dimos/memory/cli/app.py index 6036541235..b360b2a75b 100644 --- a/dimos/memory2/cli/app.py +++ b/dimos/memory/cli/app.py @@ -12,15 +12,15 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""``dimos mem`` — memory2 store commands.""" +"""``dimos mem`` — memory store commands.""" from __future__ import annotations import typer -from dimos.memory2.cli.summary import main as _summary_main +from dimos.memory.cli.summary import main as _summary_main -mem_app = typer.Typer(help="memory2 store commands", no_args_is_help=True) +mem_app = typer.Typer(help="memory store commands", no_args_is_help=True) mem_app.command("summary")(_summary_main) @@ -34,8 +34,8 @@ def rerun( None, "--root", help="Nest every stream under this entity path (/)" ), ) -> None: - """Render a memory2 store into rerun (writes a .rrd, then opens the viewer).""" - from dimos.memory2.cli.dataset import open_dataset - from dimos.memory2.cli.render import render_store + """Render a memory store into rerun (writes a .rrd, then opens the viewer).""" + from dimos.memory.cli.dataset import open_dataset + from dimos.memory.cli.render import render_store render_store(open_dataset(path), out=out, seconds=seconds, no_gui=no_gui, root=root) diff --git a/dimos/memory2/cli/dataset.py b/dimos/memory/cli/dataset.py similarity index 92% rename from dimos/memory2/cli/dataset.py rename to dimos/memory/cli/dataset.py index 3cd0d5fbc0..e0c40233be 100644 --- a/dimos/memory2/cli/dataset.py +++ b/dimos/memory/cli/dataset.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Central dispatcher for opening a recorded memory2 dataset as a read store. +"""Central dispatcher for opening a recorded memory dataset as a read store. One entry point for every CLI that opens a recording. :func:`open_dataset` resolves a dataset name/path (bare names look up the cwd / repo ``data/`` dir) @@ -28,7 +28,7 @@ from dimos.utils.data import resolve_named_path if TYPE_CHECKING: - from dimos.memory2.store.base import Store + from dimos.memory.store.base import Store def open_store(path: str | Path) -> Store: @@ -39,7 +39,7 @@ def open_store(path: str | Path) -> Store: return Go2McapStore(path=s) if s.endswith(".db"): - from dimos.memory2.store.sqlite import SqliteStore + from dimos.memory.store.sqlite import SqliteStore return SqliteStore(path=s, must_exist=True) raise ValueError(f"unsupported dataset {s!r}: expected a .db or .mcap path") diff --git a/dimos/memory2/cli/render.py b/dimos/memory/cli/render.py similarity index 96% rename from dimos/memory2/cli/render.py rename to dimos/memory/cli/render.py index 14a6c5432f..41ee7bdc67 100644 --- a/dimos/memory2/cli/render.py +++ b/dimos/memory/cli/render.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Render any memory2 store into rerun. +"""Render any memory store into rerun. Generic: walks the store's streams and logs every observation whose payload implements ``to_rerun()`` (the :class:`RerunConvertible` convention). Streams @@ -29,7 +29,7 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from dimos.memory2.store.base import Store + from dimos.memory.store.base import Store def _open_viewer(rrd: str) -> None: @@ -58,7 +58,7 @@ def render_store( """ import rerun as rr - from dimos.memory2.utils.progress import progress + from dimos.memory.utils.progress import progress from dimos.visualization.rerun.init import rerun_init if out is None: diff --git a/dimos/memory2/cli/summary.py b/dimos/memory/cli/summary.py similarity index 93% rename from dimos/memory2/cli/summary.py rename to dimos/memory/cli/summary.py index b7c16ad027..fb3750d6d9 100644 --- a/dimos/memory2/cli/summary.py +++ b/dimos/memory/cli/summary.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Print ``Store.summary()`` for a memory2 sqlite recording. +"""Print ``Store.summary()`` for a memory sqlite recording. Usage: uv run dimos mem summary mid360 @@ -30,9 +30,9 @@ from dimos.utils.human import human_bytes if TYPE_CHECKING: - from dimos.memory2.stream import Stream + from dimos.memory.stream import Stream -# Heavy dimos imports (memory2 store → codecs, msgs) and rich are deferred into +# Heavy dimos imports (memory store → codecs, msgs) and rich are deferred into # the function bodies so that `dimos --help` — which imports this module just to # register the `mem summary` command — stays fast. See test_cli_startup.py. @@ -56,7 +56,7 @@ def main( dataset: str = typer.Argument(..., help="Dataset .db/.mcap: bare name (cwd or data/) or path"), ) -> None: """Print per-stream counts, time ranges, and payload sizes for a recorded dataset.""" - from dimos.memory2.cli.dataset import open_store, resolve_dataset + from dimos.memory.cli.dataset import open_store, resolve_dataset db_path = resolve_dataset(dataset) if db_path.suffix == ".mcap": @@ -71,7 +71,7 @@ def main( from rich.progress import Progress from rich.table import Table - from dimos.memory2.store.sqlite import SqliteStore + from dimos.memory.store.sqlite import SqliteStore rows: list[tuple[str, int, float | None, float | None, int]] = [] store = SqliteStore(path=str(db_path)) diff --git a/dimos/memory2/codecs/README.md b/dimos/memory/codecs/README.md similarity index 97% rename from dimos/memory2/codecs/README.md rename to dimos/memory/codecs/README.md index 8ad40e95fd..719369f29a 100644 --- a/dimos/memory2/codecs/README.md +++ b/dimos/memory/codecs/README.md @@ -23,7 +23,7 @@ class Codec(Protocol[T]): `codec_for(payload_type)` picks the right codec: ```python -from dimos.memory2.codecs import codec_for +from dimos.memory.codecs import codec_for codec_for(Image) # → JpegCodec(quality=50) codec_for(SomeLcmMsg) # → LcmCodec(SomeLcmMsg) (if has lcm_encode/lcm_decode) diff --git a/dimos/memory2/codecs/base.py b/dimos/memory/codecs/base.py similarity index 89% rename from dimos/memory2/codecs/base.py rename to dimos/memory/codecs/base.py index 0ddd384e84..7b77609b36 100644 --- a/dimos/memory2/codecs/base.py +++ b/dimos/memory/codecs/base.py @@ -30,17 +30,17 @@ def decode(self, data: bytes) -> T: ... def codec_for(payload_type: type[Any] | None = None) -> Codec[Any]: """Auto-select codec based on payload type.""" - from dimos.memory2.codecs.pickle import PickleCodec + from dimos.memory.codecs.pickle import PickleCodec if payload_type is not None: from dimos.msgs.sensor_msgs.Image import Image if issubclass(payload_type, Image): - from dimos.memory2.codecs.jpeg import JpegCodec + from dimos.memory.codecs.jpeg import JpegCodec return JpegCodec() if hasattr(payload_type, "lcm_encode") and hasattr(payload_type, "lcm_decode"): - from dimos.memory2.codecs.lcm import LcmCodec + from dimos.memory.codecs.lcm import LcmCodec return LcmCodec(payload_type) return PickleCodec() @@ -92,21 +92,21 @@ def resolve_payload_type(payload_module: str) -> type[Any]: def _make_one(name: str, payload_module: str, inner: Codec[Any] | None = None) -> Codec[Any]: """Instantiate a single codec by its short name.""" if name == "lz4": - from dimos.memory2.codecs.lz4 import Lz4Codec + from dimos.memory.codecs.lz4 import Lz4Codec if inner is None: raise ValueError("lz4 is a wrapper codec — must have an inner codec") return Lz4Codec(inner) if name == "jpeg": - from dimos.memory2.codecs.jpeg import JpegCodec + from dimos.memory.codecs.jpeg import JpegCodec return JpegCodec() if name == "lcm": - from dimos.memory2.codecs.lcm import LcmCodec + from dimos.memory.codecs.lcm import LcmCodec return LcmCodec(resolve_payload_type(payload_module)) if name == "pickle": - from dimos.memory2.codecs.pickle import PickleCodec + from dimos.memory.codecs.pickle import PickleCodec return PickleCodec() raise ValueError(f"Unknown codec: {name!r}") diff --git a/dimos/memory2/codecs/jpeg.py b/dimos/memory/codecs/jpeg.py similarity index 100% rename from dimos/memory2/codecs/jpeg.py rename to dimos/memory/codecs/jpeg.py diff --git a/dimos/memory2/codecs/lcm.py b/dimos/memory/codecs/lcm.py similarity index 100% rename from dimos/memory2/codecs/lcm.py rename to dimos/memory/codecs/lcm.py diff --git a/dimos/memory2/codecs/lz4.py b/dimos/memory/codecs/lz4.py similarity index 96% rename from dimos/memory2/codecs/lz4.py rename to dimos/memory/codecs/lz4.py index 15cbad56e4..4d8b0c51cf 100644 --- a/dimos/memory2/codecs/lz4.py +++ b/dimos/memory/codecs/lz4.py @@ -19,7 +19,7 @@ import lz4.frame # type: ignore[import-untyped] if TYPE_CHECKING: - from dimos.memory2.codecs.base import Codec + from dimos.memory.codecs.base import Codec class Lz4Codec: diff --git a/dimos/memory2/codecs/pickle.py b/dimos/memory/codecs/pickle.py similarity index 100% rename from dimos/memory2/codecs/pickle.py rename to dimos/memory/codecs/pickle.py diff --git a/dimos/memory2/codecs/test_codecs.py b/dimos/memory/codecs/test_codecs.py similarity index 91% rename from dimos/memory2/codecs/test_codecs.py rename to dimos/memory/codecs/test_codecs.py index c477ece8a9..6c647bf110 100644 --- a/dimos/memory2/codecs/test_codecs.py +++ b/dimos/memory/codecs/test_codecs.py @@ -24,10 +24,10 @@ import pytest -from dimos.memory2.codecs.base import Codec, codec_for -from dimos.memory2.codecs.jpeg import JpegCodec -from dimos.memory2.codecs.lcm import LcmCodec -from dimos.memory2.codecs.pickle import PickleCodec +from dimos.memory.codecs.base import Codec, codec_for +from dimos.memory.codecs.jpeg import JpegCodec +from dimos.memory.codecs.lcm import LcmCodec +from dimos.memory.codecs.pickle import PickleCodec from dimos.msgs.geometry_msgs.PoseStamped import PoseStamped from dimos.msgs.sensor_msgs.Image import Image, ImageFormat @@ -62,7 +62,7 @@ def _lcm_values() -> list[DimosMsg]: def _pickle_case() -> Case: - from dimos.memory2.codecs.pickle import PickleCodec + from dimos.memory.codecs.pickle import PickleCodec return Case( name="pickle", @@ -72,7 +72,7 @@ def _pickle_case() -> Case: def _lcm_case() -> Case: - from dimos.memory2.codecs.lcm import LcmCodec + from dimos.memory.codecs.lcm import LcmCodec from dimos.msgs.geometry_msgs.PoseStamped import PoseStamped return Case( @@ -83,8 +83,8 @@ def _lcm_case() -> Case: def _lz4_pickle_case() -> Case: - from dimos.memory2.codecs.lz4 import Lz4Codec - from dimos.memory2.codecs.pickle import PickleCodec + from dimos.memory.codecs.lz4 import Lz4Codec + from dimos.memory.codecs.pickle import PickleCodec return Case( name="lz4+pickle", @@ -94,8 +94,8 @@ def _lz4_pickle_case() -> Case: def _lz4_lcm_case() -> Case: - from dimos.memory2.codecs.lcm import LcmCodec - from dimos.memory2.codecs.lz4 import Lz4Codec + from dimos.memory.codecs.lcm import LcmCodec + from dimos.memory.codecs.lz4 import Lz4Codec from dimos.msgs.geometry_msgs.PoseStamped import PoseStamped return Case( @@ -213,6 +213,6 @@ def test_lcm_type_returns_lcm(self) -> None: def test_image_type_returns_jpeg(self) -> None: pytest.importorskip("turbojpeg") - from dimos.memory2.codecs.jpeg import JpegCodec + from dimos.memory.codecs.jpeg import JpegCodec assert isinstance(codec_for(Image), JpegCodec) diff --git a/dimos/memory2/conftest.py b/dimos/memory/conftest.py similarity index 88% rename from dimos/memory2/conftest.py rename to dimos/memory/conftest.py index 90f96cbd50..745bf6ae9d 100644 --- a/dimos/memory2/conftest.py +++ b/dimos/memory/conftest.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Shared fixtures for memory2 tests.""" +"""Shared fixtures for memory tests.""" from __future__ import annotations @@ -23,10 +23,10 @@ import pytest -from dimos.memory2.blobstore.file import FileBlobStore -from dimos.memory2.blobstore.sqlite import SqliteBlobStore -from dimos.memory2.store.memory import MemoryStore -from dimos.memory2.store.sqlite import SqliteStore +from dimos.memory.blobstore.file import FileBlobStore +from dimos.memory.blobstore.sqlite import SqliteBlobStore +from dimos.memory.store.memory import MemoryStore +from dimos.memory.store.sqlite import SqliteStore from dimos.models.embedding.clip import CLIPModel # sqlite-vec fails to load on Linux ARM (32-bit binary in the aarch64 wheel) @@ -37,8 +37,8 @@ from collections.abc import Iterator from pathlib import Path - from dimos.memory2.blobstore.base import BlobStore - from dimos.memory2.store.base import Store + from dimos.memory.blobstore.base import BlobStore + from dimos.memory.store.base import Store @pytest.fixture(scope="module") diff --git a/dimos/memory2/embed.py b/dimos/memory/embed.py similarity index 96% rename from dimos/memory2/embed.py rename to dimos/memory/embed.py index 17b5b98a31..3de9d814ce 100644 --- a/dimos/memory2/embed.py +++ b/dimos/memory/embed.py @@ -17,12 +17,12 @@ from itertools import islice from typing import TYPE_CHECKING, Any, TypeVar -from dimos.memory2.transform import Transformer +from dimos.memory.transform import Transformer if TYPE_CHECKING: from collections.abc import Iterator - from dimos.memory2.type.observation import Observation + from dimos.memory.type.observation import Observation from dimos.models.embedding.base import EmbeddingModel T = TypeVar("T") diff --git a/dimos/memory2/embeddings.md b/dimos/memory/embeddings.md similarity index 100% rename from dimos/memory2/embeddings.md rename to dimos/memory/embeddings.md diff --git a/dimos/memory2/intro.md b/dimos/memory/intro.md similarity index 97% rename from dimos/memory2/intro.md rename to dimos/memory/intro.md index 1b2153908b..ca7c5af797 100644 --- a/dimos/memory2/intro.md +++ b/dimos/memory/intro.md @@ -3,7 +3,7 @@ ## Quick start ```python session=memory ansi=false no-result -from dimos.memory2.store.sqlite import SqliteStore +from dimos.memory.store.sqlite import SqliteStore store = SqliteStore(path="/tmp/memory_readme.db") ``` @@ -141,7 +141,7 @@ Use `EmbedText` transformer with CLIP to enrich observations with embeddings, th ```python session=memory ansi=false from dimos.models.embedding.clip import CLIPModel -from dimos.memory2.embed import EmbedText +from dimos.memory.embed import EmbedText clip = CLIPModel() diff --git a/dimos/memory2/module.py b/dimos/memory/module.py similarity index 96% rename from dimos/memory2/module.py rename to dimos/memory/module.py index b8289ebd12..ff9e410fde 100644 --- a/dimos/memory2/module.py +++ b/dimos/memory/module.py @@ -32,12 +32,12 @@ from dimos.core.core import rpc from dimos.core.module import Module, ModuleConfig from dimos.core.stream import In -from dimos.memory2.embed import EmbedImages -from dimos.memory2.store.null import NullStore -from dimos.memory2.store.sqlite import SqliteStore -from dimos.memory2.stream import Stream -from dimos.memory2.transform import QualityWindow -from dimos.memory2.type.observation import EmbeddedObservation, Observation +from dimos.memory.embed import EmbedImages +from dimos.memory.store.null import NullStore +from dimos.memory.store.sqlite import SqliteStore +from dimos.memory.stream import Stream +from dimos.memory.transform import QualityWindow +from dimos.memory.type.observation import EmbeddedObservation, Observation from dimos.models.embedding.base import EmbeddingModel from dimos.msgs.geometry_msgs.PoseStamped import PoseStamped from dimos.msgs.sensor_msgs.Image import Image @@ -74,7 +74,7 @@ def _on_error(e: Exception) -> None: class StreamModule(Module, Generic[TIn, TOut]): - """Module base class that wires a memory2 stream pipeline + """Module base class that wires a memory stream pipeline and deploys it as a dimos module Parameterize with the In/Out data types so the pipeline is @@ -99,7 +99,7 @@ def pipeline(self, stream: Stream[PointCloud2]) -> Stream[PointCloud2]: is applied to the live stream, publishing results to the single ``Out`` port. The MemoryStore acts as a bridge between the push-based Module In port - and the pull-based memory2 stream pipeline — it also enables replay and + and the pull-based memory stream pipeline — it also enables replay and persistence if the store is swapped for a persistent backend later. """ @@ -232,7 +232,7 @@ def start(self) -> None: @skill def search(self, query: str) -> PoseStamped: - from dimos.memory2.transform import peaks + from dimos.memory.transform import peaks assert self.model is not None and self.embeddings is not None, ( "SemanticSearch.search() called before start()" @@ -299,7 +299,7 @@ def decorate(fn: Any) -> Any: class Recorder(MemoryModule): - """Records all ``In`` ports to a memory2 SQLite database, plus the live tf tree. + """Records all ``In`` ports to a memory SQLite database, plus the live tf tree. Subclass with the topics you want to record:: diff --git a/dimos/memory2/notes.md b/dimos/memory/notes.md similarity index 100% rename from dimos/memory2/notes.md rename to dimos/memory/notes.md diff --git a/dimos/memory2/notifier/base.py b/dimos/memory/notifier/base.py similarity index 92% rename from dimos/memory2/notifier/base.py rename to dimos/memory/notifier/base.py index 053eb10690..ad663f964f 100644 --- a/dimos/memory2/notifier/base.py +++ b/dimos/memory/notifier/base.py @@ -18,14 +18,14 @@ from typing import TYPE_CHECKING, Any, Generic, TypeVar from dimos.core.resource import Resource -from dimos.memory2.registry import qual +from dimos.memory.registry import qual from dimos.protocol.service.spec import BaseConfig, Configurable if TYPE_CHECKING: from reactivex.abc import DisposableBase - from dimos.memory2.buffer import BackpressureBuffer - from dimos.memory2.type.observation import Observation + from dimos.memory.buffer import BackpressureBuffer + from dimos.memory.type.observation import Observation T = TypeVar("T") diff --git a/dimos/memory2/notifier/subject.py b/dimos/memory/notifier/subject.py similarity index 92% rename from dimos/memory2/notifier/subject.py rename to dimos/memory/notifier/subject.py index cbca3fcc18..9ab5ac3b83 100644 --- a/dimos/memory2/notifier/subject.py +++ b/dimos/memory/notifier/subject.py @@ -21,13 +21,13 @@ from reactivex.disposable import Disposable -from dimos.memory2.notifier.base import Notifier, NotifierConfig +from dimos.memory.notifier.base import Notifier, NotifierConfig if TYPE_CHECKING: from reactivex.abc import DisposableBase - from dimos.memory2.buffer import BackpressureBuffer - from dimos.memory2.type.observation import Observation + from dimos.memory.buffer import BackpressureBuffer + from dimos.memory.type.observation import Observation T = TypeVar("T") diff --git a/dimos/memory2/observationstore/base.py b/dimos/memory/observationstore/base.py similarity index 93% rename from dimos/memory2/observationstore/base.py rename to dimos/memory/observationstore/base.py index c2643c4cc4..7568455e12 100644 --- a/dimos/memory2/observationstore/base.py +++ b/dimos/memory/observationstore/base.py @@ -18,14 +18,14 @@ from typing import TYPE_CHECKING, Any, Generic, TypeVar from dimos.core.resource import CompositeResource -from dimos.memory2.registry import qual +from dimos.memory.registry import qual from dimos.protocol.service.spec import BaseConfig, Configurable if TYPE_CHECKING: from collections.abc import Iterator - from dimos.memory2.type.filter import StreamQuery - from dimos.memory2.type.observation import Observation + from dimos.memory.type.filter import StreamQuery + from dimos.memory.type.observation import Observation T = TypeVar("T") diff --git a/dimos/memory2/observationstore/memory.py b/dimos/memory/observationstore/memory.py similarity index 92% rename from dimos/memory2/observationstore/memory.py rename to dimos/memory/observationstore/memory.py index 199a83cfcb..2462320bbf 100644 --- a/dimos/memory2/observationstore/memory.py +++ b/dimos/memory/observationstore/memory.py @@ -18,13 +18,13 @@ import threading from typing import TYPE_CHECKING, Any, TypeVar -from dimos.memory2.observationstore.base import ObservationStore, ObservationStoreConfig +from dimos.memory.observationstore.base import ObservationStore, ObservationStoreConfig if TYPE_CHECKING: from collections.abc import Iterator - from dimos.memory2.type.filter import StreamQuery - from dimos.memory2.type.observation import Observation + from dimos.memory.type.filter import StreamQuery + from dimos.memory.type.observation import Observation T = TypeVar("T") diff --git a/dimos/memory2/observationstore/sqlite.py b/dimos/memory/observationstore/sqlite.py similarity index 97% rename from dimos/memory2/observationstore/sqlite.py rename to dimos/memory/observationstore/sqlite.py index 31c6a25ea0..1d6c20e364 100644 --- a/dimos/memory2/observationstore/sqlite.py +++ b/dimos/memory/observationstore/sqlite.py @@ -22,9 +22,9 @@ from pydantic import Field, model_validator -from dimos.memory2.codecs.base import Codec -from dimos.memory2.observationstore.base import ObservationStore, ObservationStoreConfig -from dimos.memory2.type.filter import ( +from dimos.memory.codecs.base import Codec +from dimos.memory.observationstore.base import ObservationStore, ObservationStoreConfig +from dimos.memory.type.filter import ( AfterFilter, AtFilter, BeforeFilter, @@ -32,13 +32,13 @@ TagsFilter, TimeRangeFilter, ) -from dimos.memory2.type.observation import _UNLOADED, Observation, PoseTuple -from dimos.memory2.utils.sqlite import open_disposable_sqlite_connection +from dimos.memory.type.observation import _UNLOADED, Observation, PoseTuple +from dimos.memory.utils.sqlite import open_disposable_sqlite_connection if TYPE_CHECKING: from collections.abc import Iterator - from dimos.memory2.type.filter import Filter, StreamQuery + from dimos.memory.type.filter import Filter, StreamQuery T = TypeVar("T") diff --git a/dimos/memory2/registry.py b/dimos/memory/registry.py similarity index 85% rename from dimos/memory2/registry.py rename to dimos/memory/registry.py index a5707a8cea..f55634cf1b 100644 --- a/dimos/memory2/registry.py +++ b/dimos/memory/registry.py @@ -27,7 +27,7 @@ def qual(cls: type) -> str: - """Fully qualified class name, e.g. 'dimos.memory2.blobstore.sqlite.SqliteBlobStore'.""" + """Fully qualified class name, e.g. 'dimos.memory.blobstore.sqlite.SqliteBlobStore'.""" return f"{cls.__module__}.{cls.__qualname__}" @@ -63,7 +63,10 @@ def get(self, name: str) -> dict[str, Any] | None: row = self._conn.execute("SELECT config FROM _streams WHERE name = ?", (name,)).fetchone() if row is None: return None - return json.loads(row[0]) # type: ignore[no-any-return] + # Recordings written before the memory2 -> memory rename persist the old + # module paths. The classes are otherwise unchanged, so remap on read — + # callers compare these strings against qual() as well as import them. + return json.loads(row[0].replace("dimos.memory2.", "dimos.memory.")) # type: ignore[no-any-return] def put(self, name: str, config: dict[str, Any]) -> None: self._conn.execute( diff --git a/dimos/memory2/replay.py b/dimos/memory/replay.py similarity index 97% rename from dimos/memory2/replay.py rename to dimos/memory/replay.py index 516d39b372..20f2a90daf 100644 --- a/dimos/memory2/replay.py +++ b/dimos/memory/replay.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Multi-stream replay over a memory2 :class:`Store` with a shared anchor. +"""Multi-stream replay over a memory :class:`Store` with a shared anchor. ``store.replay()`` returns a :class:`Replay` view. The first ``.observable()`` subscribe across all streams pins a single ``(wall_t0, replay_t0)`` anchor; @@ -34,14 +34,14 @@ from reactivex.observable import Observable from reactivex.scheduler import TimeoutScheduler -from dimos.memory2.store.base import Store, StreamAccessor +from dimos.memory.store.base import Store, StreamAccessor from dimos.protocol.service.spec import BaseConfig, Configurable from dimos.utils.data import resolve_named_path if TYPE_CHECKING: from collections.abc import Callable, Iterator - from dimos.memory2.stream import Stream + from dimos.memory.stream import Stream T = TypeVar("T") @@ -139,7 +139,7 @@ def _decode(self, obs: Any) -> T: return cast("T", data) def _base_stream(self) -> Stream[Any]: - """Memory2 Stream bounded by the replay window, ordered by ts.""" + """Memory Stream bounded by the replay window, ordered by ts.""" cfg = self._replay.config s: Stream[Any] = self._replay.store.stream(self._name) diff --git a/dimos/memory2/store/README.md b/dimos/memory/store/README.md similarity index 97% rename from dimos/memory2/store/README.md rename to dimos/memory/store/README.md index 4766c24998..80fcbb55de 100644 --- a/dimos/memory2/store/README.md +++ b/dimos/memory/store/README.md @@ -40,7 +40,7 @@ The **Backend** is the glue — on `append()` it encodes the payload, inserts me ### 1. Subclass ObservationStore ```python -from dimos.memory2.observationstore.base import ObservationStore +from dimos.memory.observationstore.base import ObservationStore class MyObservationStore(ObservationStore[T]): def __init__(self, name: str, **kwargs: Any) -> None: @@ -83,9 +83,9 @@ class MyObservationStore(ObservationStore[T]): ### 2. Create a Store subclass ```python -from dimos.memory2.backend import Backend -from dimos.memory2.codecs.base import codec_for -from dimos.memory2.store.base import Store +from dimos.memory.backend import Backend +from dimos.memory.codecs.base import codec_for +from dimos.memory.store.base import Store class MyStore(Store): def _create_backend( diff --git a/dimos/memory2/store/base.py b/dimos/memory/store/base.py similarity index 92% rename from dimos/memory2/store/base.py rename to dimos/memory/store/base.py index 7a7162a6d1..b19b2c3934 100644 --- a/dimos/memory2/store/base.py +++ b/dimos/memory/store/base.py @@ -17,19 +17,19 @@ from typing import TYPE_CHECKING, Any, Generic, Protocol, TypeVar, cast from dimos.core.resource import CompositeResource -from dimos.memory2.backend import Backend -from dimos.memory2.blobstore.base import BlobStore -from dimos.memory2.codecs.base import Codec, codec_for, codec_from_id -from dimos.memory2.notifier.base import Notifier -from dimos.memory2.notifier.subject import SubjectNotifier -from dimos.memory2.observationstore.base import ObservationStore -from dimos.memory2.observationstore.memory import ListObservationStore -from dimos.memory2.stream import Stream -from dimos.memory2.vectorstore.base import VectorStore +from dimos.memory.backend import Backend +from dimos.memory.blobstore.base import BlobStore +from dimos.memory.codecs.base import Codec, codec_for, codec_from_id +from dimos.memory.notifier.base import Notifier +from dimos.memory.notifier.subject import SubjectNotifier +from dimos.memory.observationstore.base import ObservationStore +from dimos.memory.observationstore.memory import ListObservationStore +from dimos.memory.stream import Stream +from dimos.memory.vectorstore.base import VectorStore from dimos.protocol.service.spec import BaseConfig, Configurable if TYPE_CHECKING: - from dimos.memory2.replay import Replay + from dimos.memory.replay import Replay T = TypeVar("T") S = TypeVar("S") @@ -127,7 +127,7 @@ def replay( ``replay.streams.odom.observable()`` advance together rather than each re-anchoring on their own ``first_ts``. """ - from dimos.memory2.replay import Replay + from dimos.memory.replay import Replay return Replay( store=self, diff --git a/dimos/memory2/store/mcap.py b/dimos/memory/store/mcap.py similarity index 93% rename from dimos/memory2/store/mcap.py rename to dimos/memory/store/mcap.py index 6301ca5500..26f2c04876 100644 --- a/dimos/memory2/store/mcap.py +++ b/dimos/memory/store/mcap.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Read-only memory2 store backed by an mcap file. +"""Read-only memory store backed by an mcap file. Generic and codec-injected — it knows nothing about any robot. The caller supplies ``codecs`` (DDS/wire topic -> codec that decodes a message's stored @@ -30,13 +30,13 @@ from functools import partial from typing import Any, Protocol, runtime_checkable -from dimos.memory2.backend import Backend -from dimos.memory2.codecs.base import codec_for -from dimos.memory2.notifier.subject import SubjectNotifier -from dimos.memory2.observationstore.base import ObservationStore, ObservationStoreConfig -from dimos.memory2.store.base import Store, StoreConfig -from dimos.memory2.type.filter import StreamQuery -from dimos.memory2.type.observation import Observation +from dimos.memory.backend import Backend +from dimos.memory.codecs.base import codec_for +from dimos.memory.notifier.subject import SubjectNotifier +from dimos.memory.observationstore.base import ObservationStore, ObservationStoreConfig +from dimos.memory.store.base import Store, StoreConfig +from dimos.memory.type.filter import StreamQuery +from dimos.memory.type.observation import Observation @runtime_checkable @@ -136,7 +136,7 @@ class McapStoreConfig(StoreConfig): class McapStore(Store): - """A memory2 store backed by an mcap file (read-only). + """A memory store backed by an mcap file (read-only). Every channel present in the file with a codec is exposed. Names default to the slugified topic (see :func:`_slug`); ``streams`` (friendly name -> topic) diff --git a/dimos/memory2/store/memory.py b/dimos/memory/store/memory.py similarity index 89% rename from dimos/memory2/store/memory.py rename to dimos/memory/store/memory.py index 16d25cc06b..46c065ee65 100644 --- a/dimos/memory2/store/memory.py +++ b/dimos/memory/store/memory.py @@ -14,9 +14,9 @@ from typing import Any -from dimos.memory2.backend import Backend -from dimos.memory2.observationstore.memory import ListObservationStore -from dimos.memory2.store.base import Store, StoreConfig +from dimos.memory.backend import Backend +from dimos.memory.observationstore.memory import ListObservationStore +from dimos.memory.store.base import Store, StoreConfig class MemoryStoreConfig(StoreConfig): diff --git a/dimos/memory2/store/null.py b/dimos/memory/store/null.py similarity index 94% rename from dimos/memory2/store/null.py rename to dimos/memory/store/null.py index 71f02c4aee..d1568854ed 100644 --- a/dimos/memory2/store/null.py +++ b/dimos/memory/store/null.py @@ -14,7 +14,7 @@ from typing import Any -from dimos.memory2.store.memory import MemoryStore +from dimos.memory.store.memory import MemoryStore class NullStore(MemoryStore): diff --git a/dimos/memory2/store/sqlite.py b/dimos/memory/store/sqlite.py similarity index 90% rename from dimos/memory2/store/sqlite.py rename to dimos/memory/store/sqlite.py index 8afab3a714..784b0a0ac3 100644 --- a/dimos/memory2/store/sqlite.py +++ b/dimos/memory/store/sqlite.py @@ -20,17 +20,17 @@ from pydantic import BeforeValidator -from dimos.memory2.backend import Backend -from dimos.memory2.blobstore.base import BlobStore -from dimos.memory2.blobstore.sqlite import SqliteBlobStore -from dimos.memory2.codecs.base import codec_id -from dimos.memory2.observationstore.sqlite import SqliteObservationStore -from dimos.memory2.registry import RegistryStore, deserialize_component, qual -from dimos.memory2.store.base import Store, StoreConfig -from dimos.memory2.utils.sqlite import open_disposable_sqlite_connection -from dimos.memory2.utils.validation import validate_identifier -from dimos.memory2.vectorstore.base import VectorStore -from dimos.memory2.vectorstore.sqlite import SqliteVectorStore +from dimos.memory.backend import Backend +from dimos.memory.blobstore.base import BlobStore +from dimos.memory.blobstore.sqlite import SqliteBlobStore +from dimos.memory.codecs.base import codec_id +from dimos.memory.observationstore.sqlite import SqliteObservationStore +from dimos.memory.registry import RegistryStore, deserialize_component, qual +from dimos.memory.store.base import Store, StoreConfig +from dimos.memory.utils.sqlite import open_disposable_sqlite_connection +from dimos.memory.utils.validation import validate_identifier +from dimos.memory.vectorstore.base import VectorStore +from dimos.memory.vectorstore.sqlite import SqliteVectorStore class SqliteStoreConfig(StoreConfig): @@ -69,7 +69,7 @@ def _open_connection(self) -> sqlite3.Connection: def _assemble_backend(self, name: str, stored: dict[str, Any]) -> Backend[Any]: """Reconstruct a Backend from a stored config dict.""" - from dimos.memory2.codecs.base import codec_from_id, resolve_payload_type + from dimos.memory.codecs.base import codec_from_id, resolve_payload_type payload_module = stored["payload_module"] codec = codec_from_id(stored["codec_id"], payload_module) @@ -104,7 +104,7 @@ def _assemble_backend(self, name: str, stored: dict[str, Any]) -> Backend[Any]: if notifier_data is not None: notifier = deserialize_component(notifier_data) else: - from dimos.memory2.notifier.subject import SubjectNotifier + from dimos.memory.notifier.subject import SubjectNotifier notifier = SubjectNotifier() diff --git a/dimos/memory2/store/test_null.py b/dimos/memory/store/test_null.py similarity index 97% rename from dimos/memory2/store/test_null.py rename to dimos/memory/store/test_null.py index 8e1e0a5780..e58709362e 100644 --- a/dimos/memory2/store/test_null.py +++ b/dimos/memory/store/test_null.py @@ -16,7 +16,7 @@ from __future__ import annotations -from dimos.memory2.store.null import NullStore +from dimos.memory.store.null import NullStore def test_max_size_zero_monotonic_ids() -> None: diff --git a/dimos/memory2/stream.py b/dimos/memory/stream.py similarity index 98% rename from dimos/memory2/stream.py rename to dimos/memory/stream.py index 1ed4651398..afa1119455 100644 --- a/dimos/memory2/stream.py +++ b/dimos/memory/stream.py @@ -26,10 +26,10 @@ from typing_extensions import TypeVar from dimos.core.resource import CompositeResource -from dimos.memory2.backend import Backend -from dimos.memory2.buffer import BackpressureBuffer, KeepLast -from dimos.memory2.transform import FnIterTransformer, FnTransformer, Transformer -from dimos.memory2.type.filter import ( +from dimos.memory.backend import Backend +from dimos.memory.buffer import BackpressureBuffer, KeepLast +from dimos.memory.transform import FnIterTransformer, FnTransformer, Transformer +from dimos.memory.type.filter import ( AfterFilter, AtFilter, BeforeFilter, @@ -40,7 +40,7 @@ TagsFilter, TimeRangeFilter, ) -from dimos.memory2.type.observation import EmbeddedObservation, Observation +from dimos.memory.type.observation import EmbeddedObservation, Observation from dimos.msgs.geometry_msgs.Vector3 import Vector3 from dimos.utils.human import human_bytes from dimos.utils.logging_config import setup_logger @@ -546,7 +546,7 @@ def materialize(self) -> Stream[T, O]: Useful when you need to iterate the same results multiple times without re-running the upstream query. """ - from dimos.memory2.store.memory import MemoryStore + from dimos.memory.store.memory import MemoryStore mem = MemoryStore() target = cast("Stream[T, O]", mem.stream("materialize")) diff --git a/dimos/memory2/streaming.md b/dimos/memory/streaming.md similarity index 100% rename from dimos/memory2/streaming.md rename to dimos/memory/streaming.md diff --git a/dimos/memory2/test_blobstore_integration.py b/dimos/memory/test_blobstore_integration.py similarity index 95% rename from dimos/memory2/test_blobstore_integration.py rename to dimos/memory/test_blobstore_integration.py index 3d081e6d74..f9c9950c6a 100644 --- a/dimos/memory2/test_blobstore_integration.py +++ b/dimos/memory/test_blobstore_integration.py @@ -21,9 +21,9 @@ import numpy as np import pytest -from dimos.memory2.blobstore.file import FileBlobStore -from dimos.memory2.store.memory import MemoryStore -from dimos.memory2.type.observation import _UNLOADED +from dimos.memory.blobstore.file import FileBlobStore +from dimos.memory.store.memory import MemoryStore +from dimos.memory.type.observation import _UNLOADED from dimos.models.embedding.base import Embedding if TYPE_CHECKING: @@ -117,7 +117,7 @@ def test_no_blobstore_unchanged(self) -> None: assert obs.data == "inline" def test_blobstore_with_vector_search(self, bs: FileBlobStore) -> None: - from dimos.memory2.vectorstore.memory import MemoryVectorStore + from dimos.memory.vectorstore.memory import MemoryVectorStore vs = MemoryVectorStore() with MemoryStore(blob_store=bs, vector_store=vs) as store: diff --git a/dimos/memory2/test_buffer.py b/dimos/memory/test_buffer.py similarity index 96% rename from dimos/memory2/test_buffer.py rename to dimos/memory/test_buffer.py index f851a6fcee..33235890e1 100644 --- a/dimos/memory2/test_buffer.py +++ b/dimos/memory/test_buffer.py @@ -21,7 +21,7 @@ import pytest -from dimos.memory2.buffer import Bounded, ClosedError, DropNew, KeepLast, Unbounded +from dimos.memory.buffer import Bounded, ClosedError, DropNew, KeepLast, Unbounded class TestBackpressureBuffers: diff --git a/dimos/memory2/test_e2e_processing.py b/dimos/memory/test_e2e_processing.py similarity index 100% rename from dimos/memory2/test_e2e_processing.py rename to dimos/memory/test_e2e_processing.py diff --git a/dimos/memory2/test_embedding.py b/dimos/memory/test_embedding.py similarity index 93% rename from dimos/memory2/test_embedding.py rename to dimos/memory/test_embedding.py index caa1080ffd..f1f33ccee5 100644 --- a/dimos/memory2/test_embedding.py +++ b/dimos/memory/test_embedding.py @@ -19,7 +19,7 @@ import numpy as np import pytest -from dimos.memory2.type.observation import EmbeddedObservation, Observation +from dimos.memory.type.observation import EmbeddedObservation, Observation from dimos.models.embedding.base import Embedding @@ -241,7 +241,7 @@ def embed_text(self, *texts): class TestEmbedTransformers: def test_embed_images_produces_embedded_observations(self, memory_store) -> None: - from dimos.memory2.embed import EmbedImages + from dimos.memory.embed import EmbedImages model = _MockEmbeddingModel() s = memory_store.stream("imgs", str) @@ -256,7 +256,7 @@ def test_embed_images_produces_embedded_observations(self, memory_store) -> None assert obs.embedding.to_numpy().shape == (8,) def test_embed_text_produces_embedded_observations(self, memory_store) -> None: - from dimos.memory2.embed import EmbedText + from dimos.memory.embed import EmbedText model = _MockEmbeddingModel() s = memory_store.stream("logs", str) @@ -270,7 +270,7 @@ def test_embed_text_produces_embedded_observations(self, memory_store) -> None: assert isinstance(obs.embedding, Embedding) def test_embed_preserves_data(self, memory_store) -> None: - from dimos.memory2.embed import EmbedText + from dimos.memory.embed import EmbedText model = _MockEmbeddingModel() s = memory_store.stream("logs", str) @@ -280,7 +280,7 @@ def test_embed_preserves_data(self, memory_store) -> None: assert result.data == "hello" def test_embed_then_search(self, memory_store) -> None: - from dimos.memory2.embed import EmbedText + from dimos.memory.embed import EmbedText model = _MockEmbeddingModel() s = memory_store.stream("logs", str) @@ -297,7 +297,7 @@ def test_embed_then_search(self, memory_store) -> None: assert results[0].similarity > 0.99 def test_embed_batching(self, memory_store) -> None: - from dimos.memory2.embed import EmbedText + from dimos.memory.embed import EmbedText call_sizes: list[int] = [] @@ -320,8 +320,8 @@ class TestPluggableVectorStore: """Verify that injecting a VectorStore via store config actually delegates search.""" def test_append_stores_in_vector_store(self) -> None: - from dimos.memory2.store.memory import MemoryStore - from dimos.memory2.vectorstore.memory import MemoryVectorStore + from dimos.memory.store.memory import MemoryStore + from dimos.memory.vectorstore.memory import MemoryVectorStore vs = MemoryVectorStore() with MemoryStore(vector_store=vs) as store: @@ -332,8 +332,8 @@ def test_append_stores_in_vector_store(self) -> None: assert len(vs._vectors["vecs"]) == 2 def test_append_without_embedding_skips_vector_store(self) -> None: - from dimos.memory2.store.memory import MemoryStore - from dimos.memory2.vectorstore.memory import MemoryVectorStore + from dimos.memory.store.memory import MemoryStore + from dimos.memory.vectorstore.memory import MemoryVectorStore vs = MemoryVectorStore() with MemoryStore(vector_store=vs) as store: @@ -343,8 +343,8 @@ def test_append_without_embedding_skips_vector_store(self) -> None: assert "plain" not in vs._vectors def test_search_uses_vector_store(self) -> None: - from dimos.memory2.store.memory import MemoryStore - from dimos.memory2.vectorstore.memory import MemoryVectorStore + from dimos.memory.store.memory import MemoryStore + from dimos.memory.vectorstore.memory import MemoryVectorStore vs = MemoryVectorStore() with MemoryStore(vector_store=vs) as store: @@ -361,8 +361,8 @@ def test_search_uses_vector_store(self) -> None: assert results[0].similarity > 0.99 def test_search_with_filters_via_vector_store(self) -> None: - from dimos.memory2.store.memory import MemoryStore - from dimos.memory2.vectorstore.memory import MemoryVectorStore + from dimos.memory.store.memory import MemoryStore + from dimos.memory.vectorstore.memory import MemoryVectorStore vs = MemoryVectorStore() with MemoryStore(vector_store=vs) as store: @@ -376,8 +376,8 @@ def test_search_with_filters_via_vector_store(self) -> None: assert results[0].data == "late" def test_per_stream_vector_store_override(self) -> None: - from dimos.memory2.store.memory import MemoryStore - from dimos.memory2.vectorstore.memory import MemoryVectorStore + from dimos.memory.store.memory import MemoryStore + from dimos.memory.vectorstore.memory import MemoryVectorStore vs_default = MemoryVectorStore() vs_override = MemoryVectorStore() diff --git a/dimos/memory2/test_materialize.py b/dimos/memory/test_materialize.py similarity index 87% rename from dimos/memory2/test_materialize.py rename to dimos/memory/test_materialize.py index 7d8a3178fb..dfa6533e39 100644 --- a/dimos/memory2/test_materialize.py +++ b/dimos/memory/test_materialize.py @@ -12,11 +12,11 @@ # See the License for the specific language governing permissions and # limitations under the License. -from dimos.memory2.backend import Backend -from dimos.memory2.codecs.pickle import PickleCodec -from dimos.memory2.observationstore.memory import ListObservationStore -from dimos.memory2.stream import Stream -from dimos.memory2.type.observation import Observation +from dimos.memory.backend import Backend +from dimos.memory.codecs.pickle import PickleCodec +from dimos.memory.observationstore.memory import ListObservationStore +from dimos.memory.stream import Stream +from dimos.memory.type.observation import Observation def make_stream(n: int = 5, start_ts: float = 0.0) -> Stream[int]: diff --git a/dimos/memory2/test_module.py b/dimos/memory/test_module.py similarity index 93% rename from dimos/memory2/test_module.py rename to dimos/memory/test_module.py index eb3e2d6c54..6c076e2b19 100644 --- a/dimos/memory2/test_module.py +++ b/dimos/memory/test_module.py @@ -22,10 +22,10 @@ from dimos.core.module import ModuleConfig from dimos.core.stream import In, Out -from dimos.memory2.module import StreamModule -from dimos.memory2.stream import Stream -from dimos.memory2.transform import Transformer -from dimos.memory2.type.observation import Observation +from dimos.memory.module import StreamModule +from dimos.memory.stream import Stream +from dimos.memory.transform import Transformer +from dimos.memory.type.observation import Observation # -- Shared transformer --------------------------------------------------- diff --git a/dimos/memory2/test_registry.py b/dimos/memory/test_registry.py similarity index 81% rename from dimos/memory2/test_registry.py rename to dimos/memory/test_registry.py index dc085da123..5b9037ba56 100644 --- a/dimos/memory2/test_registry.py +++ b/dimos/memory/test_registry.py @@ -16,36 +16,38 @@ from __future__ import annotations +import sqlite3 + import pytest -from dimos.memory2.blobstore.file import FileBlobStore -from dimos.memory2.blobstore.sqlite import SqliteBlobStore, SqliteBlobStoreConfig -from dimos.memory2.notifier.subject import SubjectNotifier -from dimos.memory2.observationstore.sqlite import SqliteObservationStoreConfig -from dimos.memory2.registry import RegistryStore, deserialize_component, qual -from dimos.memory2.store.sqlite import SqliteStore -from dimos.memory2.vectorstore.sqlite import SqliteVectorStore, SqliteVectorStoreConfig +from dimos.memory.blobstore.file import FileBlobStore +from dimos.memory.blobstore.sqlite import SqliteBlobStore, SqliteBlobStoreConfig +from dimos.memory.notifier.subject import SubjectNotifier +from dimos.memory.observationstore.sqlite import SqliteObservationStoreConfig +from dimos.memory.registry import RegistryStore, deserialize_component, qual +from dimos.memory.store.sqlite import SqliteStore +from dimos.memory.vectorstore.sqlite import SqliteVectorStore, SqliteVectorStoreConfig class TestQual: def test_qual_blob_store(self) -> None: - assert qual(SqliteBlobStore) == "dimos.memory2.blobstore.sqlite.SqliteBlobStore" + assert qual(SqliteBlobStore) == "dimos.memory.blobstore.sqlite.SqliteBlobStore" def test_qual_file_blob_store(self) -> None: - assert qual(FileBlobStore) == "dimos.memory2.blobstore.file.FileBlobStore" + assert qual(FileBlobStore) == "dimos.memory.blobstore.file.FileBlobStore" def test_qual_vector_store(self) -> None: - assert qual(SqliteVectorStore) == "dimos.memory2.vectorstore.sqlite.SqliteVectorStore" + assert qual(SqliteVectorStore) == "dimos.memory.vectorstore.sqlite.SqliteVectorStore" def test_qual_notifier(self) -> None: - assert qual(SubjectNotifier) == "dimos.memory2.notifier.subject.SubjectNotifier" + assert qual(SubjectNotifier) == "dimos.memory.notifier.subject.SubjectNotifier" @pytest.mark.skipif_macos @pytest.mark.skipif_aarch64 class TestRegistryStore: def test_put_get_round_trip(self, tmp_path) -> None: - from dimos.memory2.utils.sqlite import open_sqlite_connection + from dimos.memory.utils.sqlite import open_sqlite_connection conn = open_sqlite_connection(str(tmp_path / "reg.db")) reg = RegistryStore(conn=conn) @@ -57,7 +59,7 @@ def test_put_get_round_trip(self, tmp_path) -> None: conn.close() def test_get_missing(self, tmp_path) -> None: - from dimos.memory2.utils.sqlite import open_sqlite_connection + from dimos.memory.utils.sqlite import open_sqlite_connection conn = open_sqlite_connection(str(tmp_path / "reg.db")) reg = RegistryStore(conn=conn) @@ -65,7 +67,7 @@ def test_get_missing(self, tmp_path) -> None: conn.close() def test_list_streams(self, tmp_path) -> None: - from dimos.memory2.utils.sqlite import open_sqlite_connection + from dimos.memory.utils.sqlite import open_sqlite_connection conn = open_sqlite_connection(str(tmp_path / "reg.db")) reg = RegistryStore(conn=conn) @@ -75,7 +77,7 @@ def test_list_streams(self, tmp_path) -> None: conn.close() def test_delete(self, tmp_path) -> None: - from dimos.memory2.utils.sqlite import open_sqlite_connection + from dimos.memory.utils.sqlite import open_sqlite_connection conn = open_sqlite_connection(str(tmp_path / "reg.db")) reg = RegistryStore(conn=conn) @@ -85,7 +87,7 @@ def test_delete(self, tmp_path) -> None: conn.close() def test_upsert(self, tmp_path) -> None: - from dimos.memory2.utils.sqlite import open_sqlite_connection + from dimos.memory.utils.sqlite import open_sqlite_connection conn = open_sqlite_connection(str(tmp_path / "reg.db")) reg = RegistryStore(conn=conn) @@ -153,12 +155,30 @@ def test_deserialize_component(self, tmp_path) -> None: restored = deserialize_component(data) assert isinstance(restored, FileBlobStore) + def test_reopen_recording_with_legacy_memory2_paths(self, tmp_path) -> None: + """Recordings predating the memory2 -> memory rename still open.""" + db = str(tmp_path / "legacy.db") + with SqliteStore(path=db) as store: + store.stream("data", str).append("hello", ts=1.0) + + conn = sqlite3.connect(db) + for name, cfg in conn.execute("SELECT name, config FROM _streams").fetchall(): + conn.execute( + "UPDATE _streams SET config = ? WHERE name = ?", + (cfg.replace("dimos.memory.", "dimos.memory2."), name), + ) + conn.commit() + conn.close() + + with SqliteStore(path=db) as store2: + assert store2.stream("data").first().data == "hello" + class TestBackendSerialization: def test_backend_serialize(self, tmp_path) -> None: - from dimos.memory2.backend import Backend - from dimos.memory2.codecs.pickle import PickleCodec - from dimos.memory2.observationstore.memory import ListObservationStore + from dimos.memory.backend import Backend + from dimos.memory.codecs.pickle import PickleCodec + from dimos.memory.observationstore.memory import ListObservationStore backend = Backend( metadata_store=ListObservationStore(name="test"), diff --git a/dimos/memory2/test_replay.py b/dimos/memory/test_replay.py similarity index 97% rename from dimos/memory2/test_replay.py rename to dimos/memory/test_replay.py index 54f7af604f..9e4a6c0337 100644 --- a/dimos/memory2/test_replay.py +++ b/dimos/memory/test_replay.py @@ -18,11 +18,11 @@ import pytest -from dimos.memory2.replay import ReplayStream -from dimos.memory2.store.base import StreamAccessor +from dimos.memory.replay import ReplayStream +from dimos.memory.store.base import StreamAccessor if TYPE_CHECKING: - from dimos.memory2.store.sqlite import SqliteStore + from dimos.memory.store.sqlite import SqliteStore def _populate(store: SqliteStore, name: str, timestamps: list[float]) -> None: diff --git a/dimos/memory2/test_save.py b/dimos/memory/test_save.py similarity index 92% rename from dimos/memory2/test_save.py rename to dimos/memory/test_save.py index ec4d627fc3..bb47bf13f3 100644 --- a/dimos/memory2/test_save.py +++ b/dimos/memory/test_save.py @@ -18,13 +18,13 @@ import pytest -from dimos.memory2.backend import Backend -from dimos.memory2.codecs.pickle import PickleCodec -from dimos.memory2.notifier.base import Notifier -from dimos.memory2.observationstore.memory import ListObservationStore -from dimos.memory2.stream import Stream -from dimos.memory2.transform import FnTransformer -from dimos.memory2.type.observation import Observation +from dimos.memory.backend import Backend +from dimos.memory.codecs.pickle import PickleCodec +from dimos.memory.notifier.base import Notifier +from dimos.memory.observationstore.memory import ListObservationStore +from dimos.memory.stream import Stream +from dimos.memory.transform import FnTransformer +from dimos.memory.type.observation import Observation def _make_backend(name: str = "test") -> Backend[int]: diff --git a/dimos/memory2/test_store.py b/dimos/memory/test_store.py similarity index 94% rename from dimos/memory2/test_store.py rename to dimos/memory/test_store.py index 912992a710..525bd3566b 100644 --- a/dimos/memory2/test_store.py +++ b/dimos/memory/test_store.py @@ -25,14 +25,14 @@ import pytest -from dimos.memory2.backend import Backend -from dimos.memory2.blobstore.base import BlobStore -from dimos.memory2.vectorstore.base import VectorStore +from dimos.memory.backend import Backend +from dimos.memory.blobstore.base import BlobStore +from dimos.memory.vectorstore.base import VectorStore _SKIP_SQLITE_VEC = platform.machine() == "aarch64" or platform.system() == "Darwin" if TYPE_CHECKING: - from dimos.memory2.store.base import Store + from dimos.memory.store.base import Store class TestStoreBasic: @@ -162,7 +162,7 @@ def test_same_stream_on_repeated_calls(self, session: Store) -> None: def test_append_with_embedding(self, session: Store) -> None: import numpy as np - from dimos.memory2.type.observation import EmbeddedObservation + from dimos.memory.type.observation import EmbeddedObservation from dimos.models.embedding.base import Embedding s = session.stream("vectors", str) @@ -212,7 +212,7 @@ class TestBlobLoading: def test_sqlite_lazy_by_default(self, sqlite_store: Store) -> None: """Default sqlite iteration uses lazy loaders — data is _UNLOADED until accessed.""" - from dimos.memory2.type.observation import _Unloaded + from dimos.memory.type.observation import _Unloaded s = sqlite_store.stream("lazy_test", str) s.append("hello", ts=1.0) @@ -230,7 +230,7 @@ def test_sqlite_lazy_by_default(self, sqlite_store: Store) -> None: def test_sqlite_eager_loads_inline(self, sqlite_store: Store) -> None: """With eager_blobs=True, data is loaded via JOIN — no lazy loader.""" - from dimos.memory2.type.observation import _Unloaded + from dimos.memory.type.observation import _Unloaded s = sqlite_store.stream("eager_test", str, eager_blobs=True) s.append("hello", ts=1.0) @@ -261,9 +261,9 @@ def test_sqlite_lazy_and_eager_same_values(self, sqlite_store: Store) -> None: def test_memory_lazy_with_blobstore(self, tmp_path) -> None: """MemoryStore with a BlobStore uses lazy loaders.""" - from dimos.memory2.blobstore.file import FileBlobStore - from dimos.memory2.store.memory import MemoryStore - from dimos.memory2.type.observation import _Unloaded + from dimos.memory.blobstore.file import FileBlobStore + from dimos.memory.store.memory import MemoryStore + from dimos.memory.type.observation import _Unloaded bs = FileBlobStore(root=str(tmp_path / "blobs")) bs.start() @@ -339,7 +339,7 @@ def delete(self, stream: str, key: int) -> None: @pytest.fixture def memory_spy_session(): - from dimos.memory2.store.memory import MemoryStore + from dimos.memory.store.memory import MemoryStore blob_spy = SpyBlobStore() vec_spy = SpyVectorStore() @@ -351,7 +351,7 @@ def memory_spy_session(): def sqlite_spy_session(tmp_path): if _SKIP_SQLITE_VEC: pytest.skip("sqlite-vec extension not loadable here") - from dimos.memory2.store.sqlite import SqliteStore + from dimos.memory.store.sqlite import SqliteStore blob_spy = SpyBlobStore() vec_spy = SpyVectorStore() @@ -431,10 +431,10 @@ class TestStandaloneComponents: """Verify each SQLite component works standalone with path= (no Store needed).""" def test_observation_store_standalone(self, tmp_path) -> None: - from dimos.memory2.codecs.base import codec_for - from dimos.memory2.observationstore.sqlite import SqliteObservationStore - from dimos.memory2.type.filter import StreamQuery - from dimos.memory2.type.observation import Observation + from dimos.memory.codecs.base import codec_for + from dimos.memory.observationstore.sqlite import SqliteObservationStore + from dimos.memory.type.filter import StreamQuery + from dimos.memory.type.observation import Observation db = str(tmp_path / "obs.db") codec = codec_for(str) @@ -449,7 +449,7 @@ def test_observation_store_standalone(self, tmp_path) -> None: assert results[0].ts == 1.0 def test_blob_store_standalone(self, tmp_path) -> None: - from dimos.memory2.blobstore.sqlite import SqliteBlobStore + from dimos.memory.blobstore.sqlite import SqliteBlobStore db = str(tmp_path / "blob.db") with SqliteBlobStore(path=db) as store: @@ -461,7 +461,7 @@ def test_blob_store_standalone(self, tmp_path) -> None: def test_vector_store_standalone(self, tmp_path) -> None: import numpy as np - from dimos.memory2.vectorstore.sqlite import SqliteVectorStore + from dimos.memory.vectorstore.sqlite import SqliteVectorStore from dimos.models.embedding.base import Embedding db = str(tmp_path / "vec.db") @@ -478,9 +478,9 @@ def test_vector_store_standalone(self, tmp_path) -> None: def test_conn_and_path_mutually_exclusive(self, tmp_path) -> None: import sqlite3 - from dimos.memory2.blobstore.sqlite import SqliteBlobStore - from dimos.memory2.observationstore.sqlite import SqliteObservationStore - from dimos.memory2.vectorstore.sqlite import SqliteVectorStore + from dimos.memory.blobstore.sqlite import SqliteBlobStore + from dimos.memory.observationstore.sqlite import SqliteObservationStore + from dimos.memory.vectorstore.sqlite import SqliteVectorStore conn = sqlite3.connect(":memory:") db = str(tmp_path / "test.db") diff --git a/dimos/memory2/test_stream.py b/dimos/memory/test_stream.py similarity index 99% rename from dimos/memory2/test_stream.py rename to dimos/memory/test_stream.py index eaee853930..633c0284ad 100644 --- a/dimos/memory2/test_stream.py +++ b/dimos/memory/test_stream.py @@ -25,11 +25,11 @@ import pytest -from dimos.memory2.buffer import KeepLast, Unbounded -from dimos.memory2.store.memory import MemoryStore -from dimos.memory2.stream import Stream -from dimos.memory2.transform import FnTransformer, QualityWindow, Transformer -from dimos.memory2.type.observation import Observation +from dimos.memory.buffer import KeepLast, Unbounded +from dimos.memory.store.memory import MemoryStore +from dimos.memory.stream import Stream +from dimos.memory.transform import FnTransformer, QualityWindow, Transformer +from dimos.memory.type.observation import Observation if TYPE_CHECKING: from collections.abc import Callable diff --git a/dimos/memory2/test_voxel_map.py b/dimos/memory/test_voxel_map.py similarity index 98% rename from dimos/memory2/test_voxel_map.py rename to dimos/memory/test_voxel_map.py index ce58b98a16..ae9adc3bfc 100644 --- a/dimos/memory2/test_voxel_map.py +++ b/dimos/memory/test_voxel_map.py @@ -17,7 +17,7 @@ import numpy as np from dimos.mapping.voxels.module import VoxelMapTransformer -from dimos.memory2.type.observation import Observation +from dimos.memory.type.observation import Observation from dimos.msgs.sensor_msgs.PointCloud2 import PointCloud2 diff --git a/dimos/memory2/tf.py b/dimos/memory/tf.py similarity index 98% rename from dimos/memory2/tf.py rename to dimos/memory/tf.py index 27806dddf2..bb006409d4 100644 --- a/dimos/memory2/tf.py +++ b/dimos/memory/tf.py @@ -19,7 +19,7 @@ import math from typing import TYPE_CHECKING, Any, cast -from dimos.memory2.stream import Stream +from dimos.memory.stream import Stream from dimos.msgs.tf2_msgs.TFMessage import TFMessage from dimos.protocol.tf.tf import MultiTBuffer diff --git a/dimos/memory2/tool_e2e.py b/dimos/memory/tool_e2e.py similarity index 96% rename from dimos/memory2/tool_e2e.py rename to dimos/memory/tool_e2e.py index b79b051f6c..a3d3ffa676 100644 --- a/dimos/memory2/tool_e2e.py +++ b/dimos/memory/tool_e2e.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""E2E test: import legacy pickle replays into memory2 SqliteStore.""" +"""E2E test: import legacy pickle replays into memory SqliteStore.""" from __future__ import annotations @@ -21,9 +21,9 @@ import pytest -from dimos.memory2.embed import EmbedImages -from dimos.memory2.store.sqlite import SqliteStore -from dimos.memory2.transform import QualityWindow +from dimos.memory.embed import EmbedImages +from dimos.memory.store.sqlite import SqliteStore +from dimos.memory.transform import QualityWindow from dimos.models.embedding.clip import CLIPModel from dimos.msgs.sensor_msgs.Image import Image from dimos.msgs.sensor_msgs.PointCloud2 import PointCloud2 @@ -88,9 +88,9 @@ def lidar_replay() -> LegacyPickleStore[PointCloud2]: class TestImportReplay: - """Import legacy pickle replay data into a memory2 SqliteStore. + """Import legacy pickle replay data into a memory SqliteStore. - Lidar/odom are trimmed to start at video's first ts. The Memory2ReplayAdapter + Lidar/odom are trimmed to start at video's first ts. The MemoryReplayAdapter scheduler anchors each stream to its own first_ts on subscribe, so aligning first_ts across streams keeps replay synchronized. """ @@ -266,7 +266,7 @@ def test_order_by_desc(self, session: SqliteStore) -> None: def test_lazy_data_loads_correctly(self, session: SqliteStore) -> None: """Verify lazy blob loading returns valid Image data.""" - from dimos.memory2.type.observation import _Unloaded + from dimos.memory.type.observation import _Unloaded video = session.stream("color_image", Image) obs = next(iter(video.limit(1))) diff --git a/dimos/memory2/tool_module.py b/dimos/memory/tool_module.py similarity index 95% rename from dimos/memory2/tool_module.py rename to dimos/memory/tool_module.py index dbde0cfe02..32006e9f93 100644 --- a/dimos/memory2/tool_module.py +++ b/dimos/memory/tool_module.py @@ -26,8 +26,8 @@ from reactivex.scheduler import ThreadPoolScheduler from dimos.core.transport import pLCMTransport -from dimos.memory2.module import StreamModule -from dimos.memory2.test_module import module_cases +from dimos.memory.module import StreamModule +from dimos.memory.test_module import module_cases def _reset_thread_pool() -> None: diff --git a/dimos/memory2/tool_visualizer.py b/dimos/memory/tool_visualizer.py similarity index 98% rename from dimos/memory2/tool_visualizer.py rename to dimos/memory/tool_visualizer.py index 204b472926..399abb7121 100644 --- a/dimos/memory2/tool_visualizer.py +++ b/dimos/memory/tool_visualizer.py @@ -21,8 +21,8 @@ import pytest -from dimos.memory2.store.sqlite import SqliteStore -from dimos.memory2.transform import Batch, QualityWindow +from dimos.memory.store.sqlite import SqliteStore +from dimos.memory.transform import Batch, QualityWindow from dimos.models.embedding.clip import CLIPModel from dimos.models.vl.florence import Florence2Model from dimos.models.vl.moondream import MoondreamVlModel diff --git a/dimos/memory2/tool_voxel_map.py b/dimos/memory/tool_voxel_map.py similarity index 97% rename from dimos/memory2/tool_voxel_map.py rename to dimos/memory/tool_voxel_map.py index 70f7a778ac..90b992be10 100644 --- a/dimos/memory2/tool_voxel_map.py +++ b/dimos/memory/tool_voxel_map.py @@ -20,7 +20,7 @@ import pytest from dimos.mapping.voxels.module import VoxelMapTransformer -from dimos.memory2.store.sqlite import SqliteStore +from dimos.memory.store.sqlite import SqliteStore from dimos.msgs.sensor_msgs.PointCloud2 import PointCloud2 from dimos.utils.data import get_data diff --git a/dimos/memory2/transform.py b/dimos/memory/transform.py similarity index 99% rename from dimos/memory2/transform.py rename to dimos/memory/transform.py index 328c1de647..2f23ec7859 100644 --- a/dimos/memory2/transform.py +++ b/dimos/memory/transform.py @@ -21,13 +21,13 @@ import time from typing import TYPE_CHECKING, Any, Generic, Literal, TypeVar, cast -from dimos.memory2.utils.formatting import FilterRepr +from dimos.memory.utils.formatting import FilterRepr if TYPE_CHECKING: from collections.abc import Callable, Iterator, Sequence - from dimos.memory2.stream import Stream - from dimos.memory2.type.observation import Observation + from dimos.memory.stream import Stream + from dimos.memory.type.observation import Observation T = TypeVar("T") R = TypeVar("R") diff --git a/dimos/memory2/type/filter.py b/dimos/memory/type/filter.py similarity index 98% rename from dimos/memory2/type/filter.py rename to dimos/memory/type/filter.py index 1250c4c31f..37229571f5 100644 --- a/dimos/memory2/type/filter.py +++ b/dimos/memory/type/filter.py @@ -24,8 +24,8 @@ if TYPE_CHECKING: from collections.abc import Callable, Iterator - from dimos.memory2.buffer import BackpressureBuffer - from dimos.memory2.type.observation import Observation + from dimos.memory.buffer import BackpressureBuffer + from dimos.memory.type.observation import Observation from dimos.models.embedding.base import Embedding diff --git a/dimos/memory2/type/observation.py b/dimos/memory/type/observation.py similarity index 100% rename from dimos/memory2/type/observation.py rename to dimos/memory/type/observation.py diff --git a/dimos/memory2/utils/formatting.py b/dimos/memory/utils/formatting.py similarity index 100% rename from dimos/memory2/utils/formatting.py rename to dimos/memory/utils/formatting.py diff --git a/dimos/memory2/utils/progress.py b/dimos/memory/utils/progress.py similarity index 98% rename from dimos/memory2/utils/progress.py rename to dimos/memory/utils/progress.py index 05f1256ac1..5e05f0cf5a 100644 --- a/dimos/memory2/utils/progress.py +++ b/dimos/memory/utils/progress.py @@ -35,7 +35,7 @@ if TYPE_CHECKING: from collections.abc import Iterator - from dimos.memory2.type.observation import Observation + from dimos.memory.type.observation import Observation _REFRESH_S = 0.1 # refresh cap; keeps 200 Hz streams from redrawing per frame diff --git a/dimos/memory2/utils/sqlite.py b/dimos/memory/utils/sqlite.py similarity index 100% rename from dimos/memory2/utils/sqlite.py rename to dimos/memory/utils/sqlite.py diff --git a/dimos/memory2/utils/test_progress.py b/dimos/memory/utils/test_progress.py similarity index 95% rename from dimos/memory2/utils/test_progress.py rename to dimos/memory/utils/test_progress.py index 309ca71408..78fa6b4a97 100644 --- a/dimos/memory2/utils/test_progress.py +++ b/dimos/memory/utils/test_progress.py @@ -18,8 +18,8 @@ import pytest -from dimos.memory2.type.observation import Observation -from dimos.memory2.utils.progress import progress +from dimos.memory.type.observation import Observation +from dimos.memory.utils.progress import progress def _obs(ts: float) -> Observation[None]: diff --git a/dimos/memory2/utils/validation.py b/dimos/memory/utils/validation.py similarity index 100% rename from dimos/memory2/utils/validation.py rename to dimos/memory/utils/validation.py diff --git a/dimos/memory2/vectorstore/base.py b/dimos/memory/vectorstore/base.py similarity index 98% rename from dimos/memory2/vectorstore/base.py rename to dimos/memory/vectorstore/base.py index d76daaa5be..d546cb2a36 100644 --- a/dimos/memory2/vectorstore/base.py +++ b/dimos/memory/vectorstore/base.py @@ -18,7 +18,7 @@ from typing import TYPE_CHECKING, Any from dimos.core.resource import CompositeResource -from dimos.memory2.registry import qual +from dimos.memory.registry import qual from dimos.protocol.service.spec import BaseConfig, Configurable if TYPE_CHECKING: diff --git a/dimos/memory2/vectorstore/memory.py b/dimos/memory/vectorstore/memory.py similarity index 96% rename from dimos/memory2/vectorstore/memory.py rename to dimos/memory/vectorstore/memory.py index 5d3d5c5d6b..3269110854 100644 --- a/dimos/memory2/vectorstore/memory.py +++ b/dimos/memory/vectorstore/memory.py @@ -16,7 +16,7 @@ from typing import TYPE_CHECKING, Any -from dimos.memory2.vectorstore.base import VectorStore, VectorStoreConfig +from dimos.memory.vectorstore.base import VectorStore, VectorStoreConfig if TYPE_CHECKING: from dimos.models.embedding.base import Embedding diff --git a/dimos/memory2/vectorstore/sqlite.py b/dimos/memory/vectorstore/sqlite.py similarity index 95% rename from dimos/memory2/vectorstore/sqlite.py rename to dimos/memory/vectorstore/sqlite.py index bb5e9d200e..36e51fc563 100644 --- a/dimos/memory2/vectorstore/sqlite.py +++ b/dimos/memory/vectorstore/sqlite.py @@ -20,9 +20,9 @@ from pydantic import Field, model_validator -from dimos.memory2.utils.sqlite import open_disposable_sqlite_connection -from dimos.memory2.utils.validation import validate_identifier -from dimos.memory2.vectorstore.base import VectorStore, VectorStoreConfig +from dimos.memory.utils.sqlite import open_disposable_sqlite_connection +from dimos.memory.utils.validation import validate_identifier +from dimos.memory.vectorstore.base import VectorStore, VectorStoreConfig if TYPE_CHECKING: from dimos.models.embedding.base import Embedding diff --git a/dimos/memory2/vis/color.py b/dimos/memory/vis/color.py similarity index 99% rename from dimos/memory2/vis/color.py rename to dimos/memory/vis/color.py index c1897f4ccf..b4781ff851 100644 --- a/dimos/memory2/vis/color.py +++ b/dimos/memory/vis/color.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Color type and utilities for memory2 visualization. +"""Color type and utilities for memory visualization. Canonical storage is RGBA float 0-1 (matplotlib-native, easy to blend). All consumers convert at the boundary: diff --git a/dimos/memory2/vis/plot/elements.py b/dimos/memory/vis/plot/elements.py similarity index 100% rename from dimos/memory2/vis/plot/elements.py rename to dimos/memory/vis/plot/elements.py diff --git a/dimos/memory2/vis/plot/plot.py b/dimos/memory/vis/plot/plot.py similarity index 89% rename from dimos/memory2/vis/plot/plot.py rename to dimos/memory/vis/plot/plot.py index 082b147125..08a6d4a5f0 100644 --- a/dimos/memory2/vis/plot/plot.py +++ b/dimos/memory/vis/plot/plot.py @@ -12,14 +12,14 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Plot: 2D chart builder for memory2 visualization.""" +"""Plot: 2D chart builder for memory visualization.""" from __future__ import annotations from enum import Enum from typing import Any -from dimos.memory2.vis.plot.elements import HLine, Markers, PlotElement, Series, VLine +from dimos.memory.vis.plot.elements import HLine, Markers, PlotElement, Series, VLine class TimeAxis(str, Enum): @@ -50,8 +50,8 @@ def __init__(self, time_axis: TimeAxis = TimeAxis.relative) -> None: def add(self, element: Any, **kwargs: Any) -> Plot: """Add a plot element with smart dispatch.""" - from dimos.memory2.stream import Stream - from dimos.memory2.type.observation import Observation + from dimos.memory.stream import Stream + from dimos.memory.type.observation import Observation if isinstance(element, (Series, Markers, HLine, VLine)): self._elements.append(element) @@ -82,8 +82,8 @@ def _add_from_observations(self, obs_list: list[Any], **kwargs: Any) -> None: def to_svg(self, path: str | None = None) -> str: """Render to SVG string. Optionally write to file.""" - from dimos.memory2.vis.color import resolve_deferred - from dimos.memory2.vis.plot.svg import render + from dimos.memory.vis.color import resolve_deferred + from dimos.memory.vis.plot.svg import render resolve_deferred(self._elements) svg = render(self) @@ -94,8 +94,8 @@ def to_svg(self, path: str | None = None) -> str: def to_rerun(self, app_id: str = "plot", spawn: bool = True) -> None: """Render to Rerun viewer (placeholder — currently a no-op).""" - from dimos.memory2.vis.color import resolve_deferred - from dimos.memory2.vis.plot.rerun import render + from dimos.memory.vis.color import resolve_deferred + from dimos.memory.vis.plot.rerun import render resolve_deferred(self._elements) render(self, app_id=app_id, spawn=spawn) diff --git a/dimos/memory2/vis/plot/rerun.py b/dimos/memory/vis/plot/rerun.py similarity index 94% rename from dimos/memory2/vis/plot/rerun.py rename to dimos/memory/vis/plot/rerun.py index e5ce9365ab..2a013a7f9d 100644 --- a/dimos/memory2/vis/plot/rerun.py +++ b/dimos/memory/vis/plot/rerun.py @@ -19,7 +19,7 @@ from typing import TYPE_CHECKING if TYPE_CHECKING: - from dimos.memory2.vis.plot.plot import Plot + from dimos.memory.vis.plot.plot import Plot def render(plot: Plot, app_id: str = "plot", spawn: bool = True) -> None: diff --git a/dimos/memory2/vis/plot/svg.py b/dimos/memory/vis/plot/svg.py similarity index 97% rename from dimos/memory2/vis/plot/svg.py rename to dimos/memory/vis/plot/svg.py index 206596b05a..ad40a0c100 100644 --- a/dimos/memory2/vis/plot/svg.py +++ b/dimos/memory/vis/plot/svg.py @@ -22,12 +22,12 @@ import matplotlib import matplotlib.pyplot as plt -from dimos.memory2.vis.color import Color, palette_iter -from dimos.memory2.vis.plot.elements import HLine, Markers, Series, VLine -from dimos.memory2.vis.plot.plot import TimeAxis +from dimos.memory.vis.color import Color, palette_iter +from dimos.memory.vis.plot.elements import HLine, Markers, Series, VLine +from dimos.memory.vis.plot.plot import TimeAxis if TYPE_CHECKING: - from dimos.memory2.vis.plot.plot import Plot + from dimos.memory.vis.plot.plot import Plot matplotlib.use("Agg") diff --git a/dimos/memory2/vis/plot/test_plot.py b/dimos/memory/vis/plot/test_plot.py similarity index 94% rename from dimos/memory2/vis/plot/test_plot.py rename to dimos/memory/vis/plot/test_plot.py index 12cb979c5a..0de5ffdae9 100644 --- a/dimos/memory2/vis/plot/test_plot.py +++ b/dimos/memory/vis/plot/test_plot.py @@ -18,9 +18,9 @@ import pytest -from dimos.memory2.type.observation import Observation -from dimos.memory2.vis.plot.elements import HLine, Markers, Series, Style, VLine -from dimos.memory2.vis.plot.plot import Plot, TimeAxis +from dimos.memory.type.observation import Observation +from dimos.memory.vis.plot.elements import HLine, Markers, Series, Style, VLine +from dimos.memory.vis.plot.plot import Plot, TimeAxis class TestPlotAdd: @@ -168,7 +168,7 @@ def test_series_dotted_style_renders_as_dotted(self): def test_series_connect_breaks_on_gap(self): # Three samples at t=0, 1, 5. Gap 0→1 is 1s (kept), gap 1→5 is 4s # (broken). The renderer should produce SVG without crashing. - from dimos.memory2.vis.plot.svg import _break_on_gaps + from dimos.memory.vis.plot.svg import _break_on_gaps ts, values = _break_on_gaps([0.0, 1.0, 5.0], [10.0, 20.0, 30.0], 2.0) # The 4s gap should have inserted a NaN between samples 1 and 5. @@ -185,7 +185,7 @@ def test_series_connect_breaks_on_gap(self): assert " tuple[int, int, int, int]: diff --git a/dimos/memory2/vis/space/space.py b/dimos/memory/vis/space/space.py similarity index 95% rename from dimos/memory2/vis/space/space.py rename to dimos/memory/vis/space/space.py index cf7d8be0b3..65afe7d0ef 100644 --- a/dimos/memory2/vis/space/space.py +++ b/dimos/memory/vis/space/space.py @@ -23,9 +23,9 @@ from typing import Any -from dimos.memory2.type.observation import EmbeddedObservation, Observation -from dimos.memory2.vis.color import ColorRange, resolve_deferred -from dimos.memory2.vis.space.elements import ( +from dimos.memory.type.observation import EmbeddedObservation, Observation +from dimos.memory.vis.color import ColorRange, resolve_deferred +from dimos.memory.vis.space.elements import ( Arrow, Box3D, Camera, @@ -153,7 +153,7 @@ def base_map(self, grid: OccupancyGrid) -> Space: def to_svg(self, path: str | None = None) -> str: """Render to SVG string. Optionally write to file.""" - from dimos.memory2.vis.space.svg import render + from dimos.memory.vis.space.svg import render resolve_deferred(self._elements) svg = render(self) @@ -164,7 +164,7 @@ def to_svg(self, path: str | None = None) -> str: def to_rerun(self, app_id: str = "space", spawn: bool = True) -> None: """Render to Rerun viewer.""" - from dimos.memory2.vis.space.rerun import render + from dimos.memory.vis.space.rerun import render resolve_deferred(self._elements) render(self, app_id=app_id, spawn=spawn) diff --git a/dimos/memory2/vis/space/svg.py b/dimos/memory/vis/space/svg.py similarity index 98% rename from dimos/memory2/vis/space/svg.py rename to dimos/memory/vis/space/svg.py index f95119973b..2f7644a537 100644 --- a/dimos/memory2/vis/space/svg.py +++ b/dimos/memory/vis/space/svg.py @@ -32,9 +32,9 @@ from PIL import Image as PILImage from dimos.mapping.occupancy.visualizations import generate_rgba_texture -from dimos.memory2.type.observation import Observation -from dimos.memory2.vis.color import Color -from dimos.memory2.vis.space.elements import ( +from dimos.memory.type.observation import Observation +from dimos.memory.vis.color import Color +from dimos.memory.vis.space.elements import ( Arrow, Box3D, Camera, @@ -48,7 +48,7 @@ from dimos.msgs.sensor_msgs.PointCloud2 import PointCloud2 if TYPE_CHECKING: - from dimos.memory2.vis.space.space import Space + from dimos.memory.vis.space.space import Space @dataclass diff --git a/dimos/memory2/vis/space/test_space.py b/dimos/memory/vis/space/test_space.py similarity index 96% rename from dimos/memory2/vis/space/test_space.py rename to dimos/memory/vis/space/test_space.py index 5ae86af443..8f09e0e21e 100644 --- a/dimos/memory2/vis/space/test_space.py +++ b/dimos/memory/vis/space/test_space.py @@ -17,9 +17,9 @@ import numpy as np import pytest -from dimos.memory2.type.observation import EmbeddedObservation, Observation -from dimos.memory2.vis.space.elements import Arrow, Box3D, Camera, Point, Polyline, Pose, Text -from dimos.memory2.vis.space.space import Space +from dimos.memory.type.observation import EmbeddedObservation, Observation +from dimos.memory.vis.space.elements import Arrow, Box3D, Camera, Point, Polyline, Pose, Text +from dimos.memory.vis.space.space import Space from dimos.msgs.geometry_msgs.Point import Point as GeoPoint from dimos.msgs.geometry_msgs.PoseStamped import PoseStamped from dimos.msgs.nav_msgs.OccupancyGrid import OccupancyGrid @@ -255,7 +255,7 @@ def test_empty_space(self): assert svg.endswith("") def test_point_renders_circle(self): - from dimos.memory2.vis import color + from dimos.memory.vis import color s = Space() s.add(Point(GeoPoint(3, 4, 0), color="red", label="hi")) @@ -265,7 +265,7 @@ def test_point_renders_circle(self): assert "hi" in svg def test_pose_renders_polygon(self): - from dimos.memory2.vis import color + from dimos.memory.vis import color s = Space() s.add(Pose(PoseStamped(1, 2, 0), color="blue")) @@ -274,7 +274,7 @@ def test_pose_renders_polygon(self): assert color.blue.hex() in svg def test_arrow_renders_polygon(self): - from dimos.memory2.vis import color + from dimos.memory.vis import color s = Space() s.add(Arrow(PoseStamped(0, 0, 0, 0, 0, 0.38, 0.92), color="orange")) @@ -311,7 +311,7 @@ def test_text_renders(self): assert "hello <world>" in svg def test_camera_without_info_renders_dot(self): - from dimos.memory2.vis import color + from dimos.memory.vis import color s = Space() s.add(Camera(pose=PoseStamped(1, 2, 0), color="purple")) diff --git a/dimos/memory2/vis/utils.py b/dimos/memory/vis/utils.py similarity index 97% rename from dimos/memory2/vis/utils.py rename to dimos/memory/vis/utils.py index f1db33daa2..443b371c5d 100644 --- a/dimos/memory2/vis/utils.py +++ b/dimos/memory/vis/utils.py @@ -20,7 +20,7 @@ import numpy as np -from dimos.memory2.type.observation import EmbeddedObservation, Observation +from dimos.memory.type.observation import EmbeddedObservation, Observation from dimos.msgs.sensor_msgs.Image import Image, ImageFormat from dimos.perception.detection.type.detection2d.base import Detection2D from dimos.perception.detection.type.detection2d.imageDetections2D import ImageDetections2D diff --git a/dimos/navigation/cmu_nav/modules/nav_record/nav_record.py b/dimos/navigation/cmu_nav/modules/nav_record/nav_record.py index e7a6db4870..a655d09158 100644 --- a/dimos/navigation/cmu_nav/modules/nav_record/nav_record.py +++ b/dimos/navigation/cmu_nav/modules/nav_record/nav_record.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""NavRecord: records all nav stack streams to a memory2 SQLite database.""" +"""NavRecord: records all nav stack streams to a memory SQLite database.""" from __future__ import annotations @@ -20,7 +20,7 @@ from dimos.core.core import rpc from dimos.core.stream import In -from dimos.memory2.module import Recorder, RecorderConfig +from dimos.memory.module import Recorder, RecorderConfig from dimos.msgs.geometry_msgs.PointStamped import PointStamped from dimos.msgs.geometry_msgs.Twist import Twist from dimos.msgs.nav_msgs.Odometry import Odometry @@ -35,7 +35,7 @@ class NavRecordConfig(RecorderConfig): class NavRecord(Recorder): - """Records nav stack outputs to SQLite via memory2 (only connected streams are recorded).""" + """Records nav stack outputs to SQLite via memory (only connected streams are recorded).""" config: NavRecordConfig diff --git a/dimos/navigation/nav_3d/mls_planner/test_transformer.py b/dimos/navigation/nav_3d/mls_planner/test_transformer.py index 2cd84e03bb..6513de5020 100644 --- a/dimos/navigation/nav_3d/mls_planner/test_transformer.py +++ b/dimos/navigation/nav_3d/mls_planner/test_transformer.py @@ -20,7 +20,7 @@ pytest.importorskip("dimos_mls_planner") -from dimos.memory2.type.observation import Observation +from dimos.memory.type.observation import Observation from dimos.msgs.sensor_msgs.PointCloud2 import PointCloud2 from dimos.navigation.nav_3d.mls_planner.transformer import MLSPlan diff --git a/dimos/navigation/nav_3d/mls_planner/transformer.py b/dimos/navigation/nav_3d/mls_planner/transformer.py index 1a52f1b183..411f24752a 100644 --- a/dimos/navigation/nav_3d/mls_planner/transformer.py +++ b/dimos/navigation/nav_3d/mls_planner/transformer.py @@ -17,7 +17,7 @@ import time from typing import TYPE_CHECKING, Any -from dimos.memory2.transform import Transformer +from dimos.memory.transform import Transformer from dimos.msgs.geometry_msgs.PoseStamped import PoseStamped from dimos.msgs.nav_msgs.Path import Path from dimos.msgs.sensor_msgs.PointCloud2 import PointCloud2 @@ -30,7 +30,7 @@ import numpy as np from numpy.typing import NDArray - from dimos.memory2.type.observation import Observation + from dimos.memory.type.observation import Observation logger = setup_logger() diff --git a/dimos/navigation/nav_3d/mls_planner/utils/plan_rrd.py b/dimos/navigation/nav_3d/mls_planner/utils/plan_rrd.py index ffea4626b9..396ffc93e7 100644 --- a/dimos/navigation/nav_3d/mls_planner/utils/plan_rrd.py +++ b/dimos/navigation/nav_3d/mls_planner/utils/plan_rrd.py @@ -28,10 +28,10 @@ import typer from dimos.mapping.ray_tracing.transformer import RayTraceMap -from dimos.memory2.store.sqlite import SqliteStore -from dimos.memory2.tf import StreamTF -from dimos.memory2.transform import FnTransformer -from dimos.memory2.type.observation import Observation +from dimos.memory.store.sqlite import SqliteStore +from dimos.memory.tf import StreamTF +from dimos.memory.transform import FnTransformer +from dimos.memory.type.observation import Observation from dimos.msgs.geometry_msgs.Quaternion import Quaternion from dimos.msgs.geometry_msgs.Transform import Transform from dimos.msgs.geometry_msgs.Vector3 import Vector3 diff --git a/dimos/perception/detection/project.py b/dimos/perception/detection/project.py index f664eac92a..0ea57730bf 100644 --- a/dimos/perception/detection/project.py +++ b/dimos/perception/detection/project.py @@ -20,7 +20,7 @@ import numpy as np -from dimos.memory2.transform import Transformer +from dimos.memory.transform import Transformer from dimos.msgs.geometry_msgs.Transform import Transform from dimos.perception.detection.type.detection3d.imageDetections3DPC import ImageDetections3DPC @@ -29,7 +29,7 @@ from dimos_lcm.sensor_msgs import CameraInfo - from dimos.memory2.type.observation import Observation + from dimos.memory.type.observation import Observation from dimos.msgs.sensor_msgs.Image import Image from dimos.msgs.sensor_msgs.PointCloud2 import PointCloud2 from dimos.perception.detection.type.detection2d.imageDetections2D import ImageDetections2D diff --git a/dimos/perception/fiducial/marker_detection_stream_module.py b/dimos/perception/fiducial/marker_detection_stream_module.py index efe118a0e3..e200326c75 100644 --- a/dimos/perception/fiducial/marker_detection_stream_module.py +++ b/dimos/perception/fiducial/marker_detection_stream_module.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Live marker detection as a memory2 StreamModule. +"""Live marker detection as a memory StreamModule. The module keeps the same transform chain used by offline marker tooling: quality-gated images, optional motion gating, marker fan-out, then one @@ -30,10 +30,10 @@ from dimos.core.core import rpc from dimos.core.module import Module, ModuleConfig from dimos.core.stream import In, Out -from dimos.memory2.module import StreamModule, stream_to_port -from dimos.memory2.store.null import NullStore -from dimos.memory2.stream import Stream -from dimos.memory2.transform import QualityWindow, SpeedLimit +from dimos.memory.module import StreamModule, stream_to_port +from dimos.memory.store.null import NullStore +from dimos.memory.stream import Stream +from dimos.memory.transform import QualityWindow, SpeedLimit from dimos.msgs.sensor_msgs.CameraInfo import CameraInfo from dimos.msgs.sensor_msgs.Image import Image from dimos.msgs.tf2_msgs.TFMessage import TFMessage diff --git a/dimos/perception/fiducial/marker_transformer.py b/dimos/perception/fiducial/marker_transformer.py index 16243102de..0a0f7bfd03 100644 --- a/dimos/perception/fiducial/marker_transformer.py +++ b/dimos/perception/fiducial/marker_transformer.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""ArUco / AprilTag detection as memory2 transforms. +"""ArUco / AprilTag detection as memory transforms. Wraps :func:`dimos.perception.fiducial.marker_detect.detect_markers_in_image` and emits one :class:`Detection3DMarker` observation per detected marker, with @@ -36,7 +36,7 @@ import numpy as np -from dimos.memory2.transform import Transformer +from dimos.memory.transform import Transformer from dimos.msgs.geometry_msgs.Quaternion import Quaternion from dimos.msgs.geometry_msgs.Transform import Transform from dimos.msgs.geometry_msgs.Vector3 import Vector3 @@ -59,7 +59,7 @@ if TYPE_CHECKING: from collections.abc import Iterator - from dimos.memory2.type.observation import Observation + from dimos.memory.type.observation import Observation logger = setup_logger() diff --git a/dimos/perception/fiducial/test_marker_detection_stream_module.py b/dimos/perception/fiducial/test_marker_detection_stream_module.py index 746c027da6..59779c5fc2 100644 --- a/dimos/perception/fiducial/test_marker_detection_stream_module.py +++ b/dimos/perception/fiducial/test_marker_detection_stream_module.py @@ -19,8 +19,8 @@ import numpy as np import pytest -from dimos.memory2.store.memory import MemoryStore -from dimos.memory2.type.observation import Observation +from dimos.memory.store.memory import MemoryStore +from dimos.memory.type.observation import Observation from dimos.msgs.geometry_msgs.Quaternion import Quaternion from dimos.msgs.geometry_msgs.Transform import Transform from dimos.msgs.geometry_msgs.Vector3 import Vector3 diff --git a/dimos/perception/fiducial/test_marker_transformer.py b/dimos/perception/fiducial/test_marker_transformer.py index 6697e67efb..16830e3556 100644 --- a/dimos/perception/fiducial/test_marker_transformer.py +++ b/dimos/perception/fiducial/test_marker_transformer.py @@ -15,7 +15,7 @@ import numpy as np import pytest -from dimos.memory2.type.observation import Observation +from dimos.memory.type.observation import Observation from dimos.msgs.sensor_msgs.CameraInfo import CameraInfo from dimos.msgs.sensor_msgs.Image import Image, ImageFormat from dimos.perception.fiducial.marker_detect import detect_markers_in_image diff --git a/dimos/perception/memory/tool_localize.py b/dimos/perception/memory/tool_localize.py index 15e1bec6a2..8f7de3050b 100644 --- a/dimos/perception/memory/tool_localize.py +++ b/dimos/perception/memory/tool_localize.py @@ -23,11 +23,11 @@ import numpy as np -from dimos.memory2.embed import EmbedImages -from dimos.memory2.store.sqlite import SqliteStore -from dimos.memory2.tf import StreamTF -from dimos.memory2.transform import throttle -from dimos.memory2.utils.progress import progress +from dimos.memory.embed import EmbedImages +from dimos.memory.store.sqlite import SqliteStore +from dimos.memory.tf import StreamTF +from dimos.memory.transform import throttle +from dimos.memory.utils.progress import progress from dimos.models.embedding.clip import CLIPModel from dimos.models.segmentation.edge_tam import EdgeTAMImageSegmenter from dimos.models.vl.moondream import MoondreamVlModel @@ -39,7 +39,7 @@ parser = argparse.ArgumentParser(description=__doc__) parser.add_argument("query", nargs="?", default="plant") parser.add_argument("out", nargs="?", default="localize.rrd") -parser.add_argument("--dataset", type=Path, help="memory2 recording database") +parser.add_argument("--dataset", type=Path, help="memory recording database") parser.add_argument( "--from", dest="start", type=float, default=0.0, help="start offset into the recording (s)" ) diff --git a/dimos/protocol/tf/test_tf.py b/dimos/protocol/tf/test_tf.py index 59b329cf2b..b44d99c1f1 100644 --- a/dimos/protocol/tf/test_tf.py +++ b/dimos/protocol/tf/test_tf.py @@ -21,9 +21,9 @@ import pytest from dimos.core.transport_factory import make_transport -from dimos.memory2.store.memory import MemoryStore -from dimos.memory2.store.sqlite import SqliteStore -from dimos.memory2.tf import StreamTF +from dimos.memory.store.memory import MemoryStore +from dimos.memory.store.sqlite import SqliteStore +from dimos.memory.tf import StreamTF from dimos.msgs.geometry_msgs.PoseStamped import PoseStamped from dimos.msgs.geometry_msgs.Quaternion import Quaternion from dimos.msgs.geometry_msgs.Transform import Transform @@ -640,7 +640,7 @@ def _t(parent: str, child: str, x: float, ts: float) -> Transform: "live", "stream_memory", # sqlite-vec ships a 32-bit binary in the aarch64 wheel and fails to - # load on macOS CI (same guard as memory2/conftest.py). + # load on macOS CI (same guard as memory/conftest.py). pytest.param("stream_sqlite", marks=[pytest.mark.skipif_aarch64, pytest.mark.skipif_macos]), ] ) diff --git a/dimos/protocol/tf/tf.py b/dimos/protocol/tf/tf.py index 2b0309e52e..4ddafbd050 100644 --- a/dimos/protocol/tf/tf.py +++ b/dimos/protocol/tf/tf.py @@ -38,7 +38,7 @@ class TFLookup(Protocol): """Read side of a tf buffer: resolve ``parent ← child`` at a time point. Satisfied by the live buffers (:class:`MultiTBuffer`, :class:`TF`) and by - replay backends like ``dimos.memory2.tf.StreamTF``. Code that only queries + replay backends like ``dimos.memory.tf.StreamTF``. Code that only queries transforms should accept this instead of a concrete implementation. """ diff --git a/dimos/robot/all_blueprints.py b/dimos/robot/all_blueprints.py index 58b941ae79..cc22e318ce 100644 --- a/dimos/robot/all_blueprints.py +++ b/dimos/robot/all_blueprints.py @@ -232,7 +232,7 @@ "marker-tf-module": "dimos.perception.fiducial.marker_tf_module.MarkerTfModule", "mcp-client": "dimos.agents.mcp.mcp_client.McpClient", "mcp-server": "dimos.agents.mcp.mcp_server.McpServer", - "memory-module": "dimos.memory2.module.MemoryModule", + "memory-module": "dimos.memory.module.MemoryModule", "mid360-pcap-recorder": "dimos.hardware.sensors.lidar.virtual_mid360.recorder.Mid360PcapRecorder", "mid360-realsense-recorder": "dimos.robot.assembly.mid360_realsense_30.Mid360RealsenseRecorder", "mid360-realsense-static-tf": "dimos.robot.assembly.mid360_realsense_30.Mid360RealsenseStaticTf", @@ -265,7 +265,7 @@ "ray-tracing-voxel-map": "dimos.mapping.ray_tracing.module.RayTracingVoxelMap", "real-sense-camera": "dimos.hardware.sensors.camera.realsense.camera.RealSenseCamera", "receiver-module": "dimos.utils.demo_image_encoding.ReceiverModule", - "recorder": "dimos.memory2.module.Recorder", + "recorder": "dimos.memory.module.Recorder", "reid-module": "dimos.perception.detection.reid.module.ReidModule", "relay-bridge-module": "dimos.web.relay_bridge.relay_bridge_module.RelayBridgeModule", "relocalization-module": "dimos.mapping.relocalization.module.RelocalizationModule", @@ -273,7 +273,7 @@ "rerun-bridge-module": "dimos.visualization.rerun.bridge.RerunBridgeModule", "rerun-web-socket-server": "dimos.visualization.rerun.websocket_server.RerunWebSocketServer", "security-module": "dimos.experimental.security_demo.security_module.SecurityModule", - "semantic-search": "dimos.memory2.module.SemanticSearch", + "semantic-search": "dimos.memory.module.SemanticSearch", "simple-phone-teleop": "dimos.teleop.phone.phone_extensions.SimplePhoneTeleop", "simple-planner": "dimos.navigation.cmu_nav.modules.simple_planner.simple_planner.SimplePlanner", "spatial-memory": "dimos.perception.experimental.spatial_perception.SpatialMemory", diff --git a/dimos/robot/assembly/mid360_realsense_30.py b/dimos/robot/assembly/mid360_realsense_30.py index bc884a04a5..3a22c6e397 100644 --- a/dimos/robot/assembly/mid360_realsense_30.py +++ b/dimos/robot/assembly/mid360_realsense_30.py @@ -15,12 +15,12 @@ """The RealSense D435i + Mid-360 rig: static mount frames, recorder, record blueprints. A single physical sensor assembly described in one place: the mount geometry published -onto tf (:class:`Mid360RealsenseStaticTf`), the memory2 recorder +onto tf (:class:`Mid360RealsenseStaticTf`), the memory recorder (:class:`Mid360RealsenseRecorder`), and the record blueprints that wire them to the live sensors. Point-LIO odom+lidar and the RealSense color/depth/pointcloud streams are recorded into -a memory2 db, with the rig's mount frames published continuously onto tf. Two variants: +a memory db, with the rig's mount frames published continuously onto tf. Two variants: ``mid360_realsense_record`` (db only) and ``mid360_realsense_record_with_pcap`` (also captures a raw .pcap of the Mid-360 UDP stream). @@ -126,7 +126,7 @@ def transforms(self) -> list[Transform]: class Mid360RealsenseRecorder(PointlioRecorder): - """Records Point-LIO odom+lidar plus the RealSense streams into a memory2 db. + """Records Point-LIO odom+lidar plus the RealSense streams into a memory db. Trajectory is baked into ``pointlio_lidar`` via the inherited ``@pose_setter_for``. The raw Livox stream is NOT recorded here — enable the pcap recorder in the record diff --git a/dimos/robot/unitree/go2/blueprints/basic/unitree_go2_mid360_record.py b/dimos/robot/unitree/go2/blueprints/basic/unitree_go2_mid360_record.py index 92b84714e6..500d0093a1 100644 --- a/dimos/robot/unitree/go2/blueprints/basic/unitree_go2_mid360_record.py +++ b/dimos/robot/unitree/go2/blueprints/basic/unitree_go2_mid360_record.py @@ -16,7 +16,7 @@ """Drive-and-record blueprint for the Go2 + Mid-360 rig. Pygame WASD teleop drives the dog while Point-LIO odom+lidar, the Go2's lidar/odom, -and the front camera are recorded into a memory2 db. The Go2/Mid-360 mount frames are +and the front camera are recorded into a memory db. The Go2/Mid-360 mount frames are published continuously onto tf so they're captured in the recording. Raw Livox capture is opt-in: set ``RECORD_PCAP=1`` to also record a .pcap of the Mid-360 UDP stream. diff --git a/dimos/robot/unitree/go2/blueprints/navigation/unitree_go2_nav_3d.py b/dimos/robot/unitree/go2/blueprints/navigation/unitree_go2_nav_3d.py index 2c03b51142..d8ca4a0f4b 100644 --- a/dimos/robot/unitree/go2/blueprints/navigation/unitree_go2_nav_3d.py +++ b/dimos/robot/unitree/go2/blueprints/navigation/unitree_go2_nav_3d.py @@ -28,7 +28,7 @@ from dimos.hardware.sensors.lidar.pointlio.recorder import PointlioRecorder from dimos.hardware.sensors.lidar.virtual_mid360.recorder import Mid360PcapRecorder from dimos.mapping.ray_tracing.module import RayTracingVoxelMap -from dimos.memory2.module import pose_setter_for +from dimos.memory.module import pose_setter_for from dimos.msgs.geometry_msgs.PoseStamped import PoseStamped from dimos.msgs.sensor_msgs.PointCloud2 import PointCloud2 from dimos.navigation.basic_path_follower.module import BasicPathFollower diff --git a/dimos/robot/unitree/go2/blueprints/smart/unitree_go2.py b/dimos/robot/unitree/go2/blueprints/smart/unitree_go2.py index 4e41e0e675..308071f16c 100644 --- a/dimos/robot/unitree/go2/blueprints/smart/unitree_go2.py +++ b/dimos/robot/unitree/go2/blueprints/smart/unitree_go2.py @@ -21,7 +21,7 @@ from dimos.mapping.costmapper import CostMapper from dimos.mapping.relocalization.module import RelocalizationModule from dimos.mapping.voxels.module import VoxelGridMapper -from dimos.memory2.module import Recorder, RecorderConfig, pose_setter_for +from dimos.memory.module import Recorder, RecorderConfig, pose_setter_for from dimos.msgs.geometry_msgs.Pose import Pose from dimos.msgs.geometry_msgs.PoseStamped import PoseStamped from dimos.msgs.sensor_msgs.Image import Image diff --git a/dimos/robot/unitree/go2/connection.py b/dimos/robot/unitree/go2/connection.py index b285273f23..71f134abc4 100644 --- a/dimos/robot/unitree/go2/connection.py +++ b/dimos/robot/unitree/go2/connection.py @@ -32,8 +32,8 @@ from dimos.core.module import Module, ModuleConfig from dimos.core.resource import CompositeResource from dimos.core.stream import In, Out -from dimos.memory2.replay import Replay, ReplayStream, resolve_db_path -from dimos.memory2.store.sqlite import SqliteStore +from dimos.memory.replay import Replay, ReplayStream, resolve_db_path +from dimos.memory.store.sqlite import SqliteStore from dimos.msgs.geometry_msgs.PoseStamped import PoseStamped from dimos.msgs.geometry_msgs.Quaternion import Quaternion from dimos.msgs.geometry_msgs.Transform import Transform diff --git a/dimos/robot/unitree/go2/dds/cli/render.py b/dimos/robot/unitree/go2/dds/cli/render.py index 5fcf2fcf37..7711e9cf0b 100644 --- a/dimos/robot/unitree/go2/dds/cli/render.py +++ b/dimos/robot/unitree/go2/dds/cli/render.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Render Go2 odom sources to rerun — memory2 store pipelines (standalone). +"""Render Go2 odom sources to rerun — memory store pipelines (standalone). Each *pipeline* is a function ``(store, seconds) -> None`` composed from reusable stream transforms over standard dimos messages. ``leg_odom`` logs both @@ -37,8 +37,8 @@ import numpy as np import typer -from dimos.memory2.transform import throttle -from dimos.memory2.utils.progress import progress +from dimos.memory.transform import throttle +from dimos.memory.utils.progress import progress from dimos.msgs.geometry_msgs.PoseStamped import PoseStamped from dimos.msgs.geometry_msgs.Transform import Transform from dimos.msgs.geometry_msgs.TwistStamped import TwistStamped @@ -51,7 +51,7 @@ if TYPE_CHECKING: from collections.abc import Iterator - from dimos.memory2.type.observation import Observation + from dimos.memory.type.observation import Observation from dimos.msgs.sensor_msgs.Image import Image from dimos.msgs.sensor_msgs.PointCloud2 import PointCloud2 diff --git a/dimos/robot/unitree/go2/dds/codec.py b/dimos/robot/unitree/go2/dds/codec.py index 0f0262b508..ed645d77e0 100644 --- a/dimos/robot/unitree/go2/dds/codec.py +++ b/dimos/robot/unitree/go2/dds/codec.py @@ -18,7 +18,7 @@ same codec decodes a recorded mcap message and a live DDS sample (both are CDR), and its ``encode`` half publishes back to the wire — so this is shared by the reader, :class:`~dimos.robot.unitree.go2.dds.store.Go2McapStore`, and (later) a live -DDS bridge. It is distinct from memory2's storage codecs (pickle/lcm/jpeg); +DDS bridge. It is distinct from memory's storage codecs (pickle/lcm/jpeg); they only coincide when an mcap is opened as a store. ``GO2_CODECS`` is the Go2 channel set — the default registry today. diff --git a/dimos/robot/unitree/go2/dds/store.py b/dimos/robot/unitree/go2/dds/store.py index aeb34615a4..0f62cd3c0c 100644 --- a/dimos/robot/unitree/go2/dds/store.py +++ b/dimos/robot/unitree/go2/dds/store.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Open a Go2 DDS mcap directly as a read-only memory2 store. +"""Open a Go2 DDS mcap directly as a read-only memory store. from dimos.robot.unitree.go2.dds.store import Go2McapStore @@ -21,7 +21,7 @@ for obs in store.streams.lidar.limit(5): print(obs.ts, obs.data) # obs.data is a dimos PointCloud2 -Thin Go2 wiring over the generic :class:`dimos.memory2.store.mcap.McapStore`: +Thin Go2 wiring over the generic :class:`dimos.memory.store.mcap.McapStore`: supplies the Go2 codec set and stream-name map, and resolves the path through the repo data dir / LFS. """ @@ -30,11 +30,11 @@ from typing import Any -from dimos.memory2.store.mcap import McapStore +from dimos.memory.store.mcap import McapStore from dimos.robot.unitree.go2.dds.codec import GO2_CODECS from dimos.utils.data import resolve_named_path -# memory2 stream name -> Go2 DDS topic. +# memory stream name -> Go2 DDS topic. STREAMS: dict[str, str] = { "lidar": "rt/utlidar/cloud", "lidar_deskewed": "rt/utlidar/cloud_deskewed", diff --git a/dimos/robot/unitree/go2/dds/test_store.py b/dimos/robot/unitree/go2/dds/test_store.py index c9cae8e388..296ca56e0a 100644 --- a/dimos/robot/unitree/go2/dds/test_store.py +++ b/dimos/robot/unitree/go2/dds/test_store.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Open a real Go2 DDS mcap as a memory2 store (LFS-backed). +"""Open a real Go2 DDS mcap as a memory store (LFS-backed). One test per message type — each prints a sample and checks the decode. """ diff --git a/dimos/robot/unitree/go2/dds/video.py b/dimos/robot/unitree/go2/dds/video.py index dfd4e9650d..6b76617367 100644 --- a/dimos/robot/unitree/go2/dds/video.py +++ b/dimos/robot/unitree/go2/dds/video.py @@ -36,12 +36,12 @@ from collections.abc import Iterator from typing import TYPE_CHECKING, Any -from dimos.memory2.transform import Transformer +from dimos.memory.transform import Transformer from dimos.msgs.sensor_msgs.Image import Image, ImageFormat from dimos.robot.unitree.go2.dds.msgs.CompressedVideo import CompressedVideo if TYPE_CHECKING: - from dimos.memory2.type.observation import Observation + from dimos.memory.type.observation import Observation class H264Decoder(Transformer[CompressedVideo, Image]): diff --git a/dimos/robot/unitree/go2/go2_mid360_recorder.py b/dimos/robot/unitree/go2/go2_mid360_recorder.py index e96f229df3..07555df81c 100644 --- a/dimos/robot/unitree/go2/go2_mid360_recorder.py +++ b/dimos/robot/unitree/go2/go2_mid360_recorder.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Records the Go2 + Mid-360 rig into a memory2 SQLite db. +"""Records the Go2 + Mid-360 rig into a memory SQLite db. Captures Point-LIO odom + lidar (trajectory baked into ``pointlio_lidar`` via the inherited ``@pose_setter_for``) plus the Go2's companion streams. The raw Livox diff --git a/dimos/teleop/utils/recorder.py b/dimos/teleop/utils/recorder.py index 820a7cca63..b1e810c2fd 100644 --- a/dimos/teleop/utils/recorder.py +++ b/dimos/teleop/utils/recorder.py @@ -27,8 +27,8 @@ from dimos.constants import STATE_DIR from dimos.core.core import rpc from dimos.core.stream import In -from dimos.memory2.module import Recorder, RecorderConfig -from dimos.memory2.store.sqlite import SqliteStore +from dimos.memory.module import Recorder, RecorderConfig +from dimos.memory.store.sqlite import SqliteStore from dimos.msgs.geometry_msgs.PoseStamped import PoseStamped from dimos.msgs.geometry_msgs.TwistStamped import TwistStamped from dimos.teleop.quest.quest_types import Buttons diff --git a/dimos/teleop/utils/report.py b/dimos/teleop/utils/report.py index fd68fbbc1a..a46f6f22a1 100644 --- a/dimos/teleop/utils/report.py +++ b/dimos/teleop/utils/report.py @@ -32,7 +32,7 @@ import numpy as np -from dimos.memory2.store.sqlite import SqliteStore +from dimos.memory.store.sqlite import SqliteStore from dimos.msgs.geometry_msgs.PoseStamped import PoseStamped from dimos.msgs.geometry_msgs.TwistStamped import TwistStamped from dimos.teleop.quest.quest_types import Buttons diff --git a/dimos/utils/testing/replay.py b/dimos/utils/testing/replay.py index d35818d735..1adf6679b0 100644 --- a/dimos/utils/testing/replay.py +++ b/dimos/utils/testing/replay.py @@ -12,16 +12,16 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Shim layer exposing the legacy ``TimedSensorReplay`` API over memory2. +"""Shim layer exposing the legacy ``TimedSensorReplay`` API over memory. -``TimedSensorReplay(name, autocast=...)`` opens the memory2 SQLite database at +``TimedSensorReplay(name, autocast=...)`` opens the memory SQLite database at ``{get_data_dir}/{dataset}.db`` and reads the named stream. ``name`` is expected to be ``"/"``. Callers that still need to read from legacy pickle dirs should import ``LegacyPickleStore`` directly from ``dimos.utils.testing.legacy_pickle``. The write-side (``TimedSensorStorage``/``SensorStorage``) still points at -``LegacyPickleStore`` — out of scope for the memory2 migration. +``LegacyPickleStore`` — out of scope for the memory migration. """ from __future__ import annotations @@ -37,7 +37,7 @@ from reactivex.observable import Observable from reactivex.scheduler import TimeoutScheduler -from dimos.memory2.store.sqlite import SqliteStore +from dimos.memory.store.sqlite import SqliteStore from dimos.utils.data import get_data from dimos.utils.testing.legacy_pickle import LegacyPickleStore @@ -175,8 +175,8 @@ def dispose() -> None: return rx.create(subscribe) -class Memory2ReplayAdapter(Generic[T]): - """Memory2-backed replacement for the legacy ``TimedSensorReplay``. +class MemoryReplayAdapter(Generic[T]): + """Memory-backed replacement for the legacy ``TimedSensorReplay``. Accepts names shaped like ``"/"`` (e.g. ``"go2_bigoffice/lidar"``). ``autocast`` is applied after the codec @@ -227,7 +227,7 @@ def iterate_ts( start_ts = start if start is not None else first_ts end = start_ts + duration - # Time-bound stream using memory2 filters. time_range is inclusive on + # Time-bound stream using memory filters. time_range is inclusive on # both sides; .after is exclusive. Use time_range with +inf for the # inclusive-start semantics legacy callers rely on. if start is not None and end is not None: @@ -285,14 +285,14 @@ def count(self) -> int: @property def files(self) -> list[Path]: - """Compat stub — memory2 has no per-frame files.""" + """Compat stub — memory has no per-frame files.""" return [] def load_one(self, name: int | str | Path) -> tuple[float, T]: """Compat stub — index-based access by offset.""" if not isinstance(name, int): raise TypeError( - f"Memory2ReplayAdapter.load_one only supports integer offsets; got {name!r}" + f"MemoryReplayAdapter.load_one only supports integer offsets; got {name!r}" ) obs = self._stream.limit(1).offset(int(name)).first() return (obs.ts, self._decode(obs)) @@ -314,7 +314,7 @@ def stream( ) -TimedSensorReplay = Memory2ReplayAdapter +TimedSensorReplay = MemoryReplayAdapter # Write-side + non-timed read-side stay on legacy pickle. SensorReplay = LegacyPickleStore diff --git a/docs/capabilities/memory/algo_comparison.md b/docs/capabilities/memory/algo_comparison.md index d2d6f38596..04955b79a2 100644 --- a/docs/capabilities/memory/algo_comparison.md +++ b/docs/capabilities/memory/algo_comparison.md @@ -4,11 +4,11 @@ Example on how we can use memory to compare two algos on a real data. ```python import time -from dimos.memory2.store.sqlite import SqliteStore -from dimos.memory2.transform import throttle -from dimos.memory2.vis import color -from dimos.memory2.vis.plot.elements import Style -from dimos.memory2.vis.plot.plot import Plot +from dimos.memory.store.sqlite import SqliteStore +from dimos.memory.transform import throttle +from dimos.memory.vis import color +from dimos.memory.vis.plot.elements import Style +from dimos.memory.vis.plot.plot import Plot from dimos.msgs.sensor_msgs.Image import Image, ImageFormat from dimos.utils.data import get_data @@ -95,11 +95,11 @@ Above example loads the same data and iterates it for each plot line, it's a bit ```python import time -from dimos.memory2.store.sqlite import SqliteStore -from dimos.memory2.transform import throttle -from dimos.memory2.vis import color -from dimos.memory2.vis.plot.elements import HLine, Series, Style -from dimos.memory2.vis.plot.plot import Plot +from dimos.memory.store.sqlite import SqliteStore +from dimos.memory.transform import throttle +from dimos.memory.vis import color +from dimos.memory.vis.plot.elements import HLine, Series, Style +from dimos.memory.vis.plot.plot import Plot from dimos.msgs.sensor_msgs.Image import Image, ImageFormat from dimos.utils.data import get_data diff --git a/docs/capabilities/memory/demo_rerun.py b/docs/capabilities/memory/demo_rerun.py index 3b0bcf5536..79db1e714b 100644 --- a/docs/capabilities/memory/demo_rerun.py +++ b/docs/capabilities/memory/demo_rerun.py @@ -17,12 +17,12 @@ from dimos.mapping.occupancy.inflation import simple_inflate from dimos.mapping.pointclouds.occupancy import general_occupancy -from dimos.memory2.store.sqlite import SqliteStore -from dimos.memory2.transform import normalize, smooth -from dimos.memory2.vis.color import Color -from dimos.memory2.vis.space.elements import Point -from dimos.memory2.vis.space.space import Space -from dimos.memory2.vis.utils import mosaic +from dimos.memory.store.sqlite import SqliteStore +from dimos.memory.transform import normalize, smooth +from dimos.memory.vis.color import Color +from dimos.memory.vis.space.elements import Point +from dimos.memory.vis.space.space import Space +from dimos.memory.vis.utils import mosaic from dimos.models.embedding.clip import CLIPModel from dimos.utils.data import get_data diff --git a/docs/capabilities/memory/index.md b/docs/capabilities/memory/index.md index 2b36c08028..e5cc1646c1 100644 --- a/docs/capabilities/memory/index.md +++ b/docs/capabilities/memory/index.md @@ -5,12 +5,12 @@ import pickle from dimos.mapping.pointclouds.occupancy import general_occupancy, simple_occupancy, height_cost_occupancy from dimos.mapping.occupancy.inflation import simple_inflate -from dimos.memory2.store.sqlite import SqliteStore -from dimos.memory2.vis.color import Color -from dimos.memory2.transform import downsample, throttle, speed, smooth -from dimos.memory2.vis.space.space import Space +from dimos.memory.store.sqlite import SqliteStore +from dimos.memory.vis.color import Color +from dimos.memory.transform import downsample, throttle, speed, smooth +from dimos.memory.vis.space.space import Space from dimos.utils.data import get_data -from dimos.memory2.vis.space.elements import Point +from dimos.memory.vis.space.elements import Point ``` @@ -92,8 +92,8 @@ So knowing above, we can create embeddings for the full stream, ```python title="Python" session=mem skip from dimos.models.embedding.clip import CLIPModel from dimos.msgs.sensor_msgs.Image import Image -from dimos.memory2.transform import QualityWindow -from dimos.memory2.embed import EmbedImages +from dimos.memory.transform import QualityWindow +from dimos.memory.embed import EmbedImages embedded = store.stream("color_image_embedded", Image) clip = CLIPModel() diff --git a/docs/capabilities/memory/plot.md b/docs/capabilities/memory/plot.md index 2ee2a3fd82..caae4de586 100644 --- a/docs/capabilities/memory/plot.md +++ b/docs/capabilities/memory/plot.md @@ -7,8 +7,8 @@ You add streams, system auto assigns colors import math import random -from dimos.memory2.vis.plot.elements import Series -from dimos.memory2.vis.plot.plot import Plot +from dimos.memory.vis.plot.elements import Series +from dimos.memory.vis.plot.plot import Plot rng = random.Random(42) xs = [i * 0.1 for i in range(120)] @@ -33,8 +33,8 @@ the named colors, the auto-cycle excludes it for the remaining series, so you never end up with two lines that share a color by accident. ```python session=plot output=none -from dimos.memory2.vis import color -from dimos.memory2.vis.plot.elements import Series, HLine, Style +from dimos.memory.vis import color +from dimos.memory.vis.plot.elements import Series, HLine, Style p = Plot() # auto → blue @@ -55,11 +55,11 @@ p.to_svg("assets/plot_named.svg") you can assign different axes to different time series, label them etc ```python session=robotdata output=none -from dimos.memory2.store.sqlite import SqliteStore -from dimos.memory2.transform import smooth, speed, throttle -from dimos.memory2.vis import color -from dimos.memory2.vis.plot.elements import Series -from dimos.memory2.vis.plot.plot import Plot +from dimos.memory.store.sqlite import SqliteStore +from dimos.memory.transform import smooth, speed, throttle +from dimos.memory.vis import color +from dimos.memory.vis.plot.elements import Series +from dimos.memory.vis.plot.plot import Plot from dimos.utils.data import get_data store = SqliteStore(path=get_data("go2_bigoffice.db")) @@ -95,9 +95,9 @@ plot.to_svg("assets/plot_robot_data.svg") Let's find some plants! ```python session=robotdata -from dimos.memory2.vis.plot.elements import Series, HLine, Style -from dimos.memory2.vis import color -from dimos.memory2.transform import normalize, smooth_time +from dimos.memory.vis.plot.elements import Series, HLine, Style +from dimos.memory.vis import color +from dimos.memory.transform import normalize, smooth_time from dimos.models.embedding.clip import CLIPModel clip = CLIPModel() @@ -200,12 +200,12 @@ Let's auto-detect the peaks, extract images from those moments, and run a 2D det ```python skip session=robotdata from dimos.mapping.voxels.module import VoxelMapTransformer -from dimos.memory2.vis.space.space import Space -from dimos.memory2.transform import peaks -from dimos.memory2.vis.color import ColorRange -from dimos.memory2.vis.plot.elements import VLine -from dimos.memory2.vis.utils import mosaic -from dimos.memory2.stream import Stream +from dimos.memory.vis.space.space import Space +from dimos.memory.transform import peaks +from dimos.memory.vis.color import ColorRange +from dimos.memory.vis.plot.elements import VLine +from dimos.memory.vis.utils import mosaic +from dimos.memory.stream import Stream from itertools import chain semantic_peaks = plantness_query_materialized.transform(peaks(key=lambda obs: obs.similarity, distance=1.0)) @@ -274,7 +274,7 @@ We got 15 peaks back, we ran a detector on all of them so we can start projectin Once we put the surviving peaks on the timeline we get two very obvious plants. ```python skip session=robotdata -from dimos.memory2.transform import significant +from dimos.memory.transform import significant plot = Plot() plot.add( @@ -308,8 +308,8 @@ We'll also pull all lidar frames in their vicinity and reconstruct global maps f ```python skip session=robotdata -from dimos.memory2.vis.space.elements import Point -from dimos.memory2.transform import QualityWindow +from dimos.memory.vis.space.elements import Point +from dimos.memory.transform import QualityWindow drawing = Space() @@ -361,7 +361,7 @@ from dimos.robot.unitree.go2.connection import ( _camera_info_static as go2_camerainfo, BASE_TO_OPTICAL, ) -from dimos.memory2.vis.space.elements import Box3D +from dimos.memory.vis.space.elements import Box3D from dimos.msgs.geometry_msgs.Pose import Pose from dimos.msgs.geometry_msgs.Transform import Transform from dimos.msgs.geometry_msgs.Vector3 import Vector3 diff --git a/docs/capabilities/navigation/relocalization.md b/docs/capabilities/navigation/relocalization.md index d3820805f9..f325402b9b 100644 --- a/docs/capabilities/navigation/relocalization.md +++ b/docs/capabilities/navigation/relocalization.md @@ -163,7 +163,7 @@ Note that [`CostMapper`](/dimos/mapping/costmapper.py) builds the costmap from t | File | Format | Produced by | Consumed by | |------|--------|-------------|-------------| -| `{name}.db` | memory2 SQLite (`lidar`, `odom`, `color_image`, …) | `unitree-go2-memory` | `dimos map *`, `--replay-db` | +| `{name}.db` | memory SQLite (`lidar`, `odom`, `color_image`, …) | `unitree-go2-memory` | `dimos map *`, `--replay-db` | | `{name}.pc2.lcm` | LCM-encoded `PointCloud2` premap | `dimos map global --export` | `RelocalizationModule` (`map_file`) | | `{name}.rrd` | Rerun recording (visual QA) | `dimos map global` | Rerun viewer | diff --git a/docs/coding-agents/style.md b/docs/coding-agents/style.md index 6581fa60db..7f7222c844 100644 --- a/docs/coding-agents/style.md +++ b/docs/coding-agents/style.md @@ -41,13 +41,13 @@ something/ Never add imports to `__init__.py` files. Re-exporting from `__init__.py` makes imports too wide and slow — importing one symbol pulls in the entire package tree. ```python skip -# BAD — dimos/memory2/__init__.py -from dimos.memory2.store import Store, SqliteStore -from dimos.memory2.stream import Stream +# BAD — dimos/memory/__init__.py +from dimos.memory.store import Store, SqliteStore +from dimos.memory.stream import Stream ``` ```python # GOOD — import directly from the module -from dimos.memory2.store.base import Store -from dimos.memory2.stream import Stream +from dimos.memory.store.base import Store +from dimos.memory.stream import Stream ``` diff --git a/docs/coding-agents/testing.md b/docs/coding-agents/testing.md index 4969838585..a0d451e715 100644 --- a/docs/coding-agents/testing.md +++ b/docs/coding-agents/testing.md @@ -68,7 +68,7 @@ import tempfile import pytest -from dimos.memory2.store.sqlite import SqliteStore +from dimos.memory.store.sqlite import SqliteStore from dimos.msgs.sensor_msgs.Image import Image diff --git a/docs/usage/cli.md b/docs/usage/cli.md index 9f57380290..2dd7583349 100644 --- a/docs/usage/cli.md +++ b/docs/usage/cli.md @@ -18,7 +18,7 @@ dimos [GLOBAL OPTIONS] COMMAND [ARGS] | `--robot-ips` | TEXT | `None` | Multiple robot IPs | | `--simulation` / `--no-simulation` | bool | `False` | Enable MuJoCo simulation | | `--replay` / `--no-replay` | bool | `False` | Use recorded replay data | -| `--replay-db` | TEXT | `go2_bigoffice` | Replay memory2 SQLite database name | +| `--replay-db` | TEXT | `go2_bigoffice` | Replay memory SQLite database name | | `--new-memory` / `--no-new-memory` | bool | `False` | Clear persistent memory on start | | `--viewer` | `rerun\|none` | `rerun` | Visualization backend | | `--rerun-open` | `native\|web\|both\|none` | `native` | How to open the Rerun viewer | diff --git a/experimental/docs/nav/map_recording/pointlio_pcap_to_db.md b/experimental/docs/nav/map_recording/pointlio_pcap_to_db.md index 62302d17dd..5172691b06 100644 --- a/experimental/docs/nav/map_recording/pointlio_pcap_to_db.md +++ b/experimental/docs/nav/map_recording/pointlio_pcap_to_db.md @@ -38,7 +38,7 @@ dimos map global --lidar pointlio_lidar --pgo-tol=0 --no-carve | Flag | Default | Meaning | |------|---------|---------| | `--pcap` | *(required)* | Livox Mid-360 pcap (a missing path is fetched via `get_data`) | -| `--db` | `.db` | Target memory2 db. Existing → append/align; missing → built from scratch (or fetched via `get_data`) | +| `--db` | `.db` | Target memory db. Existing → append/align; missing → built from scratch (or fetched via `get_data`) | | `--rate` | `1.0` | Replay-speed multiplier | | `--odom-freq` | `30.0` | Point-LIO odometry rate (Hz) | | `--max-sensor-sec` | `0` (whole pcap) | Stop after N sensor seconds |