Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.vectorshift.ai/llms.txt

Use this file to discover all available pages before exploring further.

What this builds. A one-shot functional agent that takes a topic input, optionally searches the web, and returns a brief output. You’ll end up with. A printed Markdown brief plus the run id, produced by a single agent.run(inputs=...) call.
from vectorshift.agent import Agent, AgentType, IoConfig, LlmInfo
from vectorshift.agent.tool import ToolInput, ToolInputType
from vectorshift.agent.tools import ExaAiTool

# Create a tool
search = ExaAiTool(
    tool_name="exa_ai_search",
    query=ToolInput(type=ToolInputType.DYNAMIC, description="Search query"),
)

# Create a functional agent
agent = Agent.new(
    name="Topic briefing",
    type=AgentType.FUNCTIONAL,
    llm_info=LlmInfo(provider="openai", model_id="gpt-4o"),
    tools=[search],
    instructions=(
        "For the given topic, search the web if you need "
        "fresh facts, then write a short brief."
    ),
    inputs={
        "topic": IoConfig(io_type="string", description="Subject to brief"),
    },
    outputs={
        "brief": IoConfig(io_type="string", description="Markdown brief"),
    },
)
print(f"Created agent: {agent.name}")

# Run the agent with structured inputs
result = agent.run(inputs={"topic": "Solid-state batteries"})

# Read the structured result
if result.status == "success":
    print(f"\nBrief:\n{result.outputs['brief']}")
else:
    print(f"\nError: {result.error}")

print(f"\nRun ID: {result.run_id}")

# Clean up
agent.delete()
print("Done.")

Expected output

Created agent: Topic briefing

Brief:
...markdown brief about solid-state batteries...

Run ID: ...
Done.
The Brief body is LLM-generated and the Run ID is a fresh per-run identifier — both vary between runs.

See also

Functional agent with typed I/O

Wire up typed inputs, outputs, and tools before calling run().

Conversational agent run

The conversational equivalent — one-shot agent.run() over a hidden session.

Agent reference

Full method surface.