Skip to content
i0Ta07Public

About

An Agentic chatbot capable of Memory, Streaming, Tools, RAG and Observability.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Phoenix - Agentic Chatbot

A conversational AI agent built with LangGraph and Streamlit, featuring persistent memory with PostgreSQL, real-time streaming, multi-tool integration, and document/video Q&A capabilities with full observability. Try it live here.

Please mind occasional Groq API errors, free tier has rate limitations. Since this is a shared demo, the database resets every day using Github Actions (disabled for now due to no usage). Also, the app is deployed on Streamlit, that uses AWS servers. The YT subtitles API blocks IPs originating from AWS servers. Hence, during deployment you cannot ask question about a YT video.

Core Features

Persistent Memory

  • PostgreSQL-based checkpoint persistence for reliability
  • Thread-based conversation storage across sessions
  • Reload previous conversations seamlessly
  • Short-term memory implementation for context-aware responses

Real-Time Streaming

  • Token-by-token streaming for improved user experience
  • Live tool execution feedback (e.g., "Calling get_weather... Processing... Done")
  • Asynchronous response generation with visual indicators

Multi-Tool Integration

Four production-ready tools with streaming output:

  1. Calculator - Mathematical computations
  2. DuckDuckGo Search - Web search integration
  3. Currency Converter - Real-time exchange rates
  4. Weather API - Current weather data

PDF Question Answering

  • Upload one PDF per chat
  • Ask questions grounded strictly in that document
  • RAG-based retrieval for accurate answers
  • To query another PDF, start a new chat

YouTube Video Q&A

  • Provide one YouTube video per chat
  • Ask questions based on the video transcript
  • Semantic search across video content
  • To analyze a different video, start a new chat

Full Observability

  • LangSmith integration for debugging and monitoring
  • Trace all LLM calls, tool executions, and agent decisions
  • Performance analytics and error tracking

Interactive Frontend

  • Built with Streamlit for rapid prototyping
  • Clean, responsive UI with real-time updates
  • Easy deployment and customization

Setup

Prerequisites

  • Python 3.10+
  • uv package manager
  • PostgreSQL 12+ installed and running

Installation

  1. Clone the repository

    git clone https://github.com/i0Ta07/Phoenix
    cd Phoenix
  2. Install dependencies

    uv sync
  3. Set up PostgreSQL database

    -- Create the user 
    CREATE USER phoenix_user WITH PASSWORD 'your_password';
    
    -- Create the database with this user as owner
    CREATE DATABASE phoenix_db OWNER phoenix_user;
    
    -- Connect to the new database
    \c phoenix_db
    
    -- Grant schema privileges (phoenix_user already owns the database, but this ensures they can create objects)
    GRANT ALL PRIVILEGES ON SCHEMA public TO phoenix_user;
    
    -- For future tables/sequences created by ANY user, grant access to phoenix_user
    ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON TABLES TO phoenix_user;
    ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT ALL ON SEQUENCES TO phoenix_user;
  4. Configure environment variables

    Create a .env file in the root directory:

    # Groq
    GROQ_API_KEY=your_groq_key
    
    # LangSmith Observability
    LANGSMITH_API_KEY=your_langsmith_key
    LANGCHAIN_TRACING=true
    LANGSMITH_ENDPOINT=https://api.smith.langchain.com
    LANGCHAIN_PROJECT=phoenix
    
    # ExchangeRate API
    EXCHANGE_API_KEY=your_exchange_rate_api_key
    
    # Hugging Face Token
    HF_TOKEN = "your_hugging_face_token"
    
    # PostgreSQL Database
    DB_URL="postgresql://phoenix_user:your_password@localhost:5432/phoenix_db"
  5. Launch the application

    cd main
    uv run streamlit run main/frontend.py

Deployment

Phoenix is deployed on Streamlit Cloud.

Component Service
Hosting Streamlit Cloud
LLM Inference Groq (gpt-oss-120b,gpt-oss-20b)
Embeddings HuggingFace (all-MiniLM-L6-v2)
Database Neon DB (Serverless Postgres)
DB Reset GitHub Actions (every day (disabled due to low usage now))

UI

UI

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

Acknowledgments

Built with LangChain, LangGraph, and Streamlit

About

An Agentic chatbot capable of Memory, Streaming, Tools, RAG and Observability.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages