Skip to content

pavanaj1/projon-LangChain

Repository files navigation

TrendScope: LangChain RAG Project

TrendScope is a simple but practical LangChain project: it ingests trend notes, articles, or local text files, builds a lightweight retrieval index, and answers questions with citations from the source material.

It is designed as a good portfolio project because it is small enough to understand, but it demonstrates the pieces companies usually care about: document loading, chunking, embeddings, retrieval, prompt composition, model configuration, and tests.

What It Builds

  • A CLI assistant for asking grounded questions over your own trend research.
  • A local deterministic retriever that works in tests without an API key.
  • Optional LLM answering through LangChain chat models.
  • Source citations so answers are easier to audit.

Quick Start

python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -e ".[dev]"

Run an offline source search:

trendscope search --path data/sample_trends.md --query "What project should I build with LangChain?"

Run the web app:

python -m trendscope.web --port 8000

Run a full LLM answer with OpenAI:

copy .env.example .env
# add OPENAI_API_KEY to .env
trendscope ask --path data/sample_trends.md --query "Suggest a demanding but realistic LangChain project"

Run with Ollama instead:

pip install -e ".[ollama]"
trendscope ask --path data/sample_trends.md --query "What is a strong local-first AI project?" --provider ollama --model llama3.1

Commands

trendscope search --path data/sample_trends.md --query "agentic RAG"
trendscope ask --path data/sample_trends.md --query "Build me a project idea from these trends"
trendscope ask --url https://example.com/article --query "What are the implementation ideas?"
python -m trendscope.web --port 8000

Project Structure

trendscope/
  cli.py       # CLI entry point
  config.py    # environment and model settings
  loaders.py   # local file and URL loading
  rag.py       # chunking, retrieval, and LangChain chain
data/
  sample_trends.md
tests/
  test_rag.py

Notes

The retrieval layer intentionally includes a deterministic local embedding model. That keeps the app testable and demoable without paid services, while the answer-generation path still uses LangChain chat model integrations for real use.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors