Skip to content

Conversation

@mare5x
Copy link
Contributor

@mare5x mare5x commented Nov 7, 2025

Fixes #59 with a new method:

session.add_context(...)


context = ""
for db_name, db_context in db_contexts.items():
for db_name, db_context in session.db_context.items():
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 session.db.context? Is it safe to assume every connector will have a .context field?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, we should add more structure to how we store added databases and dataframes in Session. Currently, it's all dicts so there is no .context field.

for df_name, df_context in df_contexts.items():
for df_name, df_context in session.df_context.items():
context += f"## Context for DF {df_name} (fully qualified name 'temp.main.{df_name}')\n\n{df_context}\n\n"
for idx, additional_ctx in enumerate(session.additional_context, start=1):
Copy link
Collaborator

Choose a reason for hiding this comment

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

How long could session.additional_context sequence pontentially be?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently there is no limit. In practice, the maximum context size of the LLM is the limit.

Copy link
Collaborator

@Rauf-Kurbanov Rauf-Kurbanov left a comment

Choose a reason for hiding this comment

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

All cool, just minor comments

@mare5x mare5x merged commit 458cf7a into main Nov 10, 2025
2 checks passed
@mare5x mare5x deleted the mhostnik/additional_context branch November 10, 2025 09:16
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.

Support adding context directly to session using a separate method

4 participants