Skip to content

Chatbot to use natural language to query trade data from the Atlas of Economic Complexity

License

Notifications You must be signed in to change notification settings

shreyasgm/ask-atlas

Repository files navigation

Ask-Atlas

Ask-Atlas is a chatbot that allows users to ask questions about the Atlas database and receive answers. It is a RAG chatbot that uses Langchain, Streamlit, and OpenAI's LLMs (GPT-4o, GPT-4o-mini).

flowchart TD
    A[User Question] --> B{Check Input Type}
    B -->|Non-trade/Harmful| C[Refuse to Answer]
    B -->|Valid Trade Input| D1[Condense question]
    
    D1 --> D[Get Product Classification]

    D1 --> E{Check for Product Names}
    
    E -->|Products Found| F[Product Lookup]
    E -->|No Products| H[Agentic Query Planning]
    
    D --> F
    
    F -->|Product Codes| H
    D --> D2[Get Schema]
    D2 -->|Schema| H
    
    H --> H1[Generate SQL Query]
    H1 --> H2[Execute Query]
    H2 --> H3{Answer Complete?}
    H3 -->|No| H
    H3 -->|Yes| J[Generate Final Response]
    
    
    style C fill:#ffcccc
    style F fill:#e6f3ff
    style H fill:#e6e6ff
    style J fill:#e6ffe6
Loading

About

Chatbot to use natural language to query trade data from the Atlas of Economic Complexity

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages