8. Library Dependencies & Their Roles in Maeser#

An at-a-glance guide to every major third-party library in Maeser: what it does, why it’s here, and how we leverage it.


8.1. Overview#

Maeser weaves together Python libraries to handle:

  • Vector search & embeddings

  • Workflow orchestration

  • LLM API access

  • Web serving & templating

  • Authentication & configuration

  • CLI & developer tooling

Understanding these dependencies empowers you to extend Maeser, debug quickly, and swap components as needed.


8.2. LLM, Vector Store Retrieval, & Embedding APIs#

8.2.1. OpenAI Python SDK#

  • Role: Official client for chat completions & embeddings

  • Use case: Send prompts to GPT models (e.g., gpt-3.5-turbo, gpt-4) and retrieve embeddings when needed.

8.2.2. LangChain#

8.2.3. FAISS (via LangChain)#

  • Role: High-performance nearest-neighbor search

  • Use case: Index and query embedding vectors for both Simple and Pipeline RAG pipelines.

8.2.4. LangGraph#

  • Role: Compose multi-step AI pipelines as directed graphs

  • Use case: Underpins get_simple_rag, get_pipeline_rag, and get_universal_rag; foundation for advanced custom graphs.


8.3. 4. Web Framework & Templating#

8.3.1. Flask#

  • Role: Lightweight WSGI framework for web endpoints

  • Use case: Hosts chat UI, auth flows, admin dashboards—bootstrapped by AppManager.

8.3.2. Jinja2#

  • Role: HTML templating engine

  • Use case: Renders dynamic templates (chat interface, login, logs) with theming support.


8.4. Configuration & Environment#

8.4.1. PyYAML#

  • Role: YAML parsing

  • Use case: Load config.yaml (API keys, paths, rate limits, auth settings).


8.5. Authentication & User Management#

8.5.1. GitHub OAuth (Handled in user_manager)#

  • Role: Support for Github login.

  • Use case: Provide users with the option to sign into the web application with github.

8.5.2. LDAP3 (Handled in user_manager)#

  • Role: LDAP directory client

  • Use case: LDAPAuthenticator for enterprise user login.


8.6. Deployment#

8.6.1. Gunicorn#

8.6.2. nginx#

  • Role: Production-ready HTTP server that can act as a reverse-proxy for WSGI servers.

  • Use case: Connect with Gunicorn to deploy a Maeser Flask app as an HTTP server.


8.7. CLI & Developer Tooling#

8.7.1. pyinputplus#

  • Role: Enhanced input() for CLI menus & validation

  • Use case: Powers the interactive terminal example.

8.7.2. pytest#

  • Role: Testing framework

  • Use case: Runs unit tests under tests/ to validate functionality.

8.7.3. Sphinx & MyST Parser#

  • Role: Documentation generator for RST & Markdown

  • Use case: Builds the Maeser docs site (sphinx-docs/) with mixed-format support.

8.7.4. Poetry#

  • Role: Maeser package management

  • Use case: Installing all required dependencies and publishing the Maeser package to PyPI.