alphasecio/langchain-examples
Über uns
Eine Streamlit-App mit vier LangChain-Tools: einem Web-Recherche-Agenten, Zusammenfassungen, einem Nachrichtenüberblick und einem Chat mit Dokumenten. Verwendet OpenAI, pgvector und eine Such-API deiner Wahl.
KI und maschinelles LernenGemessener Sternzuwachs
- in 24h
- +1
- in 7 days
- +1
- in 15 days
- +1
- in 1 month
- Verlauf wird gesammelt
Nettoänderungen in überlappenden Zeiträumen, keine Tagessummen. Fehlende Messwerte bleiben leer. Sterne zeigen Interesse, nicht Qualität.
README.md
Originallangchain-examples
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) | |
| Pinecone |
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_PASSWORDif 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.
Ähnliche Projekte entdecken
Wird geladen…