{"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/dataflow-guided-retrieval-augmentation-for","title":"Dataflow-Guided Retrieval Augmentation for Repository-Level Code Completion","arxiv_id":"2405.19782","date":"2024-05-30","proceeding":null,"authors":["Wei Cheng","Yuhan Wu","Wei Hu"],"abstract":"Recent years have witnessed the deployment of code language models (LMs) in various code intelligence tasks such as code completion. Yet, it is challenging for pre-trained LMs to generate correct completions in private repositories. Previous studies retrieve cross-file context based on import relations or text similarity, which is insufficiently relevant to completion targets. In this paper, we propose a dataflow-guided retrieval augmentation approach, called DraCo, for repository-level code completion. DraCo parses a private repository into code entities and establishes their relations through an extended dataflow analysis, forming a repo-specific context graph. Whenever triggering code completion, DraCo precisely retrieves relevant background knowledge from the repo-specific context graph and generates well-formed prompts to query code LMs. Furthermore, we construct a large Python dataset, ReccEval, with more diverse completion targets. Our experiments demonstrate the superior accuracy and applicable efficiency of DraCo, improving code exact match by 3.43% and identifier F1-score by 3.27% on average compared to the state-of-the-art approach.","url_abs":"https://arxiv.org/abs/2405.19782v1","url_pdf":"https://arxiv.org/pdf/2405.19782v1.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":"dataflow-guided-retrieval-augmentation-for","repo_url":"https://github.com/nju-websoft/DraCo","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"none","reach":null}],"tasks":[{"task_slug":"code-completion","task_name":"Code Completion"},{"task_slug":"retrieval","task_name":"Retrieval"},{"task_slug":"text-similarity","task_name":"text similarity"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2405.19782","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2405.19782"}},"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/nju-websoft/DraCo","reach":null}],"summary":{"ran":4},"by_repo_kind":{"official":{"samples":4,"ran":4,"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":4,"samples":[{"code_sha256_prefix":"1581f16f7ba09faf","entry":"DataflowGraph","repo":"nju-websoft/DraCo","repo_kind":"official","path":"src/extract_dataflow.py","file_url":"https://github.com/nju-websoft/DraCo/blob/HEAD/src/extract_dataflow.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"1581f16f7ba09faf"}},{"code_sha256_prefix":"1eefd33013644a3b","entry":"EdgeType","repo":"nju-websoft/DraCo","repo_kind":"official","path":"src/extract_dataflow.py","file_url":"https://github.com/nju-websoft/DraCo/blob/HEAD/src/extract_dataflow.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"1eefd33013644a3b"}},{"code_sha256_prefix":"db2ec1570be5d37e","entry":"Leaf","repo":"nju-websoft/DraCo","repo_kind":"official","path":"src/extract_dataflow.py","file_url":"https://github.com/nju-websoft/DraCo/blob/HEAD/src/extract_dataflow.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"db2ec1570be5d37e"}},{"code_sha256_prefix":"7b547844c17c5914","entry":"NodeType","repo":"nju-websoft/DraCo","repo_kind":"official","path":"src/extract_dataflow.py","file_url":"https://github.com/nju-websoft/DraCo/blob/HEAD/src/extract_dataflow.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"GPL-3.0","inline_ok":false,"mcp_get_code":{"code_sha256":"7b547844c17c5914"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}