{"id":19379267,"url":"https://github.com/praadnya/llm_rag","last_synced_at":"2025-06-10T17:09:38.919Z","repository":{"id":219275833,"uuid":"748617961","full_name":"Praadnya/LLM_RAG","owner":"Praadnya","description":null,"archived":false,"fork":false,"pushed_at":"2024-01-26T12:32:03.000Z","size":66,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-24T16:32:19.210Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Praadnya.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-26T11:41:56.000Z","updated_at":"2024-01-26T12:26:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"57e39ea9-8c92-4394-b3e6-ac33d8c39724","html_url":"https://github.com/Praadnya/LLM_RAG","commit_stats":null,"previous_names":["praadnya/llm_rag"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Praadnya%2FLLM_RAG","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Praadnya%2FLLM_RAG/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Praadnya%2FLLM_RAG/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Praadnya%2FLLM_RAG/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Praadnya","download_url":"https://codeload.github.com/Praadnya/LLM_RAG/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Praadnya%2FLLM_RAG/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259114542,"owners_count":22807251,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T09:09:34.193Z","updated_at":"2025-06-10T17:09:38.895Z","avatar_url":"https://github.com/Praadnya.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"### RAG Pipeline:\n\n**Components:**\n\n- **Reader (`reader.py`):** Responsible for reading documents, extracting their content, and providing it for further processing.\n- **Adapter (`adapter.py`):** Segments the document content into smaller chunks to facilitate processing and analysis.\n- **Embedder (`embedder.py`):** Embeds the chunks of text into numerical vectors, typically using pre-trained language models.\n- **Vector Database (`vector_database.py`):** Stores the embeddings of document chunks in a database, enabling efficient retrieval based on queries.\n- **LLM(`llm.py`):** GPT4All model used with gptj as backend to generate the response.\n\n  testpdf is an example document to run the RAG pipeline.\n\n  ### test.py as the below flow:\n  **Pipeline Execution:**\n\n- The pipeline begins with the **`reader`** loading a document and extracting its content.\n- The **`adapter`** then segments the content into chunks.\n- The **`embedder`** processes each chunk to generate embeddings, representing the semantic content of the text.\n- The embeddings, along with metadata, are stored in the **`vector_database`** for later retrieval.\n\n**Querying and Retrieval:**\n\n- A sample query (e.g., a question) is embedded using the same **`embedder`**.\n- The **`vector_database`** is queried with the embedded query to retrieve the most relevant chunks.\n- The retrieved chunks can serve as potential answers or relevant information.\n\n**Language Model (LLM - Language Model):**\n\n- The **`llm.py`** module integrates a language model (e.g., GPT-4) to generate responses based on a given context and query.\n- It uses the processed document chunks as context and a user-provided query to generate responses.\n\n**Configurations:**\n\n- Configuration parameters such as **`chunk_size`**, **`chunk_overlap`**, and model paths are used to customize the behavior of each component.\n- Embedding models and backend configurations(gptj) are specified for the language model.\n\n**Prompt Template:**\n\n- A **`PromptTemplate`** is used to format the input prompt for GPT-J, including placeholders for the context and query. This template aids in constructing a coherent prompt for the model.\n  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpraadnya%2Fllm_rag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpraadnya%2Fllm_rag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpraadnya%2Fllm_rag/lists"}