Langflow is a visual framework for building multi-agent and RAG applications. It provides a drag-and-drop interface to create complex AI workflows without writing code. AnyAPI integrates seamlessly with Langflow, giving you access to all AnyAPI models through Langflow’s visual interface.
# Install Langflowpip install langflow# Or install with all optional dependenciespip install langflow[all]# For development with additional toolspip install langflow[dev]
Start Langflow:
Copy
# Run Langflow serverlangflow run# Or specify custom host and portlangflow run --host 0.0.0.0 --port 7860
# Router Agentrouter_prompt = """You are a router agent. Analyze the user query and determine which specialist agents should handle it:- Research Agent: For factual information gathering- Analysis Agent: For data analysis and interpretation - Writing Agent: For content creation and editingUser Query: {query}Route to: [agents_needed]"""# Research Agentresearch_prompt = """You are a research agent. Your job is to gather accurate, up-to-date information about the topic.Focus on facts, data, and credible sources.Research Query: {query}Findings: [your_research]"""# Analysis Agent analysis_prompt = """You are an analysis agent. Your job is to interpret data, identify patterns, and draw insights.Be analytical and objective in your assessment.Data to Analyze: {data}Analysis: [your_analysis]"""# Writing Agentwriting_prompt = """You are a writing agent. Your job is to create clear, engaging, and well-structured content.Adapt your writing style to the intended audience and purpose.Content Brief: {brief}Written Content: [your_content]"""
# content-generation-template.yamlname: "Content Generation Pipeline"description: "End-to-end content creation with research, writing, and review"components: 1_topic_input: type: "TextInput" config: placeholder: "Enter content topic..." 2_research_agent: type: "AnyAPI_LLM" config: model: "gpt-4o" system_message: "You are a research specialist. Gather comprehensive information about the given topic." temperature: 0.3 3_outline_generator: type: "AnyAPI_LLM" config: model: "claude-3-5-sonnet" system_message: "Create a detailed outline based on the research provided." temperature: 0.5 4_content_writer: type: "AnyAPI_LLM" config: model: "gpt-4o" system_message: "Write engaging content following the provided outline and research." temperature: 0.7 5_editor_reviewer: type: "AnyAPI_LLM" config: model: "claude-3-5-sonnet" system_message: "Review and edit the content for clarity, flow, and engagement." temperature: 0.3connections: - from: "1_topic_input.output" to: "2_research_agent.input" - from: "2_research_agent.output" to: "3_outline_generator.input" - from: "3_outline_generator.output" to: "4_content_writer.context" - from: "2_research_agent.output" to: "4_content_writer.research" - from: "4_content_writer.output" to: "5_editor_reviewer.input"