Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,99 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# Table of Contents
|
| 2 |
|
| 3 |
* [CtrlExMem\_CoderFlow](#CtrlExMem_CoderFlow)
|
|
|
|
| 1 |
+
### Structure of Coder
|
| 2 |
+
|
| 3 |
+
```
|
| 4 |
+
goal, memory_files (dict)
|
| 5 |
+
|
|
| 6 |
+
v
|
| 7 |
+
+-------------------+
|
| 8 |
+
| MemoryReading | Reads in the content of the memory files
|
| 9 |
+
| Flow |
|
| 10 |
+
+-------------------+
|
| 11 |
+
|
|
| 12 |
+
| (memory_content)
|
| 13 |
+
|
|
| 14 |
+
v
|
| 15 |
+
+-------------------+
|
| 16 |
+
| PlanWriter | Writes a step-by-step plan to achieve the goal
|
| 17 |
+
+-------------------+
|
| 18 |
+
|
|
| 19 |
+
| (plan)
|
| 20 |
+
|
|
| 21 |
+
v
|
| 22 |
+
+-------------------+
|
| 23 |
+
| CtrlExMemFlow | Illustrated below. Carries out the plan in an controller-executor fashion,
|
| 24 |
+
| | with memory management mechanisms.
|
| 25 |
+
+-------------------+
|
| 26 |
+
|
|
| 27 |
+
(summary, result)
|
| 28 |
+
|
| 29 |
+
```
|
| 30 |
+
|
| 31 |
+
Here is the structure of the `CtrlExMemFlow`:
|
| 32 |
+
```
|
| 33 |
+
plan, memory_files, memory_content, goal
|
| 34 |
+
|
|
| 35 |
+
v
|
| 36 |
+
+---------------+
|
| 37 |
+
| Controller | --------<<<<-----------+
|
| 38 |
+
+---------------+ |
|
| 39 |
+
| |
|
| 40 |
+
| (command, command args) |
|
| 41 |
+
| |
|
| 42 |
+
v |
|
| 43 |
+
+------------------+ |
|
| 44 |
+
| Executor | Each branch is an |
|
| 45 |
+
| (Tree Structure) | executor |
|
| 46 |
+
+------------------+ |
|
| 47 |
+
| ^
|
| 48 |
+
| (execution results) ^
|
| 49 |
+
| ^
|
| 50 |
+
v ^
|
| 51 |
+
+---------------+ ^
|
| 52 |
+
| MemWriteFlow | Updates memory files ^
|
| 53 |
+
+---------------+ ^
|
| 54 |
+
| ^
|
| 55 |
+
| (summary) |
|
| 56 |
+
| |
|
| 57 |
+
v |
|
| 58 |
+
+---------------+ |
|
| 59 |
+
| MemReadFlow | Reads updated memory |
|
| 60 |
+
+---------------+ |
|
| 61 |
+
| |
|
| 62 |
+
| (updated memory content) |
|
| 63 |
+
| |
|
| 64 |
+
+-> goes back to the Controller>-+
|
| 65 |
+
|
| 66 |
+
```
|
| 67 |
+
Structure of the Executors:
|
| 68 |
+
```
|
| 69 |
+
+-------------------+
|
| 70 |
+
| Branching |
|
| 71 |
+
| Executor |
|
| 72 |
+
+-------------------+
|
| 73 |
+
/ | | | | \
|
| 74 |
+
/ | | | | \
|
| 75 |
+
/ | | | | \
|
| 76 |
+
/ | | | | \
|
| 77 |
+
Extend_library ask_user re_plan update_plan run_code
|
| 78 |
+
|
| 79 |
+
```
|
| 80 |
+
|
| 81 |
+
Memory files of Coder:
|
| 82 |
+
- plan_coder.txt
|
| 83 |
+
- logs_coder.txt
|
| 84 |
+
- library.py
|
| 85 |
+
|
| 86 |
+
About the branches:
|
| 87 |
+
- [ExtendLibrary](https://huggingface.co/Tachi67/ExtendLibraryFlowModule): Writes and tests code functions in an interactive fashion, finally saves the written function to the code library.
|
| 88 |
+
- [ask_user](https://huggingface.co/Tachi67/ExtendLibraryFlowModule/blob/main/ExtLibAskUserFlow.py): Ask user for info / confirmation, etc.
|
| 89 |
+
- [re_plan](https://huggingface.co/Tachi67/ReplanningFlowModule): One branch of the executors, when something goes wrong, re-draft the plan.
|
| 90 |
+
- [update_plan](https://huggingface.co/Tachi67/JarvisFlowModule/blob/main/UpdatePlanAtomicFlow.py): One branch of the executors, when the controller realizes that one (or some, depending on the LLM's response) step of the plan is (are) done, it generates a new plan that marks the step(s) as done.
|
| 91 |
+
- [run_code](https://huggingface.co/Tachi67/RunCodeFlowModule): Runs the code written by the Controller, will first open up a temp file with the code for user confirmation and editing, then the code is passed to the [InterpreterFlow](https://huggingface.co/Tachi67/InterpreterFlowModule).
|
| 92 |
+
-
|
| 93 |
+
|
| 94 |
+
|
| 95 |
+
|
| 96 |
+
|
| 97 |
# Table of Contents
|
| 98 |
|
| 99 |
* [CtrlExMem\_CoderFlow](#CtrlExMem_CoderFlow)
|