{"id":25926878,"url":"https://github.com/tejas-130704/pdf_assistant","last_synced_at":"2026-04-29T23:05:05.576Z","repository":{"id":280095281,"uuid":"940968713","full_name":"tejas-130704/PDF_Assistant","owner":"tejas-130704","description":"Open-Source PDF Assistant: This tool allows users to ask questions based on the content of a PDF by simply providing a link to the document. It leverages Docker to create a vector database using pgvector for efficient text retrieval, ensuring unlimited queries without OpenAI embedder limitations. 🚀📄","archived":false,"fork":false,"pushed_at":"2025-03-01T07:25:30.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-01T08:18:36.376Z","etag":null,"topics":["agentic-ai","docker","docker-compose","mlop","open-source","pdf-assistant","pgvector","phidata-framework","python","streamlit"],"latest_commit_sha":null,"homepage":"","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/tejas-130704.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":"2025-03-01T06:52:54.000Z","updated_at":"2025-03-01T07:26:00.000Z","dependencies_parsed_at":"2025-03-01T08:28:53.417Z","dependency_job_id":null,"html_url":"https://github.com/tejas-130704/PDF_Assistant","commit_stats":null,"previous_names":["tejas-130704/pdf_assistant"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tejas-130704%2FPDF_Assistant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tejas-130704%2FPDF_Assistant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tejas-130704%2FPDF_Assistant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tejas-130704%2FPDF_Assistant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tejas-130704","download_url":"https://codeload.github.com/tejas-130704/PDF_Assistant/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241731744,"owners_count":20010781,"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":["agentic-ai","docker","docker-compose","mlop","open-source","pdf-assistant","pgvector","phidata-framework","python","streamlit"],"created_at":"2025-03-03T20:03:42.343Z","updated_at":"2025-10-26T17:10:21.974Z","avatar_url":"https://github.com/tejas-130704.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚀 AI-Powered Knowledge Base with pgvector and Sentence Transformer 🧠📚\n\n## 🌟 Overview\nThis project utilizes **pgvector** for vector-based storage and retrieval, combined with an **open-source sentence transformer** for text embedding. The default OpenAI embedder requires an API key, which may exceed credit limits; thus, we configure the system to use a **sentence transformer model with 1024 dimensions** instead of the default 1536 dimensions.\n\n### 🔥 Open-Source PDF Assistant\nI have created an **open-source PDF assistant** that eliminates the limitations imposed by OpenAI's embedder. This assistant can be used **without any restrictions**, allowing unlimited queries and document processing.\nThis project utilizes **pgvector** for vector-based storage and retrieval, combined with an **open-source sentence transformer** for text embedding. The default OpenAI embedder requires an API key, which may exceed credit limits; thus, we configure the system to use a **sentence transformer model with 1024 dimensions** instead of the default 1536 dimensions.\n\n## 🛠️ Setup Instructions\n\n### ✅ Prerequisites\n- 🐳 **Docker \u0026 Docker Compose** installed\n- 🐍 **Python 3.8+** installed\n- 🗄️ **PostgreSQL with pgvector extension** enabled\n- 🌐 **Streamlit** for the frontend\n\n### 🚀 Running the Project\n\n#### Step 0: 🔗 Clone the GitHub Repository\nFirst, clone the project repository from GitHub:\n```bash\ngit clone https://github.com/tejas-130704/PDF_Assistant.git\ncd PDF_Assistant\n```\n\n#### Step 1: 🏗️ Start pgvector with Docker\nEnsure your `docker-compose.yaml` file is correctly set up, then run:\n```bash\ndocker-compose up -d\n```\n\n#### Step 2: 🗄️ Configure the Database\nAfter the Docker container is running, execute the following commands:\n```bash\ndocker exec -it \u003ccontainer_id\u003e psql -U root -d mydb\n```\nReplace `\u003ccontainer_id\u003e` with the actual container ID (can be found using `docker ps`).\n\nConnect to the database:\n```sql\n\\c mydb\n```\n\nCheck existing tables:\n```sql\n\\dt\n```\n\nDrop the existing embeddings table if it exists:\n```sql\nDROP TABLE IF EXISTS ai.embeddings;\n```\n\nCreate the new table with **1024-dimensional embeddings**:\n```sql\nCREATE TABLE ai.embeddings (\n    id VARCHAR PRIMARY KEY,\n    name VARCHAR NOT NULL,\n    meta_data JSONB,\n    filters JSONB,\n    content TEXT NOT NULL,\n    embedding vector(1024), -- Adjusted to match the embedding model dimensions\n    usage JSONB,\n    content_hash VARCHAR UNIQUE\n);\n```\n\nVerify that the table was created successfully:\n```sql\n\\dt ai.*\n```\n\n#### Step 3: 📦 Install Dependencies\nNavigate to your project directory and install required packages:\n```bash\npip install -r requirements.txt\n```\n\n#### Step 4: 🚀 Run the Application\nStart the Streamlit application:\n```bash\nstreamlit run app.py\n```\n\nOnce running, open your browser and go to:\n```\nhttp://localhost:8501/\n```\n\n#### Step 5: 📚 Load the Knowledge Base\n1. **Add `GROQ_API_KEY`** in the sidebar.\n2. **Provide the PDF link** containing knowledge base content.\n3. Click **\"Load Knowledge Base\"**.\n4. Once you see the message **\"Knowledge Base Loaded Successfully!\"**, you can start asking questions. 🎉\n\n## Screenshots\n\n![Screenshot 2025-03-01 125025](https://github.com/user-attachments/assets/b11523bf-e020-411e-9ea2-6e1e5b522d9a)\n\n\n![Screenshot 2025-03-01 125213](https://github.com/user-attachments/assets/0365dc00-7dbe-407d-84d2-5324915be8f4)\n\n\n\n## 🛠️ Troubleshooting\n- ⚠️ If you get an error about mismatched vector dimensions, ensure that the **embedding dimension in PostgreSQL matches the sentence transformer (1024)**.\n- 🛑 If OpenAI is still being used, check that your Python script is correctly configured to use **sentence transformers instead of OpenAI embeddings**.\n- ✅ Ensure that all required dependencies are installed using `pip install -r requirements.txt`.\n\n## 🚀 Future Enhancements\n- 🔒 Adding **user authentication** for secure access\n- 🚀 Implementing **cache storage** to speed up repeated queries\n- 🎨 Enhancing **UI/UX** for a more interactive experience\n\n## 🎖️ Contributors\n- **Tejas Narayan Jadhav** - [GitHub](https://github.com/tejas-130704)\n\n🤝 Feel free to contribute by submitting pull requests or reporting issues! 🚀\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftejas-130704%2Fpdf_assistant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftejas-130704%2Fpdf_assistant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftejas-130704%2Fpdf_assistant/lists"}