Skip to content

Rakshath66/Assistant-Research-Agent-LangChain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

18 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ”Ž Assistant Research Agent โ€” LangChain + Mistral + Streamlit

A smart multi-tool AI research assistant that reads PDFs, searches the web, queries Wikipedia, solves math, and explains every step it takes โ€” all using LangChain Agents and Mistral-7B via OpenAI.

โœ… Built with: LangChain, Streamlit, Mistral-7B, Tavily, PyMuPDF, Wikipedia, PythonREPL

GitHub Repo stars GitHub forks MIT License


๐Ÿ“ธ Preview

image


๐Ÿง  Features

  • ๐Ÿ“„ Summarize PDFs
  • ๐ŸŒ Search the Web using Tavily
  • ๐Ÿ“š Get facts from Wikipedia
  • ๐Ÿงฎ Solve math with Python REPL
  • ๐Ÿ” Custom reverse tool
  • ๐Ÿ’ฌ Multi-turn memory
  • ๐Ÿช„ Shows Chain-of-Thought (Thought โ†’ Action โ†’ Result)
  • โœ… Tool usage checklist
  • ๐ŸŽจ Clean Streamlit UI

๐Ÿš€ Getting Started

๐Ÿ”ง Prerequisites


๐Ÿ–ฅ๏ธ Local Installation

# 1. Clone this repo
git clone https://github.com/Rakshath66/Assistant-Research-Agent-LangChain.git
cd Assistant-Research-Agent-LangChain

# 2. Create virtual environment (optional but recommended)
python -m venv venv
source venv/bin/activate  # or venv\Scripts\activate on Windows

# 3. Install dependencies
pip install -r requirements.txt

# 4. Add your API keys in .env
echo "OPENAI_API_KEY=your_openai_key" >> .env
echo "TAVILY_API_KEY=your_tavily_key" >> .env

# 5. Launch the app
streamlit run src/streamlit_app.py

๐Ÿ—‚๏ธ Project Structure

Assistant-Research-Agent-LangChain/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ streamlit_app.py     # Main UI and agent setup
โ”‚   โ””โ”€โ”€ agent_tools.py       # Custom LangChain tools
โ”œโ”€โ”€ requirements.txt         # All Python dependencies
โ”œโ”€โ”€ .env.example             # Sample env format
โ””โ”€โ”€ README.md

๐Ÿ” Environment Variables

Create a .env file (or set in Streamlit Secrets):

OPENAI_API_KEY=your_openai_key
TAVILY_API_KEY=your_tavily_key

If you're using Streamlit Cloud, paste this into Settings โ†’ Secrets:

OPENAI_API_KEY = "sk-..."
TAVILY_API_KEY = "tvly-..."

๐Ÿงช Try Questions Like

  • โ€œWhat projects did Rakshath work on in the uploaded PDF?โ€
  • โ€œSummarize Wikipedia on LangChain.โ€
  • โ€œWho is Elon Musk? Square the number of years since his birth.โ€
  • โ€œReverse the string โ€˜LangChain Rocks!โ€™โ€

๐Ÿค Contributing

We welcome contributions! Here's how you can help:

โœ… Steps To Contribute:

  1. Fork this repository
  2. Clone your fork: git clone https://github.com/Rakshath66/Assistant-Research-Agent-LangChain.git
  3. Create a new branch: git checkout -b feature/my-feature
  4. Make your changes, commit, and push: git commit -m "Add: my feature" git push origin feature/my-feature
  5. Open a Pull Request with a description of your changes

๐Ÿ” Please write clean readable code, add docstrings if needed, and test your features!


๐Ÿ“ƒ License

MIT License ยฉ Rakshath U Shetty

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software... [rest of MIT license]

โญ Star this project if you like it!

It helps others discover it, and motivates me to build more free AI tools. Also, feel free to open issues, request features, or contribute.


๐Ÿง‘โ€๐Ÿ’ป Built by Rakshath U Shetty

  • Open source forever
  • Designed for learning, research, and practical use
  • Reach out via issues or PRs โ€” ideas welcome!

What Next? This project is just the beginning. Weโ€™re building a production-ready RAG Agent that evolves over time. Here's the full roadmap after completing the basic agent.

๐Ÿ“… Roadmap


โœ… Phase 1: Tool-Based RAG Agent โ€” โœ… Done

  • ๐Ÿง  Chain-of-Thought Agent using LangChain
  • ๐Ÿ”ง Tools: PDF summarization, Web search (Tavily), Wikipedia, Calculator
  • ๐Ÿงฎ Built-in Memory
  • ๐Ÿ’ก Reasoning trace (Thought โ†’ Action โ†’ Result)
  • ๐ŸŽจ Streamlit UI with tool checklist

๐Ÿš€ PHASE 2: Chain-of-Tools Agent

Let the agent auto-chain steps like:

โ€œSummarize top 3 news articles about XYZโ€
โŸถ Search โ†’ Pick top links โ†’ Read + Summarize โ†’ Combine insights

๐Ÿ”ง New Tools to Add:

  • summarize_url โ€” Read and summarize a web page
  • multi_url_summary โ€” Loop over list of URLs and extract key info
  • web_search_chain โ€” Combined search + read + summarize

๐Ÿง  PHASE 3: Agent with Function Memory

Let the agent remember facts about the user or previous answers.

Example:

โ€œWho is the CEO of Tesla?โ€
โ†’ Even tomorrow, it remembers your earlier query.

๐Ÿงฐ Tools & Techniques:

  • LangChainโ€™s VectorStoreRetrieverMemory
  • Store structured Q&A facts or timelines
  • Indexed long-term memory support

๐Ÿ“ PHASE 4: Document Q&A + Chunk Tracking

Enhance document summarization:

  • ๐Ÿ” Show exactly which chunks from the PDF were used in the answer
  • ๐Ÿ“„ Highlight matching text in context
  • ๐Ÿ—‚๏ธ Support multi-PDF ingestion with separate memory per doc

๐Ÿค– PHASE 5: Tool-Using Assistant API

Turn this logic into a production API backend:

  • ๐Ÿ”Œ Framework: FastAPI or Litestar
  • ๐Ÿง  Endpoint: /ask โ†’ returns final answer + trace
  • ๐Ÿ’ฌ Useful for building your own chatbot or research SaaS

๐ŸŒ PHASE 6: Assistant with Browsing + Plugin Tools

Make the agent smarter at real-world decisions:

  • ๐ŸŒ Use LangGraph or LCEL to handle branching logic
  • ๐Ÿค– Tools like:
    • YouTubeTranscriptTool
    • Google Scholar Reader
    • News Aggregator
  • ๐Ÿง  Agent decides:
    • Should I search?
    • Should I summarize?
    • Can I skip?

โญ Want to contribute to any phase? Fork the repo, build a feature, and submit a PR! The roadmap is open for collaboration.



Let me know if you want:
- `LICENSE` file (MIT version)
- A matching `.env.example` file
- `demo/screenshot.png` placeholder
- `contributing.md` file

All of this helps boost your open-source visibility!

About

A smart AI research agent built with LangChain + Mistral-7B + Streamlit that reads PDFs, searches the web, summarizes Wikipedia, solves math, and explains its reasoning. Open-source and tool-augmented.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages