Skip to content

Conversation

@kosstbarz
Copy link
Contributor

@kosstbarz kosstbarz commented Nov 12, 2025

  • No graph caching
  • Graph is created only once
  • All DuckDB logic moved to Agent implementation (Lighthouse agent)
  • External DuckDB connection is closed and its file is attached to internal DuckDB connection
  • Error if external DuckDB connection is memory-based

Copy link
Contributor

@mare5x mare5x left a comment

Choose a reason for hiding this comment

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

The code is much more understandable now that Executor handles the connection and not Session :)

if isinstance(connection, duckdb.DuckDBPyConnection):
path = get_db_path(connection)
if path is not None:
connection.close()
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to close()? What if the user wants to keep using the connection outside databao?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is difficult to work with DuckDB. At least for me. I started with no close(), but it failed because during connection creation relative path could be used. But we can use only full path. In this case DuckDB raises an error, that the same file is connected with different path. So the only way I found to work around was to close the connection. It would be great if you find better solution.

self._cached_graph: ExecuteSubmit | None = None
self._prompt_template = read_prompt_template(Path("system_prompt.jinja"))

# Create a DuckDB connection for the agent
Copy link
Contributor

Choose a reason for hiding this comment

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

Copying the comment from #100 since it's relevant here. We can leave the code as-is for now though.

With the current design, Executor gets a Session in execute so it should technically work with many Sessions. So if the Executor wants to cache the system prompt (or anything else), it needs to keep track to which Session the prompt belongs.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let's keep it for now. We have a point to discuss on design review. Then we will fix it in the separate PR.

@kosstbarz kosstbarz merged commit ff40b35 into main Nov 13, 2025
2 checks passed
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