personal memory agent
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remove pre-streams path fallbacks

Remove the dead two-level agents markdown formatter pattern that no longer matches migrated journals.

Rename segment_dir to agents_dir in muse/entities.py to match what the variable actually holds.

Update the activity_state output-path docstring to include the stream level, require stream in load_previous_state, _list_facets_with_activity_state, and _load_activity_state, and remove the old day_path fallback branches and unused import.

+16 -36
+6 -19
muse/activities.py
··· 44 44 logger = logging.getLogger(__name__) 45 45 46 46 47 - def _list_facets_with_activity_state( 48 - day: str, segment: str, stream: str | None = None 49 - ) -> list[str]: 47 + def _list_facets_with_activity_state(day: str, segment: str, stream: str) -> list[str]: 50 48 """Find all facets that have activity_state.json in a segment.""" 51 - if stream: 52 - agents_dir = segment_path(day, segment, stream) / "agents" 53 - else: 54 - agents_dir = day_path(day) / segment / "agents" 49 + agents_dir = segment_path(day, segment, stream) / "agents" 55 50 if not agents_dir.is_dir(): 56 51 return [] 57 52 ··· 63 58 return facets 64 59 65 60 66 - def _load_activity_state( 67 - day: str, segment: str, facet: str, stream: str | None = None 68 - ) -> list[dict]: 61 + def _load_activity_state(day: str, segment: str, facet: str, stream: str) -> list[dict]: 69 62 """Load activity_state.json for a facet in a segment. Returns [] on failure.""" 70 - if stream: 71 - state_path = ( 72 - segment_path(day, segment, stream) 73 - / "agents" 74 - / facet 75 - / "activity_state.json" 76 - ) 77 - else: 78 - state_path = day_path(day) / segment / "agents" / facet / "activity_state.json" 63 + state_path = ( 64 + segment_path(day, segment, stream) / "agents" / facet / "activity_state.json" 65 + ) 79 66 if not state_path.exists(): 80 67 return [] 81 68 try:
+6 -12
muse/activity_state.py
··· 22 22 23 23 from think.activities import make_activity_id 24 24 from think.callosum import callosum_send 25 - from think.utils import day_path, iter_segments, segment_parse, segment_path 25 + from think.utils import iter_segments, segment_parse, segment_path 26 26 27 27 logger = logging.getLogger(__name__) 28 28 ··· 34 34 """Extract facet name from output path. 35 35 36 36 Output paths for faceted generators follow the pattern: 37 - {day}/{segment}/agents/{facet}/activity_state.json 37 + {day}/{stream}/{segment}/agents/{facet}/activity_state.json 38 38 39 39 Returns None if facet cannot be extracted. 40 40 """ ··· 116 116 117 117 118 118 def load_previous_state( 119 - day: str, segment: str, facet: str, stream: str | None = None 119 + day: str, segment: str, facet: str, stream: str 120 120 ) -> tuple[list | None, str | None]: 121 121 """Load activity state from a previous segment. 122 122 123 123 Returns tuple of (state_list, segment_key) where state_list is the 124 124 parsed JSON array or None if not found/invalid. 125 125 """ 126 - if stream: 127 - state_path = ( 128 - segment_path(day, segment, stream) 129 - / "agents" 130 - / facet 131 - / "activity_state.json" 132 - ) 133 - else: 134 - state_path = day_path(day) / segment / "agents" / facet / "activity_state.json" 126 + state_path = ( 127 + segment_path(day, segment, stream) / "agents" / facet / "activity_state.json" 128 + ) 135 129 if not state_path.exists(): 136 130 return None, None 137 131
+3 -3
muse/entities.py
··· 118 118 len(unique_entities), 119 119 ) 120 120 121 - # Determine output path: segment_dir/entities.jsonl 121 + # Write entities.jsonl alongside the agent output in the agents/ directory 122 122 output_path = Path(context.get("output_path", "")) 123 - segment_dir = output_path.parent 124 - jsonl_path = segment_dir / "entities.jsonl" 123 + agents_dir = output_path.parent 124 + jsonl_path = agents_dir / "entities.jsonl" 125 125 126 126 # Write JSONL file 127 127 try:
+1 -2
think/formatters.py
··· 188 188 "*/*/*/*_transcript.jsonl": ("observe.hear", "format_audio", False), 189 189 "*/*/*/screen.jsonl": ("observe.screen", "format_screen", False), 190 190 "*/*/*/*_screen.jsonl": ("observe.screen", "format_screen", False), 191 - # Markdown — specific journal paths (all indexed) 191 + # Markdown — day-level agents output and segment-level (day/stream/segment/agents/) 192 192 "*/agents/*.md": ("think.markdown", "format_markdown", True), 193 - "*/agents/*/*.md": ("think.markdown", "format_markdown", True), 194 193 # Layout: day/stream/segment/agents/*.md 195 194 "*/*/*/agents/*.md": ("think.markdown", "format_markdown", True), 196 195 "*/*/*/agents/*/*.md": ("think.markdown", "format_markdown", True),