SAG : Enhancing Domain-Specific Information Retrieval with Semantic-Augmented Graphs (2025)

Abstract: Retrieval-Augmented Generation (RAG) systems rely on high-quality embeddings to retrieve relevant context for large language models. This paper introduces the Semantic-Augmented Graph (SAG), a new architecture that improves domain-specific embeddings by capturing hierarchical semantic relationships between text segments. Inspired by human information processing, SAG organizes content from general to specific concepts using a graph-based structure. By combining static embeddings with dynamic semantic graphs, it generates context-aware representations that reflect both lexical and conceptual links. Experiments on text similarity and domain-specific question answering show that SAG consistently outperforms standard embedding methods within RAG pipelines.

## introduction retrieval-augmented generation (rag) enhances large language models by integrating relevant external information during response generation. this process relies on embedding models to convert text into vector representations for efficient similaritybased retrieval. while general-purpose embeddings perform well across many domains, they often fall short in specialized fields like medicine, law, or technical writing, where semantic structures are more complex and hierarchical. to address this gap, we propose the semantic-augmented graph (sag), a novel architecture designed to improve domain-specific embeddings by modeling how humans organize knowledge. sag converts unstructured text into a directed graph, with nodes representing semantic units and edges encoding contextual relationships. these graphs are further optimized into subtrees that reflect domain-relevant knowledge clusters, capturing both broad concepts and detailed information. sag is particularly suited for environments with limited computational resources, where large-scale models are impractical. by enhancing static embeddings with graph-based structure, sag achieves an effective balance between efficiency and representational power. the approach aligns with ongoing efforts to reduce the energy and compute costs of nlp systems, offering a scalable solution for domain-adapted retrieval and reasoning. the rest of the paper is structured as follows: section 2 reviews related work on embeddings and rag methods. section 3 outlines the conceptual foundation of our approach. section 4 details the sag architecture and processing pipeline. section 5 presents experimental results on semantic similarity and question answering. section 6 concludes with future directions. ## related work similarity search in high-dimensional vector spaces is a core component of information retrieval and knowledge discovery. faiss @xcite , developed by meta's ai research team, is a widely adopted library that enables scalable similarity search and clustering. it supports both cpu and gpu execution and implements efficient algorithms using techniques like product quantization and inverted indexing. faiss allows rapid retrieval from large datasets while supporting multiple distance metrics, making it a foundational tool for retrieval-augmented systems. learning effective graph representations is essential for tasks such as node classification, link prediction, and clustering. node2vec @xcite addresses this by generating node embeddings through biased random walks that capture various neighborhood structures. by preserving network proximity in the embedding space, node2vec generalizes earlier methods and provides reliable performance across multiple graphbased applications. evaluating retrieval-augmented generation systems in specialized domains like medicine requires robust benchmarks. mirage @xcite offers a comprehensive suite of medical question-answering datasets and an evaluation framework designed to reflect realistic use cases. some of them are bioasq @xcite , medmcqa @xcite , medqa-usmle @xcite , and mmlu-med @xcite . recent advances in biomedical retrieval have leveraged contrastive learning to improve semantic representations. med-cpt @xcite introduces a transformer model trained with contrastive objectives to support zero-shot retrieval in the biomedical domain. it achieves state-of-the-art results on standard benchmarks by generating robust sentence embeddings even in the absence of annotated training pairs. knowledge graphs provide structured representations of domain-specific information, supporting complex reasoning and query answering. in the medical field, the traditional static knowledge graphs are being replaced by adaptive systems that incorporate large language models and domainspecific retrieval tools. these systems automatically extract entities, infer relationships, and build query-specific graphs. frameworks like amg-rag @xcite use these adaptive knowledge graphs in retrieval-augmented pipelines, combining evidence retrieval and reasoning to improve accuracy and interpretability in medical question answering. ## model's philosophy sag is inspired by the hierarchical structure of human cognition, where knowledge is processed from general principles to specific details. this structure is especially prominent in expert domains, where reasoning involves traversing semantic layers-from broad categories to precise instances. we define information specificity as "the range of knowledge from which a sentence is derivable". general statements apply broadly, while specific ones are valid in narrower contexts. consider this spectrum from the biomedical domain: sag operationalizes this cognitive structure as a directed graph: nodes represent text chunks, and edges encode general-to-specific relationships. this graph captures domain-specific knowledge hierarchies, which we leverage to produce semantically rich embeddings tailored for rag systems. ## experiments we evaluated sag on text similarity and ragbased question answering tasks. to optimize training data quality, we utilized the craft 2.0 dataset @xcite containing 67 full-text articles with around 560,000 tokens. our training employed 1024 chunks of 512 tokens each with final static embeddings of size 50. ## limitations despite the promising results, our study is subject to several limitations. first, due to hardware constraints when processing large-scale graphs with python-based backend libraries, the semantic-augmented graph (sag) was restricted to a maximum of 1024 nodes during training and inference. our implementation using networkx for graph operations on million-edge structures faced memory and processing bottlenecks, despite running on dual intel xeon silver 4210 cpus (2.20ghz, 40 total logical cores) and two nvidia gpus (quadro rtx 6000/8000 and rtx 5000). while the node limitation was sufficient for capturing meaningful hierarchical structures, it may have prevented deeper modeling of larger corpora. second, during rag evaluation, only a quarter of the full pubmed dataset was accessible, which may have constrained the retrieval coverage and affected downstream performance. these limitations highlight potential gains from scaling sag with more efficient graph processing backends and accessing larger retrieval corpora. as with any embeddingbased system applied in biomedical contexts, there is a potential risk of encoding latent biases or producing misleading similarity scores that may impact downstream clinical decisions. we recommend caution and further evaluation before deployment in real-world healthcare settings.