dao-ai 0.1.18__tar.gz → 0.1.20__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dao_ai-0.1.18 → dao_ai-0.1.20}/PKG-INFO +3 -2
- {dao_ai-0.1.18 → dao_ai-0.1.20}/README.md +2 -1
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/04_genie/README.md +75 -15
- dao_ai-0.1.20/config/examples/04_genie/cache_threshold_optimization.yaml +180 -0
- dao_ai-0.1.20/config/examples/04_genie/genie_in_memory_semantic_cache.yaml +148 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/README.md +2 -1
- {dao_ai-0.1.18 → dao_ai-0.1.20}/docs/examples.md +3 -2
- dao_ai-0.1.20/docs/genie_context_aware_cache_prompt_history.md +937 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/docs/key-capabilities.md +70 -6
- dao_ai-0.1.20/notebooks/11_optimize_cache_thresholds.py +380 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/pyproject.toml +1 -1
- {dao_ai-0.1.18 → dao_ai-0.1.20}/requirements.txt +0 -1
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/cli.py +37 -7
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/config.py +274 -1
- dao_ai-0.1.20/src/dao_ai/genie/__init__.py +86 -0
- dao_ai-0.1.20/src/dao_ai/genie/cache/__init__.py +70 -0
- dao_ai-0.1.20/src/dao_ai/genie/cache/base.py +213 -0
- dao_ai-0.1.20/src/dao_ai/genie/cache/context_aware/__init__.py +31 -0
- dao_ai-0.1.20/src/dao_ai/genie/cache/context_aware/base.py +1151 -0
- dao_ai-0.1.20/src/dao_ai/genie/cache/context_aware/in_memory.py +609 -0
- dao_ai-0.1.20/src/dao_ai/genie/cache/context_aware/persistent.py +802 -0
- dao_ai-0.1.20/src/dao_ai/genie/cache/context_aware/postgres.py +1166 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/genie/cache/core.py +1 -1
- dao_ai-0.1.20/src/dao_ai/genie/cache/lru.py +529 -0
- dao_ai-0.1.20/src/dao_ai/genie/cache/optimization.py +890 -0
- dao_ai-0.1.20/src/dao_ai/genie/core.py +259 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/nodes.py +4 -4
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/tools/__init__.py +2 -2
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/tools/genie.py +33 -8
- dao_ai-0.1.20/tests/dao_ai/genie/cleanup_test_tables.py +185 -0
- dao_ai-0.1.20/tests/dao_ai/genie/test_cache_optimization.py +439 -0
- dao_ai-0.1.20/tests/dao_ai/genie/test_from_space_integration.py +251 -0
- dao_ai-0.1.20/tests/dao_ai/genie/test_prompt_history.py +1026 -0
- dao_ai-0.1.20/tests/dao_ai/test_cache_fallback.py +330 -0
- dao_ai-0.1.18/tests/dao_ai/test_semantic_cache_context.py → dao_ai-0.1.20/tests/dao_ai/test_context_aware_cache.py +50 -25
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_genie.py +299 -109
- dao_ai-0.1.20/tests/dao_ai/test_genie_feedback.py +836 -0
- dao_ai-0.1.20/tests/dao_ai/test_in_memory_context_aware_cache.py +1144 -0
- dao_ai-0.1.18/src/dao_ai/genie/__init__.py +0 -38
- dao_ai-0.1.18/src/dao_ai/genie/cache/__init__.py +0 -43
- dao_ai-0.1.18/src/dao_ai/genie/cache/base.py +0 -72
- dao_ai-0.1.18/src/dao_ai/genie/cache/lru.py +0 -347
- dao_ai-0.1.18/src/dao_ai/genie/cache/semantic.py +0 -970
- dao_ai-0.1.18/src/dao_ai/genie/core.py +0 -35
- {dao_ai-0.1.18 → dao_ai-0.1.20}/.gitignore +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/.python-version +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/CHANGELOG.md +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/CONTRIBUTING.md +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/CONTRIBUTORS.md +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/LICENSE +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/Makefile +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/app.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/01_getting_started/README.md +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/01_getting_started/minimal.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/02_mcp/README.md +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/02_mcp/custom_mcp.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/02_mcp/external_mcp.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/02_mcp/filtered_mcp.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/02_mcp/managed_mcp.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/02_mcp/slack_integration.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/03_reranking/README.md +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/03_reranking/instruction_aware_reranking.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/03_reranking/vector_search_with_reranking.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/04_genie/genie_basic.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/04_genie/genie_lru_cache.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/04_genie/genie_semantic_cache.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/04_genie/genie_with_conversation_id.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/05_memory/README.md +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/05_memory/conversation_summarization.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/05_memory/in_memory_basic.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/05_memory/lakebase_persistence.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/05_memory/postgres_persistence.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/06_on_behalf_of_user/README.md +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/06_on_behalf_of_user/obo_basic.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/07_human_in_the_loop/README.md +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/07_human_in_the_loop/human_in_the_loop.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/08_guardrails/README.md +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/08_guardrails/guardrails_basic.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/09_structured_output/README.md +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/09_structured_output/structured_output.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/10_agent_integrations/README.md +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/10_agent_integrations/agent_bricks.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/10_agent_integrations/kasal.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/11_prompt_engineering/README.md +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/11_prompt_engineering/prompt_optimization.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/11_prompt_engineering/prompt_registry.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/12_middleware/README.md +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/12_middleware/combined_middleware.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/12_middleware/context_management.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/12_middleware/custom_field_validation.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/12_middleware/limit_middleware.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/12_middleware/logging_middleware.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/12_middleware/pii_middleware.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/12_middleware/retry_middleware.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/12_middleware/tool_selector_middleware.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/13_orchestration/README.md +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/13_orchestration/supervisor_pattern.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/13_orchestration/swarm_pattern.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/14_basic_tools/README.md +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/14_basic_tools/sql_tool_example.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/15_complete_applications/README.md +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/15_complete_applications/brick_store.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/15_complete_applications/deep_research.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/15_complete_applications/executive_assistant.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/15_complete_applications/genie_and_genie_mcp.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/15_complete_applications/genie_vector_search_hybrid.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/15_complete_applications/hardware_store.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/15_complete_applications/hardware_store_instructed.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/15_complete_applications/hardware_store_lakebase.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/15_complete_applications/hardware_store_swarm.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/15_complete_applications/quick_serve_restaurant.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/15_complete_applications/reservations_system.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/16_instructed_retriever/README.md +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/16_instructed_retriever/full_pipeline.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/config/examples/16_instructed_retriever/instructed_retriever.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/data/dais2025/appointments.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/data/dais2025/appointments_data.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/data/dais2025/brand_rep_demo_data.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/data/dais2025/brand_rep_demo_queries.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/data/dais2025/brand_rep_demo_tables.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/data/dais2025/brand_rep_demo_validation.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/data/dais2025/customers.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/data/dais2025/customers_data.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/data/dais2025/dim_stores.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/data/dais2025/dim_stores_data.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/data/dais2025/employee_performance.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/data/dais2025/employee_performance_data.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/data/dais2025/employee_tasks.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/data/dais2025/employee_tasks_data.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/data/dais2025/inventory.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/data/dais2025/inventory_data.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/data/dais2025/managers.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/data/dais2025/managers_data.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/data/dais2025/product_data.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/data/dais2025/products.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/data/dais2025/task_assignments.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/data/hardware_store/inventory.snappy.parquet +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/data/hardware_store/inventory.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/data/hardware_store/products.snappy.parquet +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/data/hardware_store/products.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/data/quick_serve_restaurant/.gitkeep +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/data/quick_serve_restaurant/fulfil_item_orders.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/data/quick_serve_restaurant/items_description.csv +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/data/quick_serve_restaurant/items_description.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/data/quick_serve_restaurant/items_raw.csv +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/data/quick_serve_restaurant/items_raw.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/data/quick_serve_restaurant/orders_raw.csv +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/data/quick_serve_restaurant/orders_raw.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/databricks.yaml.template +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/docs/architecture.md +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/docs/cli-reference.md +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/docs/configuration-reference.md +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/docs/contributing.md +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/docs/faq.md +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/docs/hardware_store/README.md +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/docs/hardware_store/retail_supervisor.png +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/docs/hardware_store/retail_swarm.png +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/docs/images/genie.png +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/docs/python-api.md +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/docs/quick_serve_restaurant/.gitkeep +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/docs/quick_serve_restaurant/quick-serve-restaurant.png +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/docs/why-dao.md +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/environment.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/examples/dais2025/examples.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/examples/deep_research/examples.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/examples/executive_assistant/examples.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/examples/hardware_store/examples.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/examples/quick_serve_restaurant/.gitkeep +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/examples/quick_serve_restaurant/examples.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/functions/dais2025/extract_store_numbers.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/functions/dais2025/find_inventory_by_sku.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/functions/dais2025/find_inventory_by_upc.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/functions/dais2025/find_product_by_sku.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/functions/dais2025/find_product_by_upc.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/functions/dais2025/find_store_by_number.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/functions/dais2025/find_store_inventory_by_sku.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/functions/dais2025/find_store_inventory_by_upc.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/functions/hardware_store/find_inventory_by_sku.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/functions/hardware_store/find_inventory_by_upc.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/functions/hardware_store/find_product_by_sku.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/functions/hardware_store/find_product_by_upc.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/functions/hardware_store/find_store_inventory_by_sku.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/functions/hardware_store/find_store_inventory_by_upc.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/functions/quick_serve_restaurant/.gitkeep +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/functions/quick_serve_restaurant/insert_coffee_order.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/functions/quick_serve_restaurant/lookup_items_by_descriptions.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/functions/quick_serve_restaurant/match_historical_item_order_by_date.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/functions/quick_serve_restaurant/match_item_by_description_and_price.sql +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/notebooks/01_ingest_and_transform.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/notebooks/02_provision_vector_search.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/notebooks/03_provision_lakebase.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/notebooks/04_unity_catalog_tools.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/notebooks/05_deploy_agent.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/notebooks/06_generate_evaluation_data.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/notebooks/07_run_evaluation.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/notebooks/08_run_examples.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/notebooks/09_evaluate_inferences.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/notebooks/10_optimize_prompts.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/notebooks/99_scratchpad.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/schemas/bundle_config_schema.json +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/schemas/model_config_schema.json +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/__init__.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/apps/__init__.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/apps/handlers.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/apps/model_serving.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/apps/resources.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/apps/server.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/catalog.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/evaluation.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/graph.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/hooks/__init__.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/hooks/core.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/logging.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/memory/__init__.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/memory/base.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/memory/core.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/memory/databricks.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/memory/postgres.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/messages.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/middleware/__init__.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/middleware/assertions.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/middleware/base.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/middleware/context_editing.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/middleware/core.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/middleware/guardrails.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/middleware/human_in_the_loop.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/middleware/message_validation.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/middleware/model_call_limit.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/middleware/model_retry.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/middleware/pii.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/middleware/summarization.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/middleware/tool_call_limit.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/middleware/tool_retry.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/middleware/tool_selector.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/models.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/optimization.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/orchestration/__init__.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/orchestration/core.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/orchestration/supervisor.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/orchestration/swarm.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/prompts/__init__.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/prompts/instructed_retriever_decomposition.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/prompts/instruction_reranker.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/prompts/router.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/prompts/verifier.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/providers/__init__.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/providers/base.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/providers/databricks.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/state.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/tools/agent.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/tools/core.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/tools/email.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/tools/instructed_retriever.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/tools/instruction_reranker.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/tools/mcp.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/tools/memory.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/tools/python.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/tools/router.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/tools/search.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/tools/slack.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/tools/sql.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/tools/time.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/tools/unity_catalog.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/tools/vector_search.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/tools/verifier.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/types.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/utils.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/src/dao_ai/vector_search.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/config/test_model_config.yaml +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/conftest.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/middleware/test_context_editing.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/middleware/test_model_call_limit.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/middleware/test_model_retry.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/middleware/test_pii.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/middleware/test_tool_call_limit.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/middleware/test_tool_retry.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/middleware/test_tool_selector.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_agent_response_format.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_assertions_middleware.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_catalog.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_chat_history.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_config.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_databricks.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_evaluation.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_function_parsing.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_genie_conversation_ids_in_outputs.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_genie_databricks_integration.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_genie_room_model.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_guardrail_retry.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_hitl_config_model.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_hitl_responses_agent.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_hooks.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_human_in_the_loop.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_inference.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_inference_integration.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_input_output_structure.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_instructed_retriever.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_instruction_reranker.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_instruction_reranker_integration.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_interrupt_type.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_llm_interrupt_handling.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_mcp.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_mcp_filtering.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_mcp_filtering_integration.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_mcp_function_model.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_message_validation_middleware.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_messages.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_models.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_optimization.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_postgres_integration.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_prompt_optimizations.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_prompts.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_reranking.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_reranking_integration.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_resources_model_genie_integration.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_response_format.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_responses_agent_structured_output_unit.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_router.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_sql_tool.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_sql_tool_integration.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_state.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_summarization_inference.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_swarm_middleware.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_tools.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_types.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_unity_catalog.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_utils.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_utils_type_from_fqn.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_vector_search.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_verifier.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/test_warehouse_model.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/dao_ai/weather_server_mcp.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/hardware_store/.gitkeep +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/hardware_store/test_graph.py +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/images/doritos_upc.png +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/images/lays_upc.png +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/quick_serve_restaurant/.gitkeep +0 -0
- {dao_ai-0.1.18 → dao_ai-0.1.20}/tests/test_mcp_app_auth.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dao-ai
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.20
|
|
4
4
|
Summary: DAO AI: A modular, multi-agent orchestration framework for complex AI workflows. Supports agent handoff, tool integration, and dynamic configuration via YAML.
|
|
5
5
|
Project-URL: Homepage, https://github.com/natefleming/dao-ai
|
|
6
6
|
Project-URL: Documentation, https://natefleming.github.io/dao-ai
|
|
@@ -409,7 +409,8 @@ The `config/examples/` directory contains ready-to-use configurations organized
|
|
|
409
409
|
|
|
410
410
|
- `01_getting_started/minimal.yaml` - Simplest possible agent
|
|
411
411
|
- `02_tools/vector_search_with_reranking.yaml` - RAG with improved accuracy
|
|
412
|
-
- `04_genie/genie_semantic_cache.yaml` - NL-to-SQL with
|
|
412
|
+
- `04_genie/genie_semantic_cache.yaml` - NL-to-SQL with PostgreSQL semantic caching
|
|
413
|
+
- `04_genie/genie_in_memory_semantic_cache.yaml` - NL-to-SQL with in-memory semantic caching (no database)
|
|
413
414
|
- `05_memory/conversation_summarization.yaml` - Long conversation handling
|
|
414
415
|
- `06_on_behalf_of_user/obo_basic.yaml` - User-level access control
|
|
415
416
|
- `07_human_in_the_loop/human_in_the_loop.yaml` - Approval workflows
|
|
@@ -330,7 +330,8 @@ The `config/examples/` directory contains ready-to-use configurations organized
|
|
|
330
330
|
|
|
331
331
|
- `01_getting_started/minimal.yaml` - Simplest possible agent
|
|
332
332
|
- `02_tools/vector_search_with_reranking.yaml` - RAG with improved accuracy
|
|
333
|
-
- `04_genie/genie_semantic_cache.yaml` - NL-to-SQL with
|
|
333
|
+
- `04_genie/genie_semantic_cache.yaml` - NL-to-SQL with PostgreSQL semantic caching
|
|
334
|
+
- `04_genie/genie_in_memory_semantic_cache.yaml` - NL-to-SQL with in-memory semantic caching (no database)
|
|
334
335
|
- `05_memory/conversation_summarization.yaml` - Long conversation handling
|
|
335
336
|
- `06_on_behalf_of_user/obo_basic.yaml` - User-level access control
|
|
336
337
|
- `07_human_in_the_loop/human_in_the_loop.yaml` - Approval workflows
|
|
@@ -52,10 +52,20 @@ flowchart TB
|
|
|
52
52
|
|
|
53
53
|
| File | Description |
|
|
54
54
|
|------|-------------|
|
|
55
|
-
| [`genie_cached.yaml`](./genie_cached.yaml) | Two-tier caching with LRU and semantic cache |
|
|
55
|
+
| [`genie_cached.yaml`](./genie_cached.yaml) | Two-tier caching with LRU and PostgreSQL semantic cache |
|
|
56
|
+
| [`genie_in_memory_semantic_cache.yaml`](./genie_in_memory_semantic_cache.yaml) | In-memory semantic cache (no database required) |
|
|
56
57
|
|
|
57
58
|
## Cache Tiers
|
|
58
59
|
|
|
60
|
+
DAO provides two L2 semantic cache implementations:
|
|
61
|
+
|
|
62
|
+
| Implementation | Best For | Database Required |
|
|
63
|
+
|----------------|----------|-------------------|
|
|
64
|
+
| **PostgreSQL Semantic Cache** | Production multi-instance deployments, large cache sizes (thousands+), cross-instance sharing | Yes (PostgreSQL with pg_vector) |
|
|
65
|
+
| **In-Memory Semantic Cache** | Single-instance deployments, dev/test, no database access, moderate cache sizes (hundreds to low thousands) | No (in-memory only) |
|
|
66
|
+
|
|
67
|
+
Both use the same L2 distance algorithm and support conversation context awareness for consistent behavior.
|
|
68
|
+
|
|
59
69
|
```mermaid
|
|
60
70
|
%%{init: {'theme': 'base'}}%%
|
|
61
71
|
graph TB
|
|
@@ -70,8 +80,9 @@ graph TB
|
|
|
70
80
|
subgraph L2["🧠 L2: Semantic Cache"]
|
|
71
81
|
SEM1["<b>Type:</b> Similarity match"]
|
|
72
82
|
SEM2["<b>Speed:</b> ~50ms"]
|
|
73
|
-
SEM3["<b>
|
|
74
|
-
SEM4["<b>
|
|
83
|
+
SEM3["<b>Options:</b> PostgreSQL or In-Memory"]
|
|
84
|
+
SEM4["<b>Threshold:</b> 0.85-0.95"]
|
|
85
|
+
SEM5["<b>TTL:</b> ttl: 3600 (1 hour)"]
|
|
75
86
|
end
|
|
76
87
|
end
|
|
77
88
|
|
|
@@ -81,21 +92,56 @@ graph TB
|
|
|
81
92
|
|
|
82
93
|
## Configuration
|
|
83
94
|
|
|
95
|
+
### PostgreSQL Semantic Cache (Multi-Instance)
|
|
96
|
+
|
|
84
97
|
```yaml
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
98
|
+
genie_tool:
|
|
99
|
+
function:
|
|
100
|
+
type: factory
|
|
101
|
+
name: dao_ai.tools.create_genie_tool
|
|
102
|
+
args:
|
|
103
|
+
genie_room: *retail_genie_room
|
|
89
104
|
|
|
90
105
|
# ⚡ L1: LRU Cache - Exact match
|
|
91
|
-
|
|
92
|
-
|
|
106
|
+
lru_cache_parameters:
|
|
107
|
+
warehouse: *warehouse
|
|
108
|
+
capacity: 100
|
|
109
|
+
time_to_live_seconds: 3600
|
|
110
|
+
|
|
111
|
+
# 🧠 L2: PostgreSQL Semantic Cache - Similar queries
|
|
112
|
+
semantic_cache_parameters:
|
|
113
|
+
database: *postgres_db
|
|
114
|
+
warehouse: *warehouse
|
|
115
|
+
embedding_model: *embedding_model
|
|
116
|
+
similarity_threshold: 0.85
|
|
117
|
+
time_to_live_seconds: 3600
|
|
118
|
+
context_window_size: 2 # default
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### In-Memory Semantic Cache (Single-Instance)
|
|
122
|
+
|
|
123
|
+
```yaml
|
|
124
|
+
genie_tool:
|
|
125
|
+
function:
|
|
126
|
+
type: factory
|
|
127
|
+
name: dao_ai.tools.create_genie_tool
|
|
128
|
+
args:
|
|
129
|
+
genie_room: *retail_genie_room
|
|
130
|
+
|
|
131
|
+
# Optional L1: LRU Cache - Exact match
|
|
132
|
+
# lru_cache_parameters:
|
|
133
|
+
# warehouse: *warehouse
|
|
134
|
+
# capacity: 100
|
|
135
|
+
# time_to_live_seconds: 3600
|
|
93
136
|
|
|
94
|
-
# 🧠
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
137
|
+
# 🧠 In-Memory Semantic Cache - No database required
|
|
138
|
+
in_memory_semantic_cache_parameters:
|
|
139
|
+
warehouse: *warehouse
|
|
140
|
+
embedding_model: *embedding_model
|
|
141
|
+
similarity_threshold: 0.85
|
|
142
|
+
time_to_live_seconds: 604800 # 1 week
|
|
143
|
+
capacity: 1000 # LRU eviction when full
|
|
144
|
+
context_window_size: 2 # default
|
|
99
145
|
```
|
|
100
146
|
|
|
101
147
|
## Cache Flow
|
|
@@ -210,8 +256,10 @@ agents:
|
|
|
210
256
|
|
|
211
257
|
## Quick Start
|
|
212
258
|
|
|
259
|
+
### PostgreSQL Semantic Cache
|
|
260
|
+
|
|
213
261
|
```bash
|
|
214
|
-
# Run with
|
|
262
|
+
# Run with PostgreSQL semantic cache
|
|
215
263
|
dao-ai chat -c config/examples/04_genie/genie_cached.yaml
|
|
216
264
|
|
|
217
265
|
# Test caching behavior
|
|
@@ -220,6 +268,18 @@ dao-ai chat -c config/examples/04_genie/genie_cached.yaml
|
|
|
220
268
|
> Show me Q4 revenue # Semantic cache hit (~50ms)
|
|
221
269
|
```
|
|
222
270
|
|
|
271
|
+
### In-Memory Semantic Cache
|
|
272
|
+
|
|
273
|
+
```bash
|
|
274
|
+
# Run with in-memory semantic cache (no database required)
|
|
275
|
+
dao-ai chat -c config/examples/04_genie/genie_in_memory_semantic_cache.yaml
|
|
276
|
+
|
|
277
|
+
# Test caching behavior
|
|
278
|
+
> What are the total sales for Q4? # First query - Genie hit
|
|
279
|
+
> What are the total sales for Q4? # Semantic cache hit (~50ms)
|
|
280
|
+
> Show me Q4 revenue # Semantic cache hit (~50ms)
|
|
281
|
+
```
|
|
282
|
+
|
|
223
283
|
## Cache Monitoring
|
|
224
284
|
|
|
225
285
|
```bash
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# yaml-language-server: $schema=../../../schemas/model_config_schema.json
|
|
2
|
+
#
|
|
3
|
+
# Example configuration for Genie semantic cache threshold optimization.
|
|
4
|
+
#
|
|
5
|
+
# This configuration demonstrates how to:
|
|
6
|
+
# 1. Define an evaluation dataset with question pairs
|
|
7
|
+
# 2. Configure threshold optimization parameters
|
|
8
|
+
# 3. Run Optuna Bayesian optimization to find optimal thresholds
|
|
9
|
+
#
|
|
10
|
+
# The optimizer tunes these parameters:
|
|
11
|
+
# - similarity_threshold: Minimum similarity for question matching (0.5-0.99)
|
|
12
|
+
# - context_similarity_threshold: Minimum similarity for context matching (0.5-0.99)
|
|
13
|
+
# - question_weight: Weight for question vs context in combined score (0.1-0.9)
|
|
14
|
+
#
|
|
15
|
+
# Usage:
|
|
16
|
+
# 1. Update the evaluation dataset with your domain-specific question pairs
|
|
17
|
+
# 2. Run the optimization notebook: notebooks/11_optimize_cache_thresholds.py
|
|
18
|
+
# 3. Apply the optimized thresholds to your cache configuration
|
|
19
|
+
|
|
20
|
+
schemas:
|
|
21
|
+
quick_serve_restaurant_schema: &quick_serve_restaurant_schema
|
|
22
|
+
catalog_name: retail_consumer_goods
|
|
23
|
+
schema_name: quick_serve_restaurant
|
|
24
|
+
|
|
25
|
+
resources:
|
|
26
|
+
llms:
|
|
27
|
+
# Judge model for semantic equivalence evaluation
|
|
28
|
+
# Used when expected_match is not provided for an entry
|
|
29
|
+
judge_model: &judge_model
|
|
30
|
+
name: databricks-meta-llama-3-3-70b-instruct
|
|
31
|
+
temperature: 0.0 # Low temperature for consistent judgments
|
|
32
|
+
max_tokens: 10 # Only need "MATCH" or "NO_MATCH"
|
|
33
|
+
|
|
34
|
+
# Embedding model for generating embeddings
|
|
35
|
+
embedding_model: &embedding_model
|
|
36
|
+
name: databricks-gte-large-en
|
|
37
|
+
|
|
38
|
+
warehouses:
|
|
39
|
+
shared_endpoint_warehouse: &shared_endpoint_warehouse
|
|
40
|
+
name: "Shared Endpoint Warehouse"
|
|
41
|
+
warehouse_id: 148ccb90800933a1
|
|
42
|
+
|
|
43
|
+
databases:
|
|
44
|
+
semantic_cache_db: &semantic_cache_db
|
|
45
|
+
name: "Retail and Consumer Goods Database"
|
|
46
|
+
instance_name: "retail-consumer-goods"
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
# =============================================================================
|
|
50
|
+
# CACHE PARAMETERS (Current Configuration)
|
|
51
|
+
# =============================================================================
|
|
52
|
+
# These are the current threshold values that will be optimized
|
|
53
|
+
|
|
54
|
+
cache_parameters: &cache_parameters
|
|
55
|
+
database: *semantic_cache_db
|
|
56
|
+
warehouse: *shared_endpoint_warehouse
|
|
57
|
+
embedding_model: *embedding_model
|
|
58
|
+
similarity_threshold: 0.85 # Question matching threshold
|
|
59
|
+
context_similarity_threshold: 0.80 # Context matching threshold
|
|
60
|
+
question_weight: 0.6 # Weight for question (context = 1 - question)
|
|
61
|
+
time_to_live_seconds: 86400
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
# =============================================================================
|
|
65
|
+
# EVALUATION DATASET
|
|
66
|
+
# =============================================================================
|
|
67
|
+
# Define pairs of questions to evaluate threshold effectiveness.
|
|
68
|
+
#
|
|
69
|
+
# Each entry contains:
|
|
70
|
+
# - question/context: The incoming query
|
|
71
|
+
# - cached_question/cached_context: The cached entry to compare against
|
|
72
|
+
# - expected_match: Whether these should be considered a cache hit
|
|
73
|
+
# - true: Semantically equivalent (should return cached result)
|
|
74
|
+
# - false: Different questions (should not match)
|
|
75
|
+
# - null/omitted: Use LLM judge to determine
|
|
76
|
+
#
|
|
77
|
+
# Tips for good evaluation data:
|
|
78
|
+
# - Include diverse question types from your domain
|
|
79
|
+
# - Balance positive and negative examples
|
|
80
|
+
# - Include edge cases (similar but different questions)
|
|
81
|
+
# - Use real questions from your production cache if available
|
|
82
|
+
|
|
83
|
+
# Note: Embeddings would normally be pre-computed. For this example,
|
|
84
|
+
# we show the structure - use the notebook to generate real embeddings.
|
|
85
|
+
|
|
86
|
+
threshold_eval_dataset: &threshold_eval_dataset
|
|
87
|
+
name: retail_cache_eval_dataset
|
|
88
|
+
description: "Evaluation dataset for retail domain semantic cache tuning"
|
|
89
|
+
entries: []
|
|
90
|
+
# In practice, populate with real entries like:
|
|
91
|
+
#
|
|
92
|
+
# entries:
|
|
93
|
+
# # Positive pair - paraphrases that should match
|
|
94
|
+
# - question: "What are total sales for Q1?"
|
|
95
|
+
# question_embedding: [0.1, 0.2, ...] # Pre-computed embeddings
|
|
96
|
+
# context: "Previous: Show me revenue breakdown"
|
|
97
|
+
# context_embedding: [0.1, 0.2, ...]
|
|
98
|
+
# cached_question: "Show me Q1 total sales"
|
|
99
|
+
# cached_question_embedding: [0.1, 0.2, ...]
|
|
100
|
+
# cached_context: "Previous: Show me revenue breakdown"
|
|
101
|
+
# cached_context_embedding: [0.1, 0.2, ...]
|
|
102
|
+
# expected_match: true
|
|
103
|
+
#
|
|
104
|
+
# # Negative pair - different questions that should NOT match
|
|
105
|
+
# - question: "What is inventory count by store?"
|
|
106
|
+
# question_embedding: [0.3, 0.1, ...]
|
|
107
|
+
# context: ""
|
|
108
|
+
# context_embedding: [0.0, 0.0, ...]
|
|
109
|
+
# cached_question: "Show revenue by region"
|
|
110
|
+
# cached_question_embedding: [0.5, 0.6, ...]
|
|
111
|
+
# cached_context: ""
|
|
112
|
+
# cached_context_embedding: [0.0, 0.0, ...]
|
|
113
|
+
# expected_match: false
|
|
114
|
+
#
|
|
115
|
+
# # Unlabeled entry - LLM judge will determine
|
|
116
|
+
# - question: "How many items sold last week?"
|
|
117
|
+
# question_embedding: [0.2, 0.3, ...]
|
|
118
|
+
# context: "Previous: Filter by electronics"
|
|
119
|
+
# context_embedding: [0.1, 0.4, ...]
|
|
120
|
+
# cached_question: "Total items sold in past 7 days"
|
|
121
|
+
# cached_question_embedding: [0.2, 0.35, ...]
|
|
122
|
+
# cached_context: "Previous: Filter by electronics"
|
|
123
|
+
# cached_context_embedding: [0.1, 0.4, ...]
|
|
124
|
+
# # expected_match omitted - will use LLM judge
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
# =============================================================================
|
|
128
|
+
# THRESHOLD OPTIMIZATION CONFIGURATION
|
|
129
|
+
# =============================================================================
|
|
130
|
+
# Configure the optimization run parameters.
|
|
131
|
+
|
|
132
|
+
threshold_optimizations:
|
|
133
|
+
|
|
134
|
+
optimize_retail_cache_thresholds:
|
|
135
|
+
name: optimize_retail_cache_thresholds
|
|
136
|
+
cache_parameters: *cache_parameters # Current thresholds to improve
|
|
137
|
+
dataset: *threshold_eval_dataset # Evaluation dataset
|
|
138
|
+
judge_model: *judge_model # LLM for unlabeled entries
|
|
139
|
+
|
|
140
|
+
# Optimization parameters
|
|
141
|
+
n_trials: 50 # Number of Optuna trials (more = better results)
|
|
142
|
+
metric: f1 # Metric to optimize: f1, precision, recall, fbeta
|
|
143
|
+
beta: 1.0 # Beta for fbeta metric (higher = favor recall)
|
|
144
|
+
seed: 42 # Random seed for reproducibility
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
# =============================================================================
|
|
148
|
+
# USAGE INSTRUCTIONS
|
|
149
|
+
# =============================================================================
|
|
150
|
+
#
|
|
151
|
+
# 1. PREPARE EVALUATION DATA:
|
|
152
|
+
# Generate embeddings for your question pairs using the embedding model.
|
|
153
|
+
# You can use the notebook or the generate_eval_dataset_from_cache() function
|
|
154
|
+
# to create a dataset from existing cache entries.
|
|
155
|
+
#
|
|
156
|
+
# 2. RUN OPTIMIZATION:
|
|
157
|
+
# Use the notebook notebooks/11_optimize_cache_thresholds.py with this config,
|
|
158
|
+
# or run programmatically:
|
|
159
|
+
#
|
|
160
|
+
# ```python
|
|
161
|
+
# from dao_ai.config import AppConfig
|
|
162
|
+
#
|
|
163
|
+
# config = AppConfig.from_file("cache_threshold_optimization.yaml")
|
|
164
|
+
# optimization = config.threshold_optimizations["optimize_retail_cache_thresholds"]
|
|
165
|
+
# result = optimization.optimize()
|
|
166
|
+
#
|
|
167
|
+
# print(f"Optimized thresholds: {result.optimized_thresholds}")
|
|
168
|
+
# print(f"Improvement: {result.improvement:.1%}")
|
|
169
|
+
# ```
|
|
170
|
+
#
|
|
171
|
+
# 3. APPLY RESULTS:
|
|
172
|
+
# Update your semantic cache configuration with the optimized values:
|
|
173
|
+
#
|
|
174
|
+
# semantic_cache_parameters:
|
|
175
|
+
# similarity_threshold: <optimized_value>
|
|
176
|
+
# context_similarity_threshold: <optimized_value>
|
|
177
|
+
# question_weight: <optimized_value>
|
|
178
|
+
#
|
|
179
|
+
# 4. MONITOR:
|
|
180
|
+
# Track cache hit rates and accuracy in production to validate improvements.
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# yaml-language-server: $schema=../../../schemas/model_config_schema.json
|
|
2
|
+
#
|
|
3
|
+
# Example configuration for Genie with in-memory semantic caching:
|
|
4
|
+
# - In-Memory Semantic Cache: Similarity search without external database
|
|
5
|
+
# - Optional LRU Cache (L1): Fast O(1) exact match lookup
|
|
6
|
+
#
|
|
7
|
+
# This configuration is ideal for:
|
|
8
|
+
# - Environments without access to PostgreSQL or Databricks Lakebase
|
|
9
|
+
# - Single-instance deployments (cache not shared across instances)
|
|
10
|
+
# - Moderate cache sizes (hundreds to low thousands of entries)
|
|
11
|
+
# - Cases where cache persistence across restarts is not required
|
|
12
|
+
#
|
|
13
|
+
# Cache flow: Question → LRU (exact match) → In-Memory Semantic (similarity) → Genie API
|
|
14
|
+
# On cache hit, the cached SQL is re-executed against the warehouse for fresh data.
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
schemas:
|
|
18
|
+
|
|
19
|
+
quick_serve_restaurant_schema: &quick_serve_restaurant_schema
|
|
20
|
+
catalog_name: retail_consumer_goods # Unity Catalog name
|
|
21
|
+
schema_name: quick_serve_restaurant # Schema within the catalog
|
|
22
|
+
|
|
23
|
+
resources:
|
|
24
|
+
llms:
|
|
25
|
+
# Primary LLM for general tasks
|
|
26
|
+
default_llm: &default_llm
|
|
27
|
+
name: databricks-claude-sonnet-4
|
|
28
|
+
temperature: 0.1 # Low temperature for consistent responses
|
|
29
|
+
max_tokens: 8192 # Maximum tokens per response
|
|
30
|
+
on_behalf_of_user: False
|
|
31
|
+
|
|
32
|
+
# Embedding model for semantic similarity search
|
|
33
|
+
embedding_model: &embedding_model
|
|
34
|
+
name: databricks-gte-large-en # Text embedding model
|
|
35
|
+
on_behalf_of_user: False
|
|
36
|
+
|
|
37
|
+
warehouses:
|
|
38
|
+
# Warehouse for executing SQL queries (used by semantic cache)
|
|
39
|
+
shared_endpoint_warehouse: &shared_endpoint_warehouse
|
|
40
|
+
name: "Shared Endpoint Warehouse" # Human-readable name
|
|
41
|
+
description: "A warehouse for shared endpoints" # Description
|
|
42
|
+
warehouse_id: 148ccb90800933a1 # Databricks warehouse ID
|
|
43
|
+
on_behalf_of_user: False
|
|
44
|
+
|
|
45
|
+
genie_rooms:
|
|
46
|
+
# Genie space for retail data queries
|
|
47
|
+
retail_genie_room: &retail_genie_room
|
|
48
|
+
name: "Retail AI Genie Room" # Human-readable name
|
|
49
|
+
description: "A room for Genie agents to interact" # Description
|
|
50
|
+
space_id:
|
|
51
|
+
env: RETAIL_AI_GENIE_SPACE_ID
|
|
52
|
+
default_value: 01f01c91f1f414d59daaefd2b7ec82ea
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
# =============================================================================
|
|
56
|
+
# MEMORY CONFIGURATION
|
|
57
|
+
# =============================================================================
|
|
58
|
+
# Configure in-memory storage for agent conversations and state persistence
|
|
59
|
+
|
|
60
|
+
memory: &memory
|
|
61
|
+
# Conversation checkpointing for state persistence
|
|
62
|
+
checkpointer:
|
|
63
|
+
name: default_checkpointer # Checkpointer identifier (type inferred as memory - no database)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
tools:
|
|
67
|
+
genie_tool: &genie_tool
|
|
68
|
+
name: genie
|
|
69
|
+
function:
|
|
70
|
+
type: factory # Tool type: factory function
|
|
71
|
+
name: dao_ai.tools.create_genie_tool # Factory function path
|
|
72
|
+
args: # Arguments passed to factory
|
|
73
|
+
name: my_genie_tool
|
|
74
|
+
description: Answers questions about retail products and inventory
|
|
75
|
+
genie_room: *retail_genie_room # Reference to Genie room config
|
|
76
|
+
|
|
77
|
+
# Optional L1 Cache: LRU (Least Recently Used) - Fast exact match
|
|
78
|
+
# Uncomment to enable LRU cache in front of semantic cache
|
|
79
|
+
# lru_cache_parameters:
|
|
80
|
+
# warehouse: *shared_endpoint_warehouse # Warehouse to re-execute cached SQL
|
|
81
|
+
# capacity: 100 # Maximum number of cached entries
|
|
82
|
+
# time_to_live_seconds: 3600 # Cache entries expire after 1 hour
|
|
83
|
+
|
|
84
|
+
# In-Memory Semantic Cache: Similarity-based lookup with LRU eviction (NO database required)
|
|
85
|
+
# Default settings optimized for ~30 users on 8GB machine:
|
|
86
|
+
# - Capacity: 10,000 entries (~200MB, ~330 queries/user)
|
|
87
|
+
# - Eviction: LRU (Least Recently Used) keeps hot queries cached
|
|
88
|
+
# - TTL: 1 week (accommodates weekly work patterns)
|
|
89
|
+
# - Memory: ~4-5% of 8GB system
|
|
90
|
+
in_memory_semantic_cache_parameters:
|
|
91
|
+
warehouse: *shared_endpoint_warehouse # Warehouse used to re-execute cached SQL
|
|
92
|
+
embedding_model: *embedding_model # Reference to embedding model
|
|
93
|
+
# embedding_dims: 1024 # Auto-detected if omitted (recommended)
|
|
94
|
+
similarity_threshold: 0.85 # Minimum similarity for question matching (L2 distance to 0-1)
|
|
95
|
+
context_similarity_threshold: 0.80 # Minimum similarity for context matching
|
|
96
|
+
# time_to_live_seconds: 604800 # Cache entries expire after 1 week (default)
|
|
97
|
+
# capacity: 10000 # Max cache entries, LRU eviction when full (default: 10000, ~200MB)
|
|
98
|
+
# # Adjust for different scenarios:
|
|
99
|
+
# # - Small (5-10 users): capacity: 1000 (~20MB)
|
|
100
|
+
# # - Medium (30 users): capacity: 10000 (~200MB, default)
|
|
101
|
+
# # - Large (100 users): capacity: 30000 (~600MB)
|
|
102
|
+
# # - Unlimited: capacity: null (not recommended - unbounded memory)
|
|
103
|
+
context_window_size: 3 # Number of previous conversation turns to include
|
|
104
|
+
# max_context_tokens: 2000 # Maximum context length (default: 2000)
|
|
105
|
+
# question_weight: 0.6 # Weight for question similarity (default: 0.6)
|
|
106
|
+
# context_weight: 0.4 # Weight for context similarity (default: 0.4)
|
|
107
|
+
# Note: question_weight + context_weight must equal 1.0
|
|
108
|
+
|
|
109
|
+
persist_conversation: true
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
agents:
|
|
113
|
+
genie: &genie
|
|
114
|
+
name: genie # Agent identifier
|
|
115
|
+
description: "Genie Agent with In-Memory Semantic Cache"
|
|
116
|
+
model: *default_llm # Reference to LLM configuration
|
|
117
|
+
tools: # Tools available to this agent
|
|
118
|
+
- *genie_tool
|
|
119
|
+
prompt: | # System prompt defining agent behavior
|
|
120
|
+
Answers questions about retail products and inventory using natural language.
|
|
121
|
+
You have access to a semantic cache that remembers similar questions to provide faster responses.
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
app:
|
|
125
|
+
name: genie_in_memory_semantic_cache_dao # Application name
|
|
126
|
+
description: "Multi-agent system that talks to genie with in-memory semantic caching (no database required)"
|
|
127
|
+
log_level: DEBUG # Logging level for the application
|
|
128
|
+
environment_vars: # Secrets to inject at runtime
|
|
129
|
+
RETAIL_AI_DATABRICKS_CLIENT_ID: "{{secrets/retail_consumer_goods/RETAIL_AI_DATABRICKS_CLIENT_ID}}"
|
|
130
|
+
RETAIL_AI_DATABRICKS_CLIENT_SECRET: "{{secrets/retail_consumer_goods/RETAIL_AI_DATABRICKS_CLIENT_SECRET}}"
|
|
131
|
+
RETAIL_AI_DATABRICKS_HOST: "{{secrets/retail_consumer_goods/RETAIL_AI_DATABRICKS_HOST}}"
|
|
132
|
+
registered_model: # MLflow registered model configuration
|
|
133
|
+
schema: *quick_serve_restaurant_schema # Schema where model will be registered
|
|
134
|
+
name: dao_genie_in_memory_semantic_cache # Model name in MLflow registry
|
|
135
|
+
endpoint_name: dao_genie_in_memory_semantic_cache # Model serving endpoint name
|
|
136
|
+
tags: # Tags for resource organization
|
|
137
|
+
business: rcg # Business unit identifier
|
|
138
|
+
streaming: true # Indicates streaming capabilities
|
|
139
|
+
permissions: # Model serving permissions
|
|
140
|
+
- principals: [users] # Grant access to all users
|
|
141
|
+
entitlements:
|
|
142
|
+
- CAN_QUERY # Query permissions
|
|
143
|
+
agents: # List of agents included in the system
|
|
144
|
+
- *genie # Genie agent with in-memory cache
|
|
145
|
+
orchestration: # Agent orchestration configuration
|
|
146
|
+
memory: *memory # In-memory conversation persistence
|
|
147
|
+
swarm: # Swarm orchestration pattern
|
|
148
|
+
default_agent: *genie # Default agent for routing
|
|
@@ -52,7 +52,8 @@ Or jump directly to the category that matches your current need.
|
|
|
52
52
|
**Natural language to SQL**
|
|
53
53
|
- Basic Genie integration
|
|
54
54
|
- LRU caching for performance
|
|
55
|
-
-
|
|
55
|
+
- PostgreSQL semantic caching with embeddings
|
|
56
|
+
- In-memory semantic caching (no database required)
|
|
56
57
|
|
|
57
58
|
👉 Query data with natural language, optimized with caching
|
|
58
59
|
|
|
@@ -120,9 +120,10 @@ Improve performance and reduce costs through intelligent caching.
|
|
|
120
120
|
| Example | Description |
|
|
121
121
|
|---------|-------------|
|
|
122
122
|
| `genie_lru_cache.yaml` | LRU (Least Recently Used) caching for Genie |
|
|
123
|
-
| `genie_semantic_cache.yaml` | Two-tier semantic caching with embeddings |
|
|
123
|
+
| `genie_semantic_cache.yaml` | Two-tier semantic caching with PostgreSQL embeddings |
|
|
124
|
+
| `genie_in_memory_semantic_cache.yaml` | In-memory semantic caching (no database required) |
|
|
124
125
|
|
|
125
|
-
**Prerequisites:** PostgreSQL or Lakebase for
|
|
126
|
+
**Prerequisites:** PostgreSQL or Lakebase required for `genie_semantic_cache.yaml` only
|
|
126
127
|
**Next:** Add persistence in `05_memory/`
|
|
127
128
|
|
|
128
129
|
---
|