{"id":25926826,"url":"https://github.com/pakagronglb/python-rag-agent-pydantic-ai","last_synced_at":"2026-04-12T02:32:36.603Z","repository":{"id":280361440,"uuid":"941734303","full_name":"pakagronglb/python-rag-agent-pydantic-ai","owner":"pakagronglb","description":"A powerful property information assistant built with Python, OpenAI, and LanceDB that uses Retrieval Augmented Generation (RAG) to answer questions about property listings.","archived":false,"fork":false,"pushed_at":"2025-03-03T01:25:37.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-03T01:27:49.643Z","etag":null,"topics":["lancedb","openai","pydantic","pydantic-ai","python","rag","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/pakagronglb.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-03T00:34:25.000Z","updated_at":"2025-03-03T01:25:41.000Z","dependencies_parsed_at":"2025-03-03T01:37:54.712Z","dependency_job_id":null,"html_url":"https://github.com/pakagronglb/python-rag-agent-pydantic-ai","commit_stats":null,"previous_names":["pakagronglb/python-rag-agent-pantic-ai"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pakagronglb%2Fpython-rag-agent-pydantic-ai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pakagronglb%2Fpython-rag-agent-pydantic-ai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pakagronglb%2Fpython-rag-agent-pydantic-ai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pakagronglb%2Fpython-rag-agent-pydantic-ai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pakagronglb","download_url":"https://codeload.github.com/pakagronglb/python-rag-agent-pydantic-ai/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":["lancedb","openai","pydantic","pydantic-ai","python","rag","streamlit"],"created_at":"2025-03-03T20:03:24.650Z","updated_at":"2026-04-12T02:32:36.567Z","avatar_url":"https://github.com/pakagronglb.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🏠 Property Information RAG Assistant\n\nA powerful property information assistant built with Python, OpenAI, and LanceDB that uses Retrieval Augmented Generation (RAG) to answer questions about property listings.\n\n[![Python](https://img.shields.io/badge/Python-3.13-blue.svg)](https://www.python.org/)\n[![OpenAI](https://img.shields.io/badge/OpenAI-GPT--4o-green.svg)](https://openai.com/)\n[![LanceDB](https://img.shields.io/badge/LanceDB-0.20.0-orange.svg)](https://lancedb.com/)\n[![Streamlit](https://img.shields.io/badge/Streamlit-1.42.2-red.svg)](https://streamlit.io/)\n[![Pydantic](https://img.shields.io/badge/Pydantic-2.10.6-purple.svg)](https://pydantic.dev/)\n\n## 🚀 Features\n\n- **Vector Search**: Fast and accurate semantic search using LanceDB and OpenAI embeddings\n- **Conversational UI**: Clean user interface built with Streamlit\n- **Rich Property Information**: Query details about properties, including:\n  - Pet policies (allowed pets, fees, weight limits)\n  - Location information\n  - Amenities and features\n  - Pricing details\n- **Intelligent Query Understanding**: Converts natural language questions into optimized search queries\n- **Well-formatted Responses**: Clear, structured answers with relevant property details\n\n## 📋 Table of Contents\n\n- [Installation](#installation)\n- [Usage](#usage)\n- [Project Structure](#project-structure)\n- [How It Works](#how-it-works)\n- [Credits](#credits)\n- [License](#license)\n\n## 🔧 Installation\n\n1. Clone the repository:\n   ```bash\n   git clone http://www.github.com/pakagronglb/python-rag-agent-pydantic-ai\n   cd python-rag-agent-pantic-ai\n   ```\n\n2. Create and activate a virtual environment:\n   ```bash\n   python -m venv venv\n   source venv/bin/activate  # On Windows: venv\\Scripts\\activate\n   ```\n\n3. Install the required packages:\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n4. Set up your OpenAI API key in a `.env` file:\n   ```\n   OPENAI_API_KEY=your_api_key_here\n   ```\n\n## 💻 Usage\n\n1. Run the setup script to initialize the knowledge base:\n   ```bash\n   python lancedb_setup.py\n   ```\n\n2. Launch the Streamlit web interface:\n   ```bash\n   python -m streamlit run app.py\n   ```\n\n3. Open your browser and navigate to:\n   ```\n   http://localhost:8501\n   ```\n\n4. Enter your property-related questions in the input field and click \"Search\"\n\n## 🏗️ Project Structure\n\n- `app.py`: Streamlit web interface\n- `agent_run.py`: Command-line version of the query agent\n- `lancedb_setup.py`: Knowledge base setup and vector database operations\n- `knowledge-file/`: Directory containing markdown property information files\n\n## ⚙️ How It Works\n\n1. **Data Ingestion**: Property information is stored as markdown files in the `knowledge-file` directory\n2. **Vector Embedding**: The text is chunked and embedded using OpenAI's text-embedding-3-small model\n3. **Query Processing**: User queries are converted to optimized search queries using an LLM\n4. **Vector Search**: LanceDB retrieves the most semantically similar documents\n5. **Response Generation**: An LLM generates a well-formatted response based on the retrieved context\n\n## 🙏 Credits\n\nThis project was inspired by [Jie Jenn's YouTube tutorial](https://www.youtube.com/watch?v=P212vYt6Xo8) on building RAG applications with Python. His clear explanations and practical approach were instrumental in creating this application.\n\n## 📄 License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n\n🏠 Property Information Assistant\n    [Header]\n\nAsk a Question\n    [Input Form with background]\n    [Full-width Search button]\n\n📝 Response\n    [Response area with background]\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpakagronglb%2Fpython-rag-agent-pydantic-ai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpakagronglb%2Fpython-rag-agent-pydantic-ai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpakagronglb%2Fpython-rag-agent-pydantic-ai/lists"}