Skip to content

Commit 93cc5e6

Browse files
abrookinsclaude
andcommitted
Address PR review comments
- Move imports to top of extraction.py where possible, document circular import constraints - Remove example_usage.py from root directory - Remove TASK_MEMORY.md and add to .gitignore 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 0ae2312 commit 93cc5e6

File tree

4 files changed

+6
-397
lines changed

4 files changed

+6
-397
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,3 +233,4 @@ libs/redis/docs/.Trash*
233233
*.pyc
234234
.ai
235235
.claude
236+
TASK_MEMORY.md

TASK_MEMORY.md

Lines changed: 0 additions & 199 deletions
This file was deleted.

agent_memory_server/extraction.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from transformers import AutoModelForTokenClassification, AutoTokenizer, pipeline
1010

1111
from agent_memory_server.config import settings
12-
from agent_memory_server.filters import DiscreteMemoryExtracted
12+
from agent_memory_server.filters import DiscreteMemoryExtracted, MemoryType
1313
from agent_memory_server.llms import (
1414
AnthropicClientWrapper,
1515
OpenAIClientWrapper,
@@ -312,8 +312,8 @@ async def extract_discrete_memories(
312312
client = await get_model_client(settings.generation_model)
313313

314314
# Use vectorstore adapter to find messages that need discrete memory extraction
315-
# TODO: Sort out circular imports
316-
from agent_memory_server.filters import MemoryType
315+
# Local imports to avoid circular dependencies:
316+
# long_term_memory imports from extraction, so we import locally here
317317
from agent_memory_server.long_term_memory import index_long_term_memories
318318
from agent_memory_server.vectorstore_factory import get_vectorstore_adapter
319319

@@ -420,7 +420,8 @@ async def extract_memories_with_strategy(
420420
This function replaces extract_discrete_memories for strategy-aware extraction.
421421
Each memory record contains its extraction strategy configuration.
422422
"""
423-
from agent_memory_server.filters import MemoryType
423+
# Local imports to avoid circular dependencies:
424+
# long_term_memory imports from extraction, so we import locally here
424425
from agent_memory_server.long_term_memory import index_long_term_memories
425426
from agent_memory_server.memory_strategies import get_memory_strategy
426427
from agent_memory_server.vectorstore_factory import get_vectorstore_adapter

0 commit comments

Comments
 (0)