Replies: 6 comments 11 replies
-
Sqlmodel from the creator of fastapi makes it easy to persist. If you look at parallel tools. We have tools. Response model actually uses tools behind the scenes. |
Beta Was this translation helpful? Give feedback.
-
Hey! Wanted to share our library Similar at a high level to LangGraph (represent your app as a state machine, graph of actions), but has an OS UI for telemetry + persistence built in/pluggable (has a SQLLite persister as well). Also generally less opinionated about LLM tooling than the langstack -- works with instructor quite nicely (the examples just use OpenAI/other LLM endpoints, but instructor obviously allows a very clean patch). You can read about persistence here: https://burr.dagworks.io/concepts/state-persistence/. |
Beta Was this translation helpful? Give feedback.
-
Your reference and what I found there has got me reading for hours ... It is a huge compilation of experience/knowledge. Applied LLMs - What We’ve Learned From A Year of Building with LLMs Prompting Fundamentals and How to Apply them Effectively Your AI Product Needs Evals – Hamel's Blog LLM From the Trenches: 10 Lessons Learned Operationalizing Models at GoDaddy - GoDaddy Blog |
Beta Was this translation helpful? Give feedback.
-
Hey @jxnl I have been able to set up agentic flow with instructor thanks to your cookbooks. They cover so many cases and I love it! with instructor, I am getting structured output, but I also wanna store every conversation as a message, be it Human, Assistant or Tool. I've written a helper function, which converts pydantic base class (Messages) to groq/open-ai compatible list of messages. The problem occurs in case of Tool Message. The Groq / OpenAI endpoint, for tools needs tool_id and other related stuff for the message to be used for providing context to LLM. What should be done in this case? Should I just save ToolMessage as Assistant Message? Here's what I've been cooking, for complex tasks I want to store every conversation that has happened as it will help me in designing stable tasks. 🤔 @jxnl |
Beta Was this translation helpful? Give feedback.
-
It will be great if someone can paste minimal example of multi agent example using instructor or add directly in docs I still can't understand how to build multi agent system using instructor. |
Beta Was this translation helpful? Give feedback.
-
Several times I came here looking for an update, as I wanted to see something about Burr from the perspective of someone using Instructor. Some say "Multi Agent" where others would say "One Agent with access to many Tools", or not. It took me a while but I finally got to do something with Burr AND understand how:
Here is a simple App with Burr # Build the Burr application
app = (
ApplicationBuilder()
# This defines the State schema for the application
.with_typing(PydanticTypingSystem(AppState))
# This is the initial state for the application, you can also use .with_state(AppState()) to start with an empty state ( I did `initial_state=AppState(<params>)` before this block)
.with_state(initial_state)
.with_actions(
Generator,
Tools,
ToolsLimiter, # This will check the number of consecutive tool calls
Reviewer,
HumanReview,
End, # This is an empty action to terminate the flow
)
.with_transitions(
("Generator", "Tools", expr("response.get('tool_calls',None) is not None")),
("Tools", "ToolsLimiter"),
("ToolsLimiter", "Generator"),
("Generator", "Reviewer"),
("Reviewer", "HumanReview", ),
("HumanReview", "Generator", ~when(feedback="")),
("HumanReview", "End", when(feedback="")), # If no feedback, end the flow
)
.with_entrypoint("Generator") # The 1st Action
.with_tracker(project="my_first_burr_project") # <--- This line enables tracking.
.build()
) Note: the Note: Although I named Actions like Under the hood, what Instructor does is (very briefly, not a complete list) :
If you provide a Note: You can use the hooks Instructor provides to see this in your calls. I think is important to understand all this (and more) to use 'the best tool for the job'. Instructor is great, but at some stage you may not want to use it for everything. Q: Can one use Instructor and additional Tools at the same time? But there is another option, which is what I use (image below).
Most of this is inside the Not directly related but you may find interesting. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi @jxnl,
I recently discovered Instructor through your co-authored blog post, "What we learned in a year of building LLMs," and I've been thrilled to replace my LCEL with Instructor code. The experience has been seamless!
However, I'm now facing a dilemma: how to set up agentic-workflow with Instructor.
Previously, I used LangGraph+LangChain's runnables with SQLite persistence checkpointer. I'd love to hear your thoughts on setting up the desired logic and flow for reliable agentic workflows.
I like LangGraph's concept, particularly how ToolMessage could interact with LLMs, enabling them to reason. In one of my projects, I successfully used LLMs with tools and HITL, but I encountered JsonDecodeErrors and had to craft detailed prompts to make it work. Now, I'm using a smaller LLM with n-shot learning, and it's working as expected with Instructor.
I have two questions:
Looking forward to your insights!
Beta Was this translation helpful? Give feedback.
All reactions