Skip to content
プロジェクト

alphasecio/langchain-examples

GitHubで見る

概要

4つのLangChainツールを備えたStreamlitアプリです。ウェブ調査エージェント、要約、ニュースダイジェスト、ドキュメントとのチャットを利用できます。OpenAI、pgvector、および任意の検索APIを使用します。

AI・機械学習

この数値の測り方

計測したスター増加

24時間
+1
7日間
+1
15日間
+1
1か月
履歴を収集中

期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。

langchain-examples

Released under the MIT license. GitHub Stars GitHub Forks GitHub Watchers Follow on Twitter

A single Streamlit app with four practical LangChain tools, using OpenAI models, your choice of web search provider, and Postgres with pgvector (or Pinecone) for document storage.

Tool What it does
🔎 Web Research An agent that searches the web, reads pages and answers with cited sources.
📝 Summarize Summarizes pasted text, a web page or a PDF, as a short summary, a detailed one or bullet points.
📰 News Digest Finds top stories on any topic, summarizes each, and writes a one-paragraph digest.
📚 Chat with Docs Stores PDF, text and Markdown files in a vector store (Postgres with pgvector, or Pinecone) and answers questions with page-level citations.

Deploy

Vector store Railway template
Postgres with pgvector (default) Deploy on Railway
Pinecone Deploy on Railway

The pgvector template deploys the app and a Postgres database. The Pinecone template deploys only the app and creates a serverless index in your Pinecone project on first use. Add your OpenAI key and at least one search provider key, and you're ready. It also runs on any VPS with Docker, such as a DigitalOcean droplet.

Configuration

Variable Required Description
VECTOR_STORE No pgvector (default) or pinecone.
DATABASE_URL pgvector only Postgres connection string. The pgvector extension and documents table are created on first use.
PINECONE_API_KEY Pinecone only Pinecone API key. Can also be entered in the sidebar.
PINECONE_INDEX No Pinecone index name, default langchain-examples. If it doesn't exist, a serverless index (1536 dimensions, cosine, AWS us-east-1) is created.
OPENAI_API_KEY Yes OpenAI API key.
OPENAI_MODEL No Default model, e.g. gpt-6.1-terra. Users can switch models in the sidebar.
OPENAI_BASE_URL No An OpenAI-compatible endpoint, if you don't call OpenAI directly.
APP_PASSWORD No Password required to open the app. See the note below.
TAVILY_API_KEY No Tavily
EXA_API_KEY No Exa
FIRECRAWL_API_KEY No Firecrawl
PARALLEL_API_KEY No Parallel
PERPLEXITY_API_KEY No Perplexity
TINYFISH_API_KEY No TinyFish
SERPER_API_KEY No Serper
SERPAPI_API_KEY No SerpApi

Any key not set on the server can be entered in the sidebar instead. Keys entered there last only for that browser session and are never stored.

[!IMPORTANT] Set APP_PASSWORD if you put API keys on the server. Without it, anyone who finds your app's URL can use your keys and spend your credits, and can read or delete documents in your library. If you leave the server keys empty and enter them in the sidebar instead, the app is safe to leave open.

Run locally

docker run -d --name pgvector -e POSTGRES_PASSWORD=postgres -p 5432:5432 pgvector/pgvector:pg18
pip install -r requirements.txt
export DATABASE_URL=postgresql://postgres:postgres@localhost:5432/postgres
export OPENAI_API_KEY=...
streamlit run app.py

Older examples

The earlier standalone apps (Chroma, Pinecone, Gemini, Helicone, SerpApi and others) are preserved on the legacy branch. They are no longer maintained.

関連プロジェクトを探す

読み込み中…