#Agno + Frontend actions
1 messages · Page 1 of 1 (latest)
Yes, Agno framework with Frontend Actions is fully valid and working!
The reason the frontend actions docs might seem to disappear when you switch to Agno is likely just a documentation navigation issue, but the functionality is absolutely supported.
Yes, you can add middleware when using CopilotKit with Agno!
CopilotKit's CopilotRuntime supports middleware configuration regardless of which agent framework you're using:
import {
CopilotRuntime,
ExperimentalEmptyAdapter,
copilotRuntimeNextJSAppRouterEndpoint,
} from "@copilotkit/runtime";
import { AgnoAgent } from "@ag-ui/agno"
const runtime = new CopilotRuntime({
agents: {
"agno_agent": new AgnoAgent({url: "http://localhost:8000/agui"}),
},
// Add middleware here
middleware: {
onBeforeRequest: async (options) => {
console.log('Before request:', options);
// Your custom logic before processing
// Access: threadId, runId, inputMessages, properties
},
onAfterRequest: async (options) => {
console.log('After request:', options);
// Your custom logic after processing
// Access: threadId, runId, inputMessages, outputMessages, properties
}
}
});
export const POST = async (req: NextRequest) => {
const { handleRequest } = copilotRuntimeNextJSAppRouterEndpoint({
runtime,
serviceAdapter: new ExperimentalEmptyAdapter(),
endpoint: "/api/copilotkit",
});
return handleRequest(req);
};
I have to use CopilotRuntime? can't i reference just the agui directly?
Okay, I assumed you are using agno with copilotkit. Let me check this and I will reply.
Btw, if you are interested, there is a dedicated server for AG-UI updates and support.
Can you provide more details about your setup?
Hello, I am struggling with connecting Agno to the frontend actions. I have an agent running on a fast api server and I can communicate with it via the side chat area, but asking the agent to execute an action does not seem to trigger anything.
Can you please provide me with some examples or documentation?
Hi @civic surge, You can find a working demo here
Thank you Tony, I did indeed find this repo and I had defined the front end tools in my server exactly like with-agno. My chat agent now sees the actions but when asked to execute them it doesnt do anything and the agent run pauses.
Thanks for the update! Since you're still running into issues with the agent execution, let me connect you with the right team member who can help troubleshoot this further.
Thank you so much