Skip to content

ConversationBase, Email Memory example updates - #19

Merged
gvanrossum-ms merged 11 commits into
mainfrom
umeshma/dev
Oct 10, 2025
Merged

ConversationBase, Email Memory example updates#19
gvanrossum-ms merged 11 commits into
mainfrom
umeshma/dev

Conversation

@umeshma

@umeshma Umesh Madan (umeshma) commented Oct 9, 2025

Copy link
Copy Markdown
Collaborator
  • 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 Umesh Madan (umeshma) changed the title Email Memory example updates ConversationBase, Email Memory example updates Oct 9, 2025

@gvanrossum-ms gvanrossum-ms left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread tools/test_email.py
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
Copy Markdown
Contributor

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.)

Comment thread tools/test_email.py
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
Copy Markdown
Contributor

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?

Comment thread tools/test_email.py
print("Type @help for a list of commands")

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

Copy link
Copy Markdown
Contributor

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 thread tools/test_email.py
Comment on lines +220 to +221
await conversation.add_messages_with_indexing([email])
context.log_indexed(email_id)

Copy link
Copy Markdown
Contributor

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. :-(

@@ -14,14 +14,10 @@

def import_emails_from_dir(

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor

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.

2 participants