This project is an interactive AI assistant that can answer real-time questions about cryptocurrency prices and world news using tool-augmented language models and LangGraph. It integrates external APIs like GNews and CoinDesk to provide live data, powered by autonomous LLM agents.
This AI assistant can:
Built using:
getWorldNews
, getBitcoinPrice
)in
, us
, jp
)graph.stream()
LangGraph is a library that allows you to build stateful, multi-agent workflows for language models using a graph structure. It extends LangChain by enabling:
LangGraph is ideal for orchestrating tools + agents in real-time, as seen in this project.
getWorldNews(country_code)
Fetches latest headlines for a country using the GNews API. Example:
getBitcoinPrice()
Retrieves real-time Bitcoin price using a crypto API.
Install the required libraries:
pip install langchain-core==0.3.13 pip install langchain==0.2.16 pip install langchain-huggingface==0.1.1 pip install langgraph==0.2.68 pip uninstall -y numpy transformers pip install numpy transformers pip install -qU langchain-groq
Youโll need:
โ GNews API Key for news
โ LLM Provider Key (e.g., Groq or OpenAI)
inputs = { "messages": [ {"role": "user", "content": "You are good at cryptocurrency and world news"}, {"role": "assistant", "content": "Ask me any question."}, {"role": "user", "content": "What are the current situations in India?"} ] }
print_stream(graph.stream(inputs, stream_mode="values"))