Skip to content
weego edited this page Jun 5, 2026 · 4 revisions

FAQ

What is LightAgent?

LightAgent is a lightweight Python framework for building agents with tools, memory, MCP integrations, Skills, Tree-of-Thought planning, structured results, tracing, deterministic LightFlow workflows, and simple multi-agent routing.

What is LightFlow?

LightFlow is the v0.8.0 workflow layer for deterministic multi-step agent execution. It lets you define named steps, dependencies, per-step retries, output passing, and flow-level trace events.

from LightAgent import LightFlow

flow = (
    LightFlow()
    .step("research", agent=research_agent)
    .step("write", agent=writer_agent, depends_on=["research"])
)

result = flow.run("Analyze this company", trace=True)

See LightFlow.

Is agent.run("hello") still compatible?

Yes. It returns a string by default.

response = agent.run("hello")
print(response)

Structured results are opt-in:

result = agent.run("hello", result_format="object")
print(result.content)

Is agent.run(query, stream=True, user_id=user_id) still compatible?

Yes. It still returns the legacy stream generator by default.

for chunk in agent.run(query, stream=True, user_id=user_id):
    print(chunk, end="")

Structured streaming events are opt-in:

for event in agent.run(query, stream=True, user_id=user_id, result_format="event"):
    print(event.type, event.data)

Which model providers are supported?

Any provider that exposes an OpenAI-compatible chat completion endpoint can work. This includes OpenAI, OpenRouter, DeepSeek-compatible endpoints, Qwen-compatible endpoints, vLLM, llama.cpp server mode, and Ollama's OpenAI-compatible API.

How do I add a custom tool?

Define a Python function and attach tool_info. See Tools.

How do I add memory?

Pass an object that implements store(data, user_id) and retrieve(query, user_id). See Memory.

How do I connect MCP tools?

Create an mcp_settings dictionary and call asyncio.run(agent.setup_mcp(mcp_setting=mcp_settings)). See MCP.

How do Skills differ from tools?

Tools perform actions. Skills provide reusable task instructions and can include references, scripts, and assets. A Skill can call tools, but a Skill itself is mainly an instruction and resource package.

How do I debug a run?

Use result_format="object" and trace=True:

result = agent.run("hello", result_format="object", trace=True)
print(result.trace)

For local logs, create the agent with debug=True.

Why does my tool not run?

Common causes:

  • the selected model does not support function calling
  • tool_info is missing or malformed
  • required parameters do not match function arguments
  • the tool description is too vague
  • the tool raises an exception during execution

Where are more docs?

Clone this wiki locally