Implement the graph, worker and orchestrator base classes and parallel search and beam search algorithms#63
Conversation
ebad3b8 to
f563381
Compare
…tch agent execution to use asyncio
…g search tree states
…essions for search tree node expansion and pre/post processing
f563381 to
6cbad68
Compare
f860584 to
c2e1438
Compare
| if not graph_db_path: | ||
| timestamp = time.strftime("%Y%m%d_%H%M%S") | ||
| run_subdir = os.path.join( | ||
| os.environ.get("WORKDIR"), |
There was a problem hiding this comment.
Should apply fallback if WORKDIR not set? os.environ.get("WORKDIR", os.getcwd())
There was a problem hiding this comment.
If WORKDIR is not set properly, the run will fail anyway even if you set it as current workdir. The current implementation will throw error to warn users of this issue.
| self.root_id = node.node_id | ||
|
|
||
| self._update_best_node(node) | ||
| self.save() |
There was a problem hiding this comment.
Nit: add_node() calls self.save() unconditionally, and save() serializes all nodes and does a synchronous file write. Worth considering if we need to rewrite the whole graph on every node add, especially when the graph grows large?
There was a problem hiding this comment.
This is a good point but I won't expect the graph to be too large. The db file would typically contain under 100 nodes so it is not issue for now.
| * `--log_file`: File path to save the orchestration logs (creates separate `agent.log` and main logs). | ||
| * `--graph_db_path`: *(Single-problem only)* Explicit path to a `search_graph.json` file to resume a previously interrupted search. | ||
|
|
||
| ### Parallel Search Specific Arguments |
There was a problem hiding this comment.
Which one has better performance so far? Parallel or Beam? Which one is the default to use?
There was a problem hiding this comment.
There is no default one though. User need to specify which one to use.
|
|
||
| def _prepare_initial_state(self, parent_node: Node) -> Dict[str, Any]: | ||
| initial_state = {} | ||
| if parent_node.evaluation: |
There was a problem hiding this comment.
Could you add a defensive check here making sure parent_node is not None?
There was a problem hiding this comment.
Fixed. The current code will not have the case when parent_node is None but I sill add the None check in case later implementation breaks it.
| compiled = comp_status.get("success", False) | ||
| compilation_error = None | ||
| if not compiled: | ||
| compilation_error = comp_status.get("message", "") |
There was a problem hiding this comment.
if in json response, it explicitly sets "message": null, this will lead to error. Could you guard against None case?
There was a problem hiding this comment.
Could you elaborate a bit on this?
There was a problem hiding this comment.
If in the json, there is {"message": null}, what you get from compilation_error = comp_status.get("message", "") will be None, not a string anymore.
Uh oh!
There was an error while loading. Please reload this page.