https://github.com/dreamingechoes/phoenix_live_view_ai_filters_poc
POC for AI-powered project filtering using OpenAI to generate JSON filters based on user queries in a Phoenix LiveView app.
https://github.com/dreamingechoes/phoenix_live_view_ai_filters_poc
elixir elixir-lang opeanai-api openai phoenix-liveview
Last synced: 4 months ago
JSON representation
POC for AI-powered project filtering using OpenAI to generate JSON filters based on user queries in a Phoenix LiveView app.
- Host: GitHub
- URL: https://github.com/dreamingechoes/phoenix_live_view_ai_filters_poc
- Owner: dreamingechoes
- License: mit
- Created: 2025-02-23T00:27:57.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-02-23T00:48:13.000Z (4 months ago)
- Last Synced: 2025-02-23T01:28:10.334Z (4 months ago)
- Topics: elixir, elixir-lang, opeanai-api, openai, phoenix-liveview
- Language: Elixir
- Homepage: https://dreamingecho.es/blog/building-an-ai-powered-search-input-with-phoenix-liveview
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# **Phoenix LiveView AI Filters POC**
An AI-powered, natural language search input built with **Phoenix LiveView**, **OpenAI**, and **Ecto**. This proof-of-concept demonstrates how to dynamically generate filters from user queries and apply them in real-time without requiring users to manually configure search filters.
## ๐ฅ **Demo**
Watch the demo video: **[Demo Link](https://www.awesomescreenshot.com/video/36903860?key=5dca7faccf4cdef5db3d1c5fdca39908)**.
## โ๏ธ **Configuration**
Before starting the app, set up the **OpenAI API key** in `config/dev.exs`:
```elixir
# OpenAI
config :openai,
api_key: YOUR_OPENAI_API_KEY
```### **OpenAI Setup**
To enable AI-powered search filtering, set up an OpenAI account and obtain an API key:
1. Sign up at [OpenAI](https://openai.com)
2. Retrieve your **API Key** from the OpenAI dashboard
3. Replace `YOUR_OPENAI_API_KEY` in `config/dev.exs` with your actual key---
## ๐ **Getting Started**
Follow these steps to set up and run the application:
### **1๏ธโฃ Clone the Repository**
```sh
git clone
cd phoenix_liveview_ai_filters_poc
```### **2๏ธโฃ Set Up Configuration**
Modify `config/dev.exs` with your OpenAI API credentials.
### **3๏ธโฃ Install Dependencies**
```sh
mix deps.get
```### **4๏ธโฃ Set Up the Database**
```sh
mix ecto.create
mix ecto.migrate
```### **5๏ธโฃ Start the Application**
```sh
iex -S mix phx.server
```Open your browser and visit: **http://localhost:4000/projects**
## ๐งช **Running Tests**
To run the test suite, execute the following command:
```sh
mix test
```## โจ **Features**
๐ **Natural Language Search** โ Users type queries naturally, and AI converts them into structured filters.
๐ **Real-Time Updates** โ **Phoenix LiveView** ensures search results update instantly without reloading the page.
๐ **AI-Powered Filtering** โ **OpenAI GPT-4** translates user queries into **Ecto-compatible filters**.
๐ **Multi-Language Support** โ AI understands and processes queries in multiple languages.
๐ **Scalable & Flexible** โ The search system can be expanded to support additional data sources.## ๐ **License**
This project is licensed under the **MIT License**. See the [LICENSE](./LICENSE) file for more details.