A framework for building and deploying Generative AI/ Agentic AI applications with the following features:
-
Core Components: Factories for LLMs, Embeddings, Vector Stores and Runnables
-
Modular Architecture: Plug-and-play components for AI workflows
-
Agent Systems:
- ReAct and Plan-and-Execute agents
- Multi-tool calling agents
- Hybrid search (semantic + keyword)
- Research and data analysis agents
- Multi-agent coordination (CrewAI, MCP, AutoGen)
-
Built on LangChain with extensions for enterprise use cases.
-
Extensive use of 'factory' and 'inversion of control' patterns to improve extendibility
Foundation:
LangChain- AI orchestrationLangGraph- Agent workflowsPydantic- Data modelisation & validationFastAPI- REST endpointsStreamlit- Web interfacesTyper- CLI frameworkOmegaConf- Configuration management
Key Integrations:
Tavily- Web searchGPT Researcher- Autonomous researchMCP- Model Context ProtocolAutoGen- Multi-agent systemspgvector- Vector database
For an overview of the code structure and patterns: [Tutorial: https://deepwiki.com/tclatos/genai-blueprint/1-overview)
Note: The tutorial was automatically generated and may be slightly outdated - refer to the code for current implementations.
Prerequisites:
- Python 3.12 (installed automatically via
uv). The code should however work with Python 3.11 or 3.13. uvfor dependency managementmakefor build commands
It has been tested on Linux, WSL/Ubuntu and MacOS.
Installation:
make installConfiguration:
🚀 Enhanced Configuration System The configuration system now supports flexible project directory discovery:
- Works from any subdirectory (notebooks/, demos/, etc.) - automatically finds config files
- Parent directory search - searches up the directory tree for configuration files
- Hierarchical overrides - environment-specific configurations
- Dynamic path resolution - paths automatically adjust based on project location
Main Configuration Files:
config/app_conf.yaml: Main application settings and pathsconfig/baseline.yaml: Core LLM, embeddings, and vector store configurationsconfig/overrides.yaml: Environment-specific overrides (selected viaBLUEPRINT_CONFIG)config/mcp_servers.yaml: MCP server configurationsconfig/basic_auth.yaml: Basic authentication settings.env: API keys and environment variables (can be in project root or parent directories)
Development Configuration:
config/.vscode/: VSCode development settingssettings.json: Editor configuration for the project
Agent Configurations:
config/agents/: Agent-specific configurationsdeepagents.yaml: Deep agent configurationslangchain.yaml: LangChain agent settingssmolagents.yaml: SmolAgents configurations
Provider Configurations:
config/providers/llm.yaml: LLM model definitions and provider configurationsconfig/providers/embeddings.yaml: Embedding model configurations
Demo and Component Configurations:
config/demos/: Demo-specific configurationscli_examples.yaml: CLI demo configurationscognee_kg.yaml: Cognee knowledge graph settingsgraph_rag.yaml: Graph RAG configurationsmergekit.yaml: MergeKit demo settingspresidio_anonymization.yaml: Presidio anonymization demoREADME.md: Demo documentation
config/components/: Component-specific configurationsgpt_researcher.yaml: GPT Researcher component settings
config/schemas/: Schema definitions for structured datadocument_extractor.yaml: Document extraction schema
Development Configuration:
pyproject.toml: Project dependencies and build configuration- Uses modern Python packaging with
uvfor fast dependency management
Quick Test:
make test_install # Verifies basic functionality
make test # Runs test suite (some parallel tests may need adjustment)
make webapp # launch the Streamlit appAlternative Quick Test:
python quick_test.py # Quick functionality verification scriptConfigure LLMs via /config/providers/llm.yaml after setting up API keys.
genai_blueprint/ai_chains/: AI chain implementations and examplesA_1_joke.py: Simple joke generation chain exampleB_1_naive_rag_example.py: Basic RAG implementationB_2_self_query.py: Self-querying retrieval demoC_1_tools_example.py: Tool usage examplesC_2_advanced_rag_langgraph.py: Advanced RAG with LangGraphC_2_advanced_rag_langgraph_functional.py: Functional approach to advanced RAGC_2_Agentic_Rag_Functional.py: Agentic RAG functional approachC_3_essay_writer_agent.py: Essay writing agentC_4_agent_structured_output.py: Structured output agentsfabric_chain.py: Fabric pattern chain implementation
genai_blueprint/main/: Main application entry pointscli.py: Command-line interface implementationfastapi_app.py: FastAPI web applicationlangserve_app.py: LangServe integrationmodal_app.py: Modal deployment setupstreamlit.py: Streamlit web application
-
genai_blueprint/demos/: Various demonstration implementationsdeep_agents/: Deep learning agent demonstrationscoding_agent_example.py: Coding agent implementationresearch_agent_example.py: Research agent demonstration
ekg/: Enterprise Knowledge Graph demosbaml_src/: BAML schema definitionsclients.baml: Client data schemasgenerators.baml: Data generation schemasrainbow_project_kg.baml: Knowledge graph schemas
cli_commands/: EKG CLI command implementationscommands.py: Main CLI commandscommands_baml.py: BAML-specific CLI commandscommands_ekg.py: EKG-specific commands
notebooks/: Jupyter notebooks for EKG development0_scratchpad_ekg2.ipynb: EKG development scratchpad0_struct_rag.ipynb: Structured RAG notebookscratchpad.ipynb: General development scratchpad
struct_rag/: Structured RAG implementationsstruct_rag_doc_processing.py: Document processingstruct_rag_tool_factory.py: RAG tool factory
example_new_subgraph.py: Subgraph examplegenerate_fake_rainbows.py: Synthetic data generationgraph_core.py: Core graph functionalitygraph_schema.py: Graph schema definitionskuzu_graph_html.py: Kuzu graph HTML visualizationrainbow_subgraph.py: Rainbow subgraph implementationtest_baml_extract.py: BAML extraction testingtest_graph.py: Graph functionality testingtest_refactored_ekg.py: Refactored EKG testing
maintenance_agent/: System maintenance agent demosdummy_data.py: Test data generationtools.py: Maintenance tools implementation
mon_master_search/: Master search functionalityloader.py: Data loading utilitiesmodel_subset.py: Model subset managementsearch.py: Search implementation
todo/: Additional demo implementations20_▫️_CrewAI_demo.py: CrewAI demonstrationazure_gpt4o.py: Azure GPT-4o integrationhuman-in-loop-agent.py: Human-in-the-loop agent
mergekit.yml: MergeKit configuration
-
genai_blueprint/webapp/: Streamlit web applicationpages/: Streamlit page implementations organized by categorydemos/: Main demo pagesmon_master.py: Hybrid search UIdeep_search_agent.py: Research agent with loggingcodeAct_agent.py: CodeAct agent implementationreAct_agent.py: ReAct agent implementationgraph_RAG.py: Graph-based RAG demoanonymization.py: Presidio anonymization democognee_KG.py: Cognee knowledge graph demodeep_agent.py: Deep agent implementationsmaintenance_agent.py: System maintenance agent
settings/: Configuration and setup pageswelcome.py: Welcome and overview pageconfiguration.py: System configuration interfaceMCP_servers.py: MCP server management
unmaintained/: Legacy demo pages (preserved for reference)12_▫️_Crew_AI.py: CrewAI demonstration13_▫️_OCR_Ollama.py: OCR with Ollama15_▫️_Chat_Human_in_Loop.py: Human-in-the-loop chat20_browser_control.py: Browser control demo3_▫️_Stock_Price.py: Stock price analysis4_▫️_Dataframe_Agent.py: Dataframe agent demo991_ Terminal.py: Terminal interface demo991_test scroll.py: Scroll testing99_▫️_Folium_Map_State.py: Folium map visualization9_▫️_SmollAgent.py: SmolAgent demonstration
ui_components/: Reusable Streamlit componentssmolagents_streamlit.py: SmolAgents UI componentsstreamlit_chat.py: Helper to display LangGraph chat in Streamlitconfig_editor.py: Configuration editing interfacecypher_graph_display.py: Cypher graph visualization componentllm_selector.py: LLM selection component
cli_commands.py: Webapp-specific CLI commands
-
genai_blueprint/utils/: Utility functions and helpersstreamlit/: Streamlit-specific utilitiesauto_scroll.py: Auto-scrolling functionalitycapturing_callback_handler.py: Callback handler for capturingclear_result.py: State managementrecorder.py: Streamlit action recordingthread_issue_fix.py: Streamlit threading fixes
-
genai_blueprint/mcp_server/: MCP server implementationsmath_server.py: Mathematical computation servertech_news.py: Technology news serverweather_server.py: Weather information server
docs/: Additional documentation and guidesdeep_agent_cli_examples.md: Deep agent CLI usage examples
examples/: Standalone example implementationsvllm_demo.py: vLLM inference demo
vibe_coding/: Development conventions and scriptsCONVENTIONS.md: Coding conventions used by Aider-chatscripts.md: Development scripts reference
use_case_data/: Sample data for testing and demonstrationsgenerated/: Generated test datamaintenance/: Maintenance procedure documentsocr/: OCR test images and samplesscientific_papers/: Research paper PDFs for testingother/: Miscellaneous test data (CSV, images, text files)
tests/: Unit and integration testsunit_tests/: Unit test implementationsintegration_tests/: Integration test suites
genai_blueprint/wip/: Work in progress and experimental featuresMakefile: Common development and deployment tasks
Agents.md: Additional agent documentation and examplespackage.json&package-lock.json: Node.js dependencies for some componentsquick_test.py: Quick testing script for basic functionality verification
Dockerfile: Optimized dockerfiledeploy/: Deployment scripts and configurationsdocker.mk: build and run a container locallyaws.mk: deploy in AWSazure.mk: deploy in Azuremodal.mk: deploy in Modal
- The
Streamitapp can be somewhat configured inapp_conf.yaml(key:ui). - Most Demos can be configured with YAML file in
config/demos
🎯 Works from Any Directory! Thanks to the enhanced configuration system, CLI commands work from any project directory:
# From project root
cd /path/to/genai-blueprint && uv run cli info config
# From notebooks directory
cd /path/to/genai-blueprint/notebooks && uv run cli info config
# From any subdirectory - automatically finds project configuration!
cd /path/to/genai-blueprint/genai_blueprint/demos && uv run cli info configAvailable Commands:
The framework provides extensive CLI commands for AI interactions, implemented in cli_command.py files and registered in app_conf.yaml:
uv run cli --help # List all available commands with descriptions
uv run cli info config # Show current configuration and available modelsBasic LLM Interaction
uv run cli core llm "Hello world" # Simple LLM query
echo "Hello world" | uv run cli core llm # Pipe input
uv run cli core llm "Hello" --llm gpt-4 --stream # Use specific model with streaming
uv run cli core run joke --input "bears" # Run a joke chainAgent with tools / MCP
uv run cli agents mcp --server filesystem --chat # start interactive shell
echo "get news from atos.net web site" | uv run cli agents mcp --server playwright --server filesystem # ReAct Agent
uv run cli agents smolagents "How many seconds would it take for a leopard at full speed to run through Pont des Arts?" -t web_search # CodeAct AgentDeep Agents (Enhanced with beautiful markdown rendering)
# Research agent with markdown output
uv run cli agents deep research --input "Latest AI developments" --llm gpt-4
# Coding agent for development tasks
uv run cli agents deep coding --input "Write a Python async web scraper" --llm gpt-4
# Analysis agent for data insights
uv run cli agents deep analysis --input "Analyze sales trends" --files sales_data.csv --llm gpt-4
# Custom agent with specific instructions
uv run cli agents deep custom --input "Plan a project timeline" --instructions "You are a project manager" --llm gpt-4Knowledge Graph & Document Processing
# Extract structured data from documents
uv run cli structured extract "*.md" --schema "project_schema"
uv run cli structured extract-baml "*.md" --class ReviewedOpportunity --force
uv run cli structured gen-fake "projects/*.json" --output-dir ./fake --count 5
# Knowledge graph operations
uv run cli kg add --key project-alpha
uv run cli kg query --query "MATCH (p:Project) RETURN p.name"
uv run cli kg agent --input "Find all Python projects"
uv run cli kg export-html --output-dir ./vizUtilities
uv run cli info models # List available models
uv run cli info config # Show current configuration
uv run cli info mcp-tools --filter playwright # List available MCP tools
uv run cli tools markdownize document.pdf # Convert documents to markdowninstall Ollama
curl -fsSL https://ollama.com/install.sh | sh
ollama run gemma3:4b # example LLM
ollama pull snowflake-arctic-embed:22m # example embeddingsInstall Chrome and Playwright
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo apt install ./google-chrome-stable_current_amd64.deb
uv add playwright
playwright install --with-depsSpacy models in uv
uv pip install pip
uv run --with spacy spacy download fr_core_news_sm
uv run --with spacy spacy download en_core_web_lg or
make install_spacy_modelsInstall Node (for some MCP servers)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
nvm install --ltsProblem: AssertionError: cannot find config file when running from subdirectories
Solution: ✅ Fixed! The enhanced configuration system now automatically searches parent directories for config files. Commands work from any project directory:
# All of these work now:
cd /project/root && uv run cli info config
cd /project/root/notebooks && uv run cli info config
cd /project/root/genai_blueprint/demos && uv run cli info configProblem: ModuleNotFoundError: No module named 'langchain_postgres'
Solution: ✅ Fixed! Optional dependencies are now handled gracefully. Missing packages won't break the system.
Problem: Build errors after renaming the src/ directory
Solution: ✅ Fixed! All configuration files and path references have been updated to use the new genai_blueprint/ directory structure.
For local development with both projects:
# Use PYTHONPATH for development (optional)
export GENAI_DEV_PATH="/path/to/local/genai-tk:$PYTHONPATH"
alias uv-dev="PYTHONPATH=$GENAI_DEV_PATH uv"
# Then use uv-dev for development:
uv-dev run cli info configOr rely on the standard Git dependency system - just push changes to genai-tk and run:
uv cache clean genai-tk && uv sync -U