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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions agentex/src/domain/repositories/task_message_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,13 @@ class TaskMessageRepository(MongoDBCRUDRepository[TaskMessageEntity]):
# These will be created once at startup, not per request
INDEXES = [
{
"keys": [("task_id", pymongo.ASCENDING), ("created_at", pymongo.ASCENDING)],
"keys": [
("task_id", pymongo.ASCENDING),
("created_at", pymongo.DESCENDING),
],
"name": "task_id_created_at_idx",
"description": "Compound index for querying messages by task_id and sorting by created_at",
},
{
"keys": [("task_id", pymongo.ASCENDING)],
"name": "task_id_idx",
"description": "Single index for task_id queries and delete operations",
},
{
"keys": [
("task_id", pymongo.ASCENDING),
Expand All @@ -40,7 +38,7 @@ class TaskMessageRepository(MongoDBCRUDRepository[TaskMessageEntity]):
"keys": [
("task_id", pymongo.ASCENDING),
("content.type", pymongo.ASCENDING),
("created_at", pymongo.ASCENDING),
("created_at", pymongo.DESCENDING),
],
"name": "task_id_content_type_created_at_idx",
"description": "Compound index for filtering messages by task_id, content type, and sorting by created_at",
Expand Down
8 changes: 2 additions & 6 deletions agentex/src/domain/repositories/task_state_repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,8 @@ class TaskStateRepository(MongoDBCRUDRepository[StateEntity]):
{
"keys": [("task_id", pymongo.ASCENDING), ("agent_id", pymongo.ASCENDING)],
"name": "task_agent_compound_idx",
"description": "Compound index for get_by_task_and_agent queries",
},
{
"keys": [("task_id", pymongo.ASCENDING)],
"name": "task_id_idx",
"description": "Single index for task_id queries",
"unique": True,
"description": "Unique compound index for get_by_task_and_agent queries",
},
{
"keys": [("agent_id", pymongo.ASCENDING)],
Expand Down
Loading