Agentic Patterns
Build the six architectural patterns of agentic AI (prompt chaining, routing, parallelization, tool use, evaluator-optimizer, orchestrator-worker) and the ReAct and planning strategies as Pixeltable tables and computed columns.
Enable LLMs to call functions and tools, then execute the results automatically.
Agents · Notebook · Updated
Colab runs it in your browser. If it calls a model provider, it asks for that provider's API key in a cell.
You define tools with JSON schemas, pass them to the LLM, and use invoke_tools to execute the function calls.
pip install pixeltable openai mcp
OPENAI_API_KEYopenai.chat_completions()openai.invoke_tools()@pxt.udfpxt.tools()pxt.create_table()pxt.mcp_udfs()add_computed_column()insert()# Add LLM call with toolsqueries.add_computed_column(response=openai.chat_completions(messages=[{'role': 'user', 'content': queries.query}],model='gpt-4o-mini',tools=tools, # Pass tools to the LLM))
One cell of the notebook, copied as it is. Open it in Colab for the rest.
Build the six architectural patterns of agentic AI (prompt chaining, routing, parallelization, tool use, evaluator-optimizer, orchestrator-worker) and the ReAct and planning strategies as Pixeltable tables and computed columns.
Create a retrieval-augmented generation system that answers questions using your documents as context.
Score model output with a second model, as a chain of computed columns
In this tutorial, we'll demonstrate how RAG operations can be implemented in Pixeltable. In particular, we'll develop a RAG application that summarizes a collection of PDF documents and uses ChatGPT to answer questions about them.