{"id":24873726,"url":"https://github.com/shinobi-josh/FastAPI-LangChain-QA-Manager","last_synced_at":"2025-12-30T22:40:01.352Z","repository":{"id":275105885,"uuid":"925086341","full_name":"Joshua-Briggs/FastAPI-LangChain-QA-Manager","owner":"Joshua-Briggs","description":"A FastAPI application combining AI question-answering with PostgreSQL storage.  Built with LangChain and OpenAI's GPT models for intelligent responses, using  SQLAlchemy ORM for data persistence. Features RESTful API endpoints for CRUD  operations with Pydantic validation and Swagger documentation.","archived":false,"fork":false,"pushed_at":"2025-01-31T12:28:11.000Z","size":111,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T00:54:20.823Z","etag":null,"topics":["fastapi","fastapi-template","jupyter-notebook","langchain","llm","openai","postgresql-database","python","sqlalchemy"],"latest_commit_sha":null,"homepage":"https://medium.com/@joshua_briggs/building-an-ai-powered-q-a-api-with-fastapi-langchain-and-postgresql-8cffbc7f3e35","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/Joshua-Briggs.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-01-31T07:42:03.000Z","updated_at":"2025-01-31T12:29:21.000Z","dependencies_parsed_at":"2025-03-27T00:42:45.885Z","dependency_job_id":"c46693fc-e2ed-404f-b1f0-a9347c45b23a","html_url":"https://github.com/Joshua-Briggs/FastAPI-LangChain-QA-Manager","commit_stats":null,"previous_names":["joshua-briggs/fastapi-course","joshua-briggs/fastapi-langchain-postgresql-application"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joshua-Briggs%2FFastAPI-LangChain-QA-Manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joshua-Briggs%2FFastAPI-LangChain-QA-Manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joshua-Briggs%2FFastAPI-LangChain-QA-Manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joshua-Briggs%2FFastAPI-LangChain-QA-Manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Joshua-Briggs","download_url":"https://codeload.github.com/Joshua-Briggs/FastAPI-LangChain-QA-Manager/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Joshua-Briggs%2FFastAPI-LangChain-QA-Manager/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259117937,"owners_count":22807861,"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":["fastapi","fastapi-template","jupyter-notebook","langchain","llm","openai","postgresql-database","python","sqlalchemy"],"created_at":"2025-02-01T06:16:54.827Z","updated_at":"2025-12-30T22:40:01.292Z","avatar_url":"https://github.com/Joshua-Briggs.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FastAPI-LangChain-QA-Manager\n\nA modern web application built with **FastAPI** that combines **AI-powered** question answering with a **PostgreSQL** database backend.\n\n## ✨ Key Features\n- 🚀 RESTful API endpoints built with `FastAPI` for high performance and async support\n- 🗄️ PostgreSQL database integration using `SQLAlchemy ORM`\n- 🤖 AI-powered question answering using `LangChain` and `OpenAI's GPT` models\n- ⚡ CRUD operations for managing questions and answers\n- 📚 Automatic API documentation with `OpenAPI/Swagger UI`\n\n## 🛠️ Tech Stack\n- **FastAPI**: Modern, fast web framework for building APIs\n- **PostgreSQL**: Robust relational database for data persistence\n- **SQLAlchemy**: Powerful SQL toolkit and ORM for Python\n- **LangChain**: Framework for developing applications powered by language models\n- **OpenAI**: State-of-the-art GPT models for natural language processing\n- **Pydantic**: Data validation using Python type annotations\n\n## 🎯 Application Features\nThe application enables users to:\n1. 📝 Create and manage questions and answers\n2. 🤖 Generate AI-powered responses using OpenAI's language models\n3. 💾 Store and retrieve QA pairs from PostgreSQL database\n4. 🔄 Perform full CRUD operations through RESTful endpoints\n\n---\n\n## 🚀 Getting Started\n\n### Prerequisites\n1. **PostgreSQL Server**\n   - Download and register server on PostgreSQL\n   - Configure database connection in `database.py`\n\n2. **OpenAI API Key**\n   - Create an OpenAI API key\n   - Add it to `langchain_answers.py`\n\n### Installation\n1. Install dependencies:\n   ```bash\n   # Import all directories from pyproject.toml\n   poetry install\n   ```\n\n2. Navigate to project directory:\n   ```bash\n   cd FastAPIApplication\n   ```\n\n3. Start the server:\n   ```bash\n   uvicorn main:app --reload\n   ```\n\n4. View API documentation:\n   - Open your browser and go to `http://127.0.0.1:8000/docs`\n   - Interactive Swagger UI will be available for testing endpoints\n   - Inside the `caller.ipynb` you can also call endpoints through the local session\n\n---\n\n## 📝 Notes\n- Ensure all environment variables are properly set\n- Check database connection before starting the application\n- Make sure OpenAI API key is valid and has sufficient credits\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshinobi-josh%2FFastAPI-LangChain-QA-Manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshinobi-josh%2FFastAPI-LangChain-QA-Manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshinobi-josh%2FFastAPI-LangChain-QA-Manager/lists"}