Galaxia is GraphRAG solution, which automates document processing, knowledge base (Graph Language Model) creation and retrieval:
galaxia-ragTo use Galaxia first upload your texts and create a Graph Language Model here: smabbler-cloudAfter the model is built and activated, you will be able to use this integration to retrieve what you need.The module repository is located here: github
Before you can retrieve anything you need to create your Graph Language Model here: smabbler-cloudfollowing these 3 simple steps: rag-instructionDon’t forget to activate the model after building it!
from langchain_galaxia_retriever.retriever import GalaxiaRetrievergr = GalaxiaRetriever( api_url="beta.api.smabbler.com", api_key="<key>", # you can find it here: https://beta.cloud.smabbler.com/user/account knowledge_base_id="<knowledge_base_id>", # you can find it in https://beta.cloud.smabbler.com , in the model table n_retries=10, wait_time=5,)
from langchain_core.output_parsers import StrOutputParserfrom langchain_core.prompts import ChatPromptTemplatefrom langchain_core.runnables import RunnablePassthroughprompt = ChatPromptTemplate.from_template( """Answer the question based only on the context provided.Context: {context}Question: {question}""")def format_docs(docs): return "\n\n".join(doc.page_content for doc in docs)chain = ( {"context": gr | format_docs, "question": RunnablePassthrough()} | prompt | llm | StrOutputParser())