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
| Provider | Import | Replaces |
|---|---|---|
OpenAI | langchat.providers | langchat.adapters.llm.OpenAIAdapter |
Anthropic | langchat.providers | langchat.adapters.llm.AnthropicAdapter |
Gemini | langchat.providers | langchat.adapters.llm.GeminiAdapter |
Mistral | langchat.providers | langchat.adapters.llm.MistralAdapter |
Cohere | langchat.providers | langchat.adapters.llm.CohereAdapter |
Ollama | langchat.providers | langchat.adapters.llm.OllamaAdapter |
Pinecone | langchat.providers | langchat.adapters.vector_db.PineconeAdapter |
Supabase | langchat.providers | langchat.adapters.database.SupabaseAdapter |
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
