Connecting custom Python agents and RAG to the UI

Wire your own Agent and tools straight into a web chat UI

You don't have to settle for a generic blank chat box. Point praisonai dashboard at your agents.yaml — or wrap your Python Agent (with tools, memory, and RAG) in an AIUI app so every browser chat invokes your exact production agent.

Example

# Launch the dashboard backed by your project's agents.yaml
praisonai dashboard --config agents.yaml --port 8080

Example explained

  • –config agents.yaml — Loads your team's custom roles, models, tools, and knowledge directly into the web UI.
  • –port 8080 — Binds the local console on localhost:8080.

Verify the underlying Python agent before wiring the UI

Always test your agent handler cleanly in Python first so UI troubleshooting stays separate from agent logic.

Example

from praisonai import Agent

def search_runbooks(topic: str) -> str:
    """Return matching internal runbook steps."""
    return f'Runbook [{topic}]: Restart worker pool and check p95 latency.'

ui_agent = Agent(
    name='OpsConsoleHelper',
    instructions='Always call search_runbooks and answer in one sentence.',
    tools=[search_runbooks],
    output='silent',
)
print(ui_agent.start('How do we recover worker-pool?'))

Try it Yourself

Example explained

  • ui_agent — Same tested Python Agent powers both CLI runs and browser chat sessions.

Common pitfall: putting business logic inside UI event callbacks

Keep tools, guardrails, and RAG cleanly inside your Agent module so your web console stays a thin, swappable presentation layer.

Reference: documentation