Ask PDX is an experimental implementation of Retrieval Augmented Generation (RAG) using the Portland City Charter and Code. Users can ask questions about the City Charter and Code using natural language, and receive an answer back including the sources used as context for the answer. If you are interested in trying out my implementation, you can do so at https://askpdx.streamlit.app/.

Residents of a city may be interested in how the local government is structured and how it operates. This information is generally publicly available, but finding the information and understanding it can be overwhelming.

The recent emergence of foundation LLMs, have made conversational interfaces much easier to implement and much more practical. Using Retrieval Augmented Generation (RAG) can greatly improve the capability and reliability of these interfaces by providing relevant context from actual documents, and identifying the source of the answers to users.

Project Details:

  1. Data Collection:

    • Source: The Charter and Code documents were scraped from the official portland.gov website.
  2. Embedding & Retrieval Store Creation:

    • Technology Utilized: OpenAI embeddings combined with the FAISS (Facebook AI Similarity Search) library.
    • Purpose: These technologies work in tandem to create a retrieval store. When a question is posed, the system rapidly scans through this store to find the most relevant sections of the Charter and Code, ensuring that the generated answers are contextually accurate.
  3. Conversational Interface:

    • Platforms: OpenAI, Langchain, and Streamlit.
    • Functionality: These platforms allow for a user-friendly, conversational interface. Users can intuitively ask questions in natural language, and the system responds with precise answers.
    • Added Feature: For credibility and further exploration, answers are provided alongside their exact sources from the Charter and Code. This ensures users not only receive information but can also understand its contextual placement within the official documents.

Feedback and Suggestions: This is an experimental, proof of concept implementation. If you have suggestions, insights, or encounter any issues, please reach out or open an issue on the project’s Github page.