Library Dependencies & Their Roles in Maeser
This page catalogs the key libraries leveraged by Maeser, explaining their purpose, how they integrate into the Maeser architecture, and recommended usage patterns.
Core RAG & Embedding
1.1 LangChain
Purpose: Provides abstractions for document loading, text splitting, embeddings, and vector store wrappers.
Usage in Maeser:
Uses OpenAIEmbeddings to convert text chunks into embedding vectors.
Employs FAISS vector store through LangChain’s vectorstores.FAISS to index and query embeddings.
Text splitters (RecursiveCharacterTextSplitter) break documents into semantically meaningful chunks for retrieval.
1.2 FAISS (via langchain)
Purpose: A high‑performance vector similarity search library.
Usage in Maeser:
Powers retrieval in both Simple and Pipeline RAG pipelines.
Stores and queries embedding indexes created from user and domain content.
Graph Orchestration
2.1 LangGraph
Purpose: A graph‑based workflow engine for defining multi‑step, conditional pipelines.
Usage in Maeser:
Underlies Simple RAG (get_simple_rag) and Pipeline RAG (get_pipeline_rag).
Enables developers to build custom graphs that chain retrieval, classification, tool calls, and generation steps.
Large Language Model Clients
3.1 OpenAI Python SDK
Purpose: Interfaces with OpenAI’s API for chat completions and embeddings.
Usage in Maeser:
Sends completion requests (e.g., gpt-3.5-turbo, gpt-4) with system and user prompts.
Retrieves embeddings when not using LangChain for embedding directly.
Web Framework & Templating
4.1 Flask
Purpose: Lightweight WSGI web framework.
Usage in Maeser:
Hosts the web-based chat interface, authentication endpoints, and admin UIs.
Routed via the App_Manager blueprint for modular route registration.
4.2 Jinja2
Purpose: Templating engine for generating HTML.
Usage in Maeser:
Renders dynamic pages: chat UI, login pages, admin dashboards, and log viewers.
Supports template inheritance and customization for theming.
Configuration & Utilities
5.1 PyYAML
Purpose: Parses YAML configuration files.
Usage in Maeser:
Loads config.yaml for API keys, file paths, authenticator settings, and rate limits.
5.2 python-dotenv (optional)
Purpose: Loads environment variables from a .env file.
Usage in Maeser:
Allows developers to override config.yaml settings via environment variables for secure key management.
User Management & Authentication
6.1 LDAP3
Purpose: Python client for LDAP directory services.
Usage in Maeser:
Implements LDAPAuthenticator for enterprise user login via LDAP bind and search.
6.2 PyJWT
Purpose: Encodes and decodes JSON Web Tokens.
Usage in Maeser:
Secures session tokens and implements rate‑limiting via signed tokens (if configured).
Command‑Line & Developer Tools
7.1 pyinputplus
Purpose: Enhanced input prompts for command‑line applications.
Usage in Maeser:
Powers the terminal example’s menu and input validation.
7.2 pytest
Purpose: Test framework for Python.
Usage in Maeser:
Runs unit tests located in the tests/ directory to ensure code quality.
7.3 Sphinx & MyST Parser
Purpose: Generates documentation from Markdown and reStructuredText.
Usage in Maeser:
Builds the developer and user documentation site in the sphinx-docs folder, supporting MyST for Markdown compatibility.
Optional Integrations
Poetry: Dependency and virtual environment management alternative.
Gunicorn: Production WSGI server for deploying Flask apps.
Docker: Containerization for reproducible environments.
With this overview, you can quickly identify each library’s role in Maeser and how they interconnect to deliver a seamless RAG chatbot experience. Custom workflows may introduce additional dependencies—refer to the specific guide for details.