mirror of
https://github.com/temporal-community/temporal-ai-agent.git
synced 2026-03-15 14:08:08 +01:00
Compare commits
1 Commits
0.3.0
...
review-jos
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fcd580dfa6 |
@@ -18,7 +18,7 @@ These are the key elements of an agentic framework:
|
|||||||
2. The "agent loop" - call LLM, either call tools or prompt human, repeat until goal(s) are done
|
2. The "agent loop" - call LLM, either call tools or prompt human, repeat until goal(s) are done
|
||||||
3. Support for tool calls that require human input and approval
|
3. Support for tool calls that require human input and approval
|
||||||
4. Use of an LLM to check human input for relevance before calling the 'real' LLM
|
4. Use of an LLM to check human input for relevance before calling the 'real' LLM
|
||||||
5. use of an LLM to summarize and compact the conversation history
|
5. Use of an LLM to summarize and compact the conversation history
|
||||||
6. Prompt construction (made of system prompts, conversation history, and tool metadata - sent to the LLM to create user prompts)
|
6. Prompt construction (made of system prompts, conversation history, and tool metadata - sent to the LLM to create user prompts)
|
||||||
7. Bonus: durable tool execution via Temporal Activities
|
7. Bonus: durable tool execution via Temporal Activities
|
||||||
|
|
||||||
@@ -35,8 +35,7 @@ See [the architecture guide](./architecture.md).
|
|||||||
|
|
||||||
## Productionalization & Adding Features
|
## Productionalization & Adding Features
|
||||||
- In a prod setting, I would need to ensure that payload data is stored separately (e.g. in S3 or a noSQL db - the claim-check pattern), or otherwise 'garbage collected'. Without these techniques, long conversations will fill up the workflow's conversation history, and start to breach Temporal event history payload limits.
|
- In a prod setting, I would need to ensure that payload data is stored separately (e.g. in S3 or a noSQL db - the claim-check pattern), or otherwise 'garbage collected'. Without these techniques, long conversations will fill up the workflow's conversation history, and start to breach Temporal event history payload limits.
|
||||||
- A single worker can easily support many workflows - setting workflow ID differently would enable this.
|
- A single worker can easily support many agent workflows (chats) running at the same time. Currently the workflow ID is the same each time, so it will only run one agent at a time. To run multiple agents, you can use a different workflow ID each time (e.g. by using a UUID or timestamp).
|
||||||
- Continue-as-new shouldn't be a big consideration for this use case (as it would take many conversational turns to trigger). Regardless, we should verify that it's able to carry the agent state over to the new workflow execution.
|
|
||||||
- Perhaps the UI should show when the LLM response is being retried (i.e. activity retry attempt because the LLM provided bad output)
|
- Perhaps the UI should show when the LLM response is being retried (i.e. activity retry attempt because the LLM provided bad output)
|
||||||
- Tests would be nice! [See tests](./tests/).
|
- Tests would be nice! [See tests](./tests/).
|
||||||
|
|
||||||
@@ -45,7 +44,7 @@ See [the todo](./todo.md) for more details.
|
|||||||
|
|
||||||
See [the guide to adding goals and tools](./adding-goals-and-tools.md) for more ways you can add features.
|
See [the guide to adding goals and tools](./adding-goals-and-tools.md) for more ways you can add features.
|
||||||
|
|
||||||
## For Temporal SAs
|
## Enablement Guide (internal resource for Temporal employees)
|
||||||
Check out the [slides](https://docs.google.com/presentation/d/1wUFY4v17vrtv8llreKEBDPLRtZte3FixxBUn0uWy5NU/edit#slide=id.g3333e5deaa9_0_0) here and the enablement guide here (TODO).
|
Check out the [slides](https://docs.google.com/presentation/d/1wUFY4v17vrtv8llreKEBDPLRtZte3FixxBUn0uWy5NU/edit#slide=id.g3333e5deaa9_0_0) here and the enablement guide here (TODO).
|
||||||
|
|
||||||
## Tests
|
## Tests
|
||||||
@@ -57,4 +56,4 @@ Running the tests requires `poe` and `pytest_asyncio` to be installed.
|
|||||||
|
|
||||||
Once you have `poe` and `pytest_asyncio` installed you can run:
|
Once you have `poe` and `pytest_asyncio` installed you can run:
|
||||||
|
|
||||||
poe test
|
poetry run poe test
|
||||||
|
|||||||
34
poetry.lock
generated
34
poetry.lock
generated
@@ -1466,13 +1466,13 @@ certifi = "*"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pytest"
|
name = "pytest"
|
||||||
version = "7.4.4"
|
version = "8.3.5"
|
||||||
description = "pytest: simple powerful testing with Python"
|
description = "pytest: simple powerful testing with Python"
|
||||||
optional = false
|
optional = false
|
||||||
python-versions = ">=3.7"
|
python-versions = ">=3.8"
|
||||||
files = [
|
files = [
|
||||||
{file = "pytest-7.4.4-py3-none-any.whl", hash = "sha256:b090cdf5ed60bf4c45261be03239c2c1c22df034fbffe691abe93cd80cea01d8"},
|
{file = "pytest-8.3.5-py3-none-any.whl", hash = "sha256:c69214aa47deac29fad6c2a4f590b9c4a9fdb16a403176fe154b79c0b4d4d820"},
|
||||||
{file = "pytest-7.4.4.tar.gz", hash = "sha256:2cf0005922c6ace4a3e2ec8b4080eb0d9753fdc93107415332f50ce9e7994280"},
|
{file = "pytest-8.3.5.tar.gz", hash = "sha256:f4efe70cc14e511565ac476b57c279e12a855b11f48f212af1080ef2263d3845"},
|
||||||
]
|
]
|
||||||
|
|
||||||
[package.dependencies]
|
[package.dependencies]
|
||||||
@@ -1480,11 +1480,29 @@ colorama = {version = "*", markers = "sys_platform == \"win32\""}
|
|||||||
exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""}
|
exceptiongroup = {version = ">=1.0.0rc8", markers = "python_version < \"3.11\""}
|
||||||
iniconfig = "*"
|
iniconfig = "*"
|
||||||
packaging = "*"
|
packaging = "*"
|
||||||
pluggy = ">=0.12,<2.0"
|
pluggy = ">=1.5,<2"
|
||||||
tomli = {version = ">=1.0.0", markers = "python_version < \"3.11\""}
|
tomli = {version = ">=1", markers = "python_version < \"3.11\""}
|
||||||
|
|
||||||
[package.extras]
|
[package.extras]
|
||||||
testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"]
|
dev = ["argcomplete", "attrs (>=19.2)", "hypothesis (>=3.56)", "mock", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "pytest-asyncio"
|
||||||
|
version = "0.26.0"
|
||||||
|
description = "Pytest support for asyncio"
|
||||||
|
optional = false
|
||||||
|
python-versions = ">=3.9"
|
||||||
|
files = [
|
||||||
|
{file = "pytest_asyncio-0.26.0-py3-none-any.whl", hash = "sha256:7b51ed894f4fbea1340262bdae5135797ebbe21d8638978e35d31c6d19f72fb0"},
|
||||||
|
{file = "pytest_asyncio-0.26.0.tar.gz", hash = "sha256:c4df2a697648241ff39e7f0e4a73050b03f123f760673956cf0d72a4990e312f"},
|
||||||
|
]
|
||||||
|
|
||||||
|
[package.dependencies]
|
||||||
|
pytest = ">=8.2,<9"
|
||||||
|
|
||||||
|
[package.extras]
|
||||||
|
docs = ["sphinx (>=5.3)", "sphinx-rtd-theme (>=1)"]
|
||||||
|
testing = ["coverage (>=6.2)", "hypothesis (>=5.7.1)"]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "python-dateutil"
|
name = "python-dateutil"
|
||||||
@@ -1934,4 +1952,4 @@ files = [
|
|||||||
[metadata]
|
[metadata]
|
||||||
lock-version = "2.0"
|
lock-version = "2.0"
|
||||||
python-versions = ">=3.10,<4.0"
|
python-versions = ">=3.10,<4.0"
|
||||||
content-hash = "e81bc1a7340bceff982fbaf7d5d52849d8c53aefc2c6773e858c6fbd1e321c15"
|
content-hash = "ae793854c4c87fba6ddd666299e04883038ff7af65f1707af797d4d0fa1f3c67"
|
||||||
|
|||||||
@@ -42,9 +42,10 @@ pandas = "^2.2.3"
|
|||||||
gtfs-kit = "^10.1.1"
|
gtfs-kit = "^10.1.1"
|
||||||
|
|
||||||
[tool.poetry.group.dev.dependencies]
|
[tool.poetry.group.dev.dependencies]
|
||||||
pytest = "^7.3"
|
pytest = ">=8.2"
|
||||||
black = "^23.7"
|
black = "^23.7"
|
||||||
isort = "^5.12"
|
isort = "^5.12"
|
||||||
|
pytest-asyncio = "^0.26.0"
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["poetry-core>=1.4.0"]
|
requires = ["poetry-core>=1.4.0"]
|
||||||
|
|||||||
2
setup.md
2
setup.md
@@ -104,7 +104,7 @@ Requires [Poetry](https://python-poetry.org/) to manage dependencies.
|
|||||||
|
|
||||||
2. `source venv/bin/activate`
|
2. `source venv/bin/activate`
|
||||||
|
|
||||||
3. `poetry install`
|
3. `poetry install --with dev`
|
||||||
|
|
||||||
Run the following commands in separate terminal windows:
|
Run the following commands in separate terminal windows:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user