How siddhesh-desai/legalaibot works
Project type and purpose
• This is a full-stack, AI-driven RAG (Retrieval-Augmented Generation) application called LegalAIBot.
• It ingests legal PDFs, stores embeddings in Pinecone (vector DB), and serves a Streamlit web UI that answers legal queries using Langchain, a ChatOpenRouter wrapper, and external LLM services.
File structure
• Top-level scripts and modules:
• ingest_data.py & DataIngestor/DataIngestor.py – PDF ingestion → Pinecone.
• LegalAIBot/LegalAIBot.py – core RAG pipeline logic.
• ChatOpenRouter/chat_open_router.py – wrapper for calls to the OpenRouter LLM API.
• app.py – Streamlit front end.
• main.py – example CLI usage of the bot.
• constants.py – shared configuration keys.
• Config & environment: .env.example, .devcontainer/devcontainer.json, requirements.txt.
• Assets: files/*.pdf, media/legalaibot.excalidraw.
README
• Confirms use of Pinecone, Langchain RAG pipeline, LangSmith tracing, OpenRouter, HF tokens, Google API.
• Usage: run ingest_data.py to populate Pinecone, then streamlit run app.py to launch UI.
Detail
• Configuration loading (.env) as a side-component feeding into all modules.
• Keep it high-level but granular enough so developers see where to hook new modules or replace services.