This project has several goals:
- Support GenAI training, to illustrate key concepts, programming patterns and techniques
- Implement the
Factory pattern
for LLM, Embeddings models, Vector Store, Runnables - Act as a repository of well integrated reusable components
- Act as a template for cloud-deployable, highly configurable AI Agents
- Propose ready to use agentic GenAI demos, demonstrating notably:
- ReAct Agents to connect different data sources
- Tool calling agent calling an API
- Semantic and Hybrid search
- Researcher agents
- MCP
- CrewAI
It's based mainly on the LangChain ecosystem, and integrate many other nice solutions.
Core dependencies:
LangChain
,LangGraph
,LangServe
, ...OmegaConf
: configuration managementStreamlit
: User Interface (web)Typer
: Command Line InterfaceFastAPI
: REST APIsPydantic
for .. a lot
Extra components used:
SmallAgents
: Agent FrameworkGPR Researcher
: Deep Internet SearchMCP Adapt
: Model Contect Protocoltavily-python
: Tavily API client for web research- ...
We use make
and uv
. This command install uv
if not present, then load the project dependencies.
make install
The project requires Python 12
(that can be easily installed by uv
)
Configuration:
- Application settings are in file :
app_conf.yaml
; Should likely be edited (and improved...) - API keys are taken from a
.env
file, in the project directory or its parents
Quick test:
- Run
echo "computers" | uv run src/main_cli.py run joke -m fake_parrot_local
- It should display 'Tell me a joke on computers'
- Don't care about the warnings
- add
--help
to see the different options - You can change the LLM by taking one in defined in
models_providers.yaml
(if keys are in the.env
file)
- Run 'make test'
- There some issues with several tests in //.
- You might need to change section 'pytest'
app_conf.yaml
too
app_conf.yaml
: Main configuration file for LLMs, embeddings, vector stores and chains.models_providers.yaml
: Contains model definitions and provider configurationspyproject.toml
: Poetry project configuration
src/ai_core/
: Core AI infrastructurellm.py
: LLM factory and configurationembeddings.py
: Embeddings factory and managementvector_store.py
: Vector store factory and operationschain_registry.py
: Runnable component registrycache.py
: LLM caching implementationvision.py
: Facilitate use of multimodal LLMprompts.py
: Prompt templates and utilitiesstructured_output.py
: Structured output generation helperinstrumentation.py
: Telemetry and monitoring
src/ai_extra/
: Generic and reusable AI components, integrated with LangChaingpt_researcher_chain.py
: LCEL encapsulation of GPT Researchersmolagents_chain.py
: SmolAgents implementationmcp_tools.py
: Model Context Protocol utilities
src/webapp/
: Streamlit web application and pagespages/
: Streamlit page implementations1_▫️_Runnable Playground.py
: Page to test registered LangChain runnables2_▫️_MaintenanceAgent.py
: a ReAct agent to help maintenance planning3_▫️_Stock_Price.py
: a tool calling agent to ger and compare stock prices4_▫️_DataFrame.py
: a tool calling agent query tabular data5_▫️_Mon_Master.py
: Example of similarity search project7_▫️_GPT_Researcher.py
: Page demonstrating GPT Researcher9_▫️_SmallAgents
: Page to execute SmollAgents12_▫️_Crew_AI.py
: CrewAI demonstration- ...
src/utils/
: Utility functions and helpersconfig_mngr.py
: Configuration managementpydantic/
: Pydantic model extensionsstreamlit/
: Streamlit-specific utilitiessingleton.py
: Singleton pattern implementationunits.py
: Unit conversion utilities
python/Notebooks
src/webapp/ui_components/
: Generic and reusable User Interface components for Streamlitllm_config.py
: Form to select LLM and common configuration parameterscapturing_callback_handler.py
: Callback handler for Streamlitclear_result.py
: State management utilities
src/ai_chains/
: Example chains and RAG implementations. Examples:B_1_naive_rag_example.py
: Basic RAG implementationB_2_self_query.py
: Self-querying retriever exampleC_1_tools_example.py
: Tool usage demonstrationC_2_advanced_rag_langgraph.py
: Advanced RAG with LangGraphC_3_essay_writer_agent.py
: Essay writing agent- ...
tests/
: Unit and integration testssrc/demos/
: Various demonstration implementationsmaintenance_agent/
: Maintenance planning demomon_master_search/
: Search demotodo/
: Task management demos
Makefile
: Common development tasksDockerfile
: optimized dockerfileCONVENTION.md
: Coding convention used by Aider-chat (a coding assistant)