2025-02-15 Multimodal AI Agents Hackathon
Python: docs.llamaindex.ai
TypeScript: ts.llamaindex.ai
World's best parser of complex documents
Free for 1000 pages/day!
cloud.llamaindex.ai
Turn-key RAG API for Enterprises
Available as SaaS or private cloud deployment
A new paradigm for programming
class MyWorkflow(Workflow):
@step
async def step_one(self, ev: StartEvent) -> FirstEvent:
print(ev.first_input)
return FirstEvent(first_output="First step complete.")
@step
async def step_two(self, ev: FirstEvent) -> SecondEvent:
print(ev.first_output)
return SecondEvent(second_output="Second step complete.")
@step
async def step_three(self, ev: SecondEvent) -> StopEvent:
print(ev.second_output)
return StopEvent(result="Workflow complete.")
Parallelization: flavor 1
Parallelization: flavor 2
(again)
aka Self-reflection
def multiply(a: int, b: int) -> int:
"""Multiply two integers and return the result."""
return a * b
multiply_tool = FunctionTool.from_defaults(fn=multiply)
agent = FunctionCallingAgent.from_tools(
[multiply_tool],
llm=llm,
)
response = agent.chat("What is 3 times 4?")
research_agent = FunctionAgent(
name="ResearchAgent",
description="Useful for searching the web for information on a given topic and recording notes on the topic.",
system_prompt=(
"You are the ResearchAgent that can search the web for information on a given topic and record notes on the topic. "
"Once notes are recorded and you are satisfied, you should hand off control to the WriteAgent to write a report on the topic."
),
llm=llm,
tools=[search_web, record_notes],
can_handoff_to=["WriteAgent"],
)
as a one-liner
agent_workflow = AgentWorkflow(
agents=[research_agent, write_agent, review_agent],
root_agent=research_agent.name,
initial_state={
"research_notes": {},
"report_content": "Not written yet.",
"review": "Review required.",
},
)
documents = LlamaParse().load_data("./myfile.pdf")
index = VectorStoreIndex.from_documents(documents)
query_engine = index.as_query_engine()
response = query_engine.query("What did the author do growing up?")
print(response)
Solve it with: routing, parallelization
Solve it with: parallelization
Solve it with: chaining, parallelization
Follow me on BlueSky:
@seldo.com