{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/cognify-supercharging-gen-ai-workflows-with","title":"Cognify: Supercharging Gen-AI Workflows With Hierarchical Autotuning","arxiv_id":"2502.08056","date":"2025-02-12","proceeding":null,"authors":["Zijian He","Reyna Abhyankar","Vikranth Srivatsa","Yiying Zhang"],"abstract":"Today's gen-AI workflows that involve multiple ML model calls, tool/API calls, data retrieval, or generic code execution are often tuned manually in an ad-hoc way that is both time-consuming and error-prone. In this paper, we propose a systematic approach for automatically tuning gen-AI workflows. Our key insight is that gen-AI workflows can benefit from structure, operator, and prompt changes, but unique properties of gen-AI workflows require new optimization techniques. We propose AdaSeek, an adaptive hierarchical search algorithm for autotuning gen-AI workflows. AdaSeek organizes workflow tuning methods into different layers based on the user-specified total search budget and distributes the budget across different layers based on the complexity of each layer. During its hierarchical search, AdaSeek redistributes the search budget from less useful to more promising tuning configurations based on workflow-level evaluation results. We implement AdaSeek in a workflow autotuning framework called Cognify and evaluate Cognify using six types of workflows such as RAG-based QA and text-to-SQL transformation. Overall, Cognify improves these workflows' generation quality by up to 2.8x, reduces execution monetary cost by up to 10x, and reduces end-to-end latency by 2.7x.","url_abs":"https://arxiv.org/abs/2502.08056v1","url_pdf":"https://arxiv.org/pdf/2502.08056v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"cognify-supercharging-gen-ai-workflows-with","repo_url":"https://github.com/GenseeAI/cognify","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"rag","task_name":"RAG"},{"task_slug":"text-to-sql","task_name":"Text to SQL"},{"task_slug":"text-to-sql","task_name":"Text-To-SQL"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":null,"atlas_url":"https://app.syntology.ai/?focus=2502.08056","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2502.08056"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/GenseeAI/cognify","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"unverified":4},"by_repo_kind":{"official":{"samples":4,"ran":0,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"f6fcb4b0ad7fd709","entry":"get_function_kwargs","repo":"GenseeAI/cognify","repo_kind":"official","path":"cognify/graph/utils.py","file_url":"https://github.com/GenseeAI/cognify/blob/HEAD/cognify/graph/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f6fcb4b0ad7fd709"}},{"code_sha256_prefix":"41c7da7713bd43f5","entry":"hint_possible_destinations","repo":"GenseeAI/cognify","repo_kind":"official","path":"cognify/graph/base.py","file_url":"https://github.com/GenseeAI/cognify/blob/HEAD/cognify/graph/base.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"41c7da7713bd43f5"}},{"code_sha256_prefix":"66ce939ff458dbaf","entry":"strongly_connected_components","repo":"GenseeAI/cognify","repo_kind":"official","path":"cognify/graph/utils.py","file_url":"https://github.com/GenseeAI/cognify/blob/HEAD/cognify/graph/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"66ce939ff458dbaf"}},{"code_sha256_prefix":"140b752c29fd791f","entry":"subgraph","repo":"GenseeAI/cognify","repo_kind":"official","path":"cognify/graph/utils.py","file_url":"https://github.com/GenseeAI/cognify/blob/HEAD/cognify/graph/utils.py","link_basis":"harvester_set","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"140b752c29fd791f"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}