A Streamlit application that lets you look up any public figure and instantly see:
- 🧠 A concise biography
- 🎂 Date of birth
- 🏆 Notable works or accomplishments
- 🌐 Major world events around their birth
- 🔍 A Google top snippet via SerperAPI
- 🖼️ Their portrait fetched from Wikipedia
Built with LangChain + OpenAI + Streamlit + SerperAPI + Python-Wikipedia.
- Multi‐step LLM chains (bio → DOB → events → works) via LangChain
- Real-time search snippets from Google (SerperAPI)
- Portrait images from Wikipedia
- Attractive multipage UI (Search / History / About)
- “New Search” button to reset inputs
- Conversation history viewer
- Secure API key loading via
.env
- Clone the repository
git clone https://github.com/your-username/celebrity-search.git cd celebrity-search
- Create & activate a virtual environment
python3 -m venv .venv source .venv/bin/activate # Linux / macOS .venv\Scripts\activate # Windows
- Install dependencies
python3 -m venv .venv
⚙️ Configuration Create a .env file in the project root with the following variables:
OPENAI_API_KEY=your_openai_api_key
GOOGLE_API_KEY=your_gcp_api_key
SERPER_API_KEY=your_serper_api_key
- Run as a CLI
streamlit run app.py
🔍 Search: Enter a celebrity name, click Search → view image, Google snippet, bio, DOB, works, events.
🔄 New Search: Clear results and enter a new name.
📖 History: See your past queries for each LLM prompt.
⚙️ About: Overview and credits.
-
Adjust LLM behavior
Modify thetemperature
,max_tokens
, ormodel_name
parameters inagents/chains.py
to tune response creativity and length. -
Add new LLM prompts
- Define a new
PromptTemplate
inagents/chains.py
. - Create an
LLMChain
with your template (and optionalConversationBufferMemory
). - Include it in the
SequentialChain
(parent_chain
) so it runs as part of the workflow.
- Define a new
-
Swap or extend image sources
Inclients/wiki_client.py
, replace or augment the Wikipedia fetcher—e.g. integrate Unsplash, Google Images, or another API by writing a new client module. -
Customize Google snippet logic
Inclients/serper_client.py
, adjust the query parameters (likenum
) or parse additional fields (e.g. source URLs, titles) from the SerperAPI response. -
Streamlit UI tweaks
- Change layout in
pages/search_page.py
by usingst.columns
,st.tabs
, or adding custom CSS via:st.markdown( "<style>...your CSS here...</style>", unsafe_allow_html=True )
- Add new pages: update the
st.sidebar.radio
inapp.py
, then create corresponding modules underpages/
.
- Change layout in
-
Theming
Add a.streamlit/theme.toml
file to control colors, fonts, and layout presets.[theme] primaryColor = "#1f77b4" backgroundColor = "#f5f5f5" font = "sans serif"