@misc{CamargodaSilva2025, type = {Master Thesis}, author = {Camargo da Silva, Thayn{\´a}}, title = {Extracting knowledge graphs from user stories using LangChain}, doi = {10.26127/BTUOpen-7038}, url = {http://nbn-resolving.de/urn:nbn:de:kobv:co1-opus4-70382}, school = {BTU Cottbus - Senftenberg}, year = {2025}, abstract = {Requirements engineering is a fundamental component in software engineering since it defines the software from the user's perspective. In this context, user stories play a crucial role since they are simple, natural language descriptions of software requirements, and they are widely utilized in the industry, along with the agile development methodology. User stories, while valuable for capturing individual functionalities, offer a limited perspective of the overall system, hindering maintainability and comprehension. To address these challenges, extracting structured information and modeling user stories is crucial. Knowledge graphs offer a promising approach by providing a visual and structured representation of user stories, facilitating data storage and analysis, and reducing manual effort retrieval, leading to a more coherent and manageable system. Several methodologies to model stories employ Natural Language Processing (NLP) techniques, presenting limited precision, complex implementation, and difficulties to interpret a sentence [47]. Recent research has explored using large language models, such as ChatGPT-3.5 [1], to extract knowledge graph components (nodes and relationships) from user stories. However, the solution relies on specific models and lacks comprehensive data processing pipelines for constructing knowledge graphs. LangChain, a model-agnostic framework, is a promising tool that empowers the development of applications centered around large language models. Its adaptability extends to knowledge graph construction, facilitating the extraction of structured information from textual data and seamless integration with graph databases. This thesis introduces a novel methodology for the automated generation of knowledge graphs from user stories by leveraging the advanced capabilities of Large Language Models (LLMs). Utilizing the LangChain framework as a basis, the UserStoryGraph- Transformer (USGT) module was developed to extract nodes and relationships from user stories using an LLM to construct accurate knowledge graphs. This innovative technique was implemented in a script to fully automate the knowledge graph extraction process. Additionally, the evaluation was automated through a dedicated evaluation script, utilizing an annotated dataset for assessment. By enhancing the visualization and understanding of user requirements and domain concepts, this method fosters better alignment between software functionalities and user expectations, ultimately contributing to more effective and user-centric software development processes.}, subject = {Knowledge graph; Requirements engineering; Langchain; User story; Large language models; Neo4j; Wissensgraphen; Anforderungsanalyse; Anwendererz{\"a}hlung; Requirements engineering; Großes Sprachmodell; Wissensgraph}, language = {en} }