Skip to content

Conversation

@umeshma
Copy link
Collaborator

@umeshma umeshma commented Oct 9, 2025

  • ConversationBase - query method updated to permit passing in (optional) options
    • Needed to control topK and other parameters
    • Allow inheritors to customize query behavior
  • EmailMemory now uses ConversationBase
    • Reworked entirely. Much cleaner and simpler
  • Email Import:
    • EmailMessage + Meta: also capture message ID and src_Url or file_path
  • Improved test_email.py
    • Ingestion: incremental indexing
    • Tracks what messages were already indexed: simplifying testing
    • Useful debug flags for error handling etc
  • Bug fixes

@umeshma umeshma changed the title Email Memory example updates ConversationBase, Email Memory example updates Oct 9, 2025
Copy link
Collaborator

@gvanrossum-ms gvanrossum-ms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some things left for next time. Merging now because I want it.

self.conversation = await load_or_create_email_index(
str(self.db_path), create_new
)
self.index_log = load_index_log(str(self.db_path), create_new)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I take it this holds a persistent, mutable mapping of email IDs to booleans? (Or rather a set of email IDs that have been indexed.)

self.conversation = await load_or_create_email_index(
str(self.db_path), create_new=True
)
await self.load_conversation(self.db_name, create_new=True)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So restart is now a synonym for load?

print("Type @help for a list of commands")

db_path = str(base_path.joinpath("pyEmails.db"))
default_db = "gmail.db" # "pyEmails.db"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not email.db. :-)

Comment on lines +220 to +221
await conversation.add_messages_with_indexing([email])
context.log_indexed(email_id)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, so these two aren't transactional (because the second doesn't use SQLite3) and in theory the first could succeed and the second could fail. Not sure what to do about it other than adding an extra column to the messages table for the email_ID. :-(

from .email_message import EmailMessage, EmailMessageMeta


def import_emails_from_dir(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eventually this file and these functions need to switch to 'ingest'

# Load synonyms from a file and add them as aliases
async def _add_synonyms_file_as_aliases(
conversation: IConversation, file_name: str
conversation: ConversationBase, file_name: str, clean: bool
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename clean -> clear

@gvanrossum-ms gvanrossum-ms merged commit 864a720 into main Oct 10, 2025
9 checks passed
@gvanrossum-ms gvanrossum-ms deleted the umeshma/dev branch October 10, 2025 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants