Architecture
LangChat uses a hexagonal architecture (Ports and Adapters). This separates the core chatbot logic from the specific tools it uses:langchat.providers. The adapters are implementation details.
Available providers
Import patterns
Environment variable convention
Every provider follows the same pattern:- Check for explicit
api_keyparameter - Fall back to a named environment variable
- Raise
ValueErrorwith the exact variable name if neither is set
Detailed reference
OpenAI
LLM provider with multi-key rotation
Pinecone
Vector database with OpenAI embeddings
Supabase
Postgres history and metrics storage
Flashrank
Cross-encoder reranker for better search results
