behive 0.3.2__tar.gz → 0.4.0__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.
- {behive-0.3.2/src/behive.egg-info → behive-0.4.0}/PKG-INFO +10 -10
- {behive-0.3.2 → behive-0.4.0}/README.md +6 -6
- {behive-0.3.2 → behive-0.4.0}/pyproject.toml +5 -3
- {behive-0.3.2 → behive-0.4.0}/src/behive/__init__.py +5 -1
- {behive-0.3.2 → behive-0.4.0}/src/behive/cli.py +156 -12
- {behive-0.3.2 → behive-0.4.0}/src/behive/client.py +1 -4
- {behive-0.3.2 → behive-0.4.0}/src/behive/compat/__init__.py +1 -1
- {behive-0.3.2 → behive-0.4.0}/src/behive/compat/shims.py +9 -1
- {behive-0.3.2 → behive-0.4.0}/src/behive/engine/__init__.py +8 -4
- {behive-0.3.2 → behive-0.4.0}/src/behive/engine/bionic_quorum.py +9 -9
- behive-0.3.2/src/behive/engine/quality.py → behive-0.4.0/src/behive/engine/content_quality.py +8 -11
- {behive-0.3.2 → behive-0.4.0}/src/behive/engine/db.py +17 -16
- {behive-0.3.2 → behive-0.4.0}/src/behive/engine/db_helpers.py +11 -16
- {behive-0.3.2 → behive-0.4.0}/src/behive/engine/domain_reputation.py +9 -9
- {behive-0.3.2 → behive-0.4.0}/src/behive/engine/drones.py +9 -9
- {behive-0.3.2 → behive-0.4.0}/src/behive/engine/events.py +7 -5
- behive-0.4.0/src/behive/engine/falsifier.py +1221 -0
- behive-0.4.0/src/behive/engine/graph_engine.py +1198 -0
- {behive-0.3.2 → behive-0.4.0}/src/behive/engine/guardrail.py +1 -1
- {behive-0.3.2 → behive-0.4.0}/src/behive/engine/harvest.py +9 -9
- behive-0.4.0/src/behive/engine/intel_summary.py +507 -0
- {behive-0.3.2 → behive-0.4.0}/src/behive/engine/llm.py +69 -0
- behive-0.4.0/src/behive/engine/master_intelligence.py +1158 -0
- {behive-0.3.2 → behive-0.4.0}/src/behive/engine/orchestrator.py +163 -56
- {behive-0.3.2 → behive-0.4.0}/src/behive/engine/prescout.py +21 -21
- {behive-0.3.2 → behive-0.4.0}/src/behive/engine/process.py +49 -44
- {behive-0.3.2 → behive-0.4.0}/src/behive/engine/queen_calibrator.py +6 -5
- {behive-0.3.2 → behive-0.4.0}/src/behive/engine/queen_fact_mem.py +28 -55
- behive-0.4.0/src/behive/engine/queen_feedback.py +1404 -0
- {behive-0.3.2 → behive-0.4.0}/src/behive/engine/queen_memory.py +1 -1
- {behive-0.3.2 → behive-0.4.0}/src/behive/engine/queen_primer.py +12 -12
- behive-0.4.0/src/behive/engine/queen_tools.py +1434 -0
- behive-0.4.0/src/behive/engine/rag.py +2350 -0
- {behive-0.3.2 → behive-0.4.0}/src/behive/engine/scout.py +4 -17
- {behive-0.3.2 → behive-0.4.0}/src/behive/engine/synth.py +26 -23
- {behive-0.3.2 → behive-0.4.0}/src/behive/knowledge_graph.py +5 -3
- {behive-0.3.2 → behive-0.4.0}/src/behive/server.py +69 -4
- {behive-0.3.2 → behive-0.4.0/src/behive.egg-info}/PKG-INFO +10 -10
- behive-0.4.0/src/behive.egg-info/SOURCES.txt +282 -0
- behive-0.4.0/tests/test_80_async_deep.py +293 -0
- behive-0.4.0/tests/test_80_async_omega.py +458 -0
- behive-0.4.0/tests/test_80_async_process.py +236 -0
- behive-0.4.0/tests/test_80_async_subprocess.py +250 -0
- behive-0.4.0/tests/test_80_batch_a_harvest_process.py +808 -0
- behive-0.4.0/tests/test_80_batch_a_synth_rag.py +908 -0
- behive-0.4.0/tests/test_80_batch_bc_orch_intel.py +636 -0
- behive-0.4.0/tests/test_80_batch_def_remaining.py +530 -0
- behive-0.4.0/tests/test_80_batch_g_deep.py +461 -0
- behive-0.4.0/tests/test_80_breadth.py +196 -0
- behive-0.4.0/tests/test_80_brute_force.py +4659 -0
- behive-0.4.0/tests/test_80_brute_v3.py +255 -0
- behive-0.4.0/tests/test_80_clean_execution.py +321 -0
- behive-0.4.0/tests/test_80_config_client.py +155 -0
- behive-0.4.0/tests/test_80_conflict_detector.py +164 -0
- behive-0.4.0/tests/test_80_continuation.py +416 -0
- behive-0.4.0/tests/test_80_coverage_buster.py +371 -0
- behive-0.4.0/tests/test_80_coverage_push.py +191 -0
- behive-0.4.0/tests/test_80_deep_dive.py +417 -0
- behive-0.4.0/tests/test_80_deep_push_v2.py +303 -0
- behive-0.4.0/tests/test_80_deep_targets_v2.py +236 -0
- behive-0.4.0/tests/test_80_domrep_intel_primer.py +144 -0
- behive-0.4.0/tests/test_80_drones_guard_api.py +105 -0
- behive-0.4.0/tests/test_80_drones_scout_mi.py +340 -0
- behive-0.4.0/tests/test_80_events_deep.py +117 -0
- behive-0.4.0/tests/test_80_events_domrep_intel.py +199 -0
- behive-0.4.0/tests/test_80_falsifier_deep.py +175 -0
- behive-0.4.0/tests/test_80_falsifier_synth_extra.py +110 -0
- behive-0.4.0/tests/test_80_falsifier_v3.py +151 -0
- behive-0.4.0/tests/test_80_feedback_deep.py +216 -0
- behive-0.4.0/tests/test_80_feedback_deep_v3.py +218 -0
- behive-0.4.0/tests/test_80_feedback_v2.py +204 -0
- behive-0.4.0/tests/test_80_final_mega.py +395 -0
- behive-0.4.0/tests/test_80_final_push.py +426 -0
- behive-0.4.0/tests/test_80_final_wave.py +255 -0
- behive-0.4.0/tests/test_80_golden_process.py +102 -0
- behive-0.4.0/tests/test_80_graph_deep.py +175 -0
- behive-0.4.0/tests/test_80_graph_deep_v2.py +157 -0
- behive-0.4.0/tests/test_80_graph_engine.py +527 -0
- behive-0.4.0/tests/test_80_graph_massive.py +214 -0
- behive-0.4.0/tests/test_80_harvest_deep.py +177 -0
- behive-0.4.0/tests/test_80_harvest_deep_v2.py +168 -0
- behive-0.4.0/tests/test_80_harvest_intel_dom.py +172 -0
- behive-0.4.0/tests/test_80_harvest_orch.py +153 -0
- behive-0.4.0/tests/test_80_harvest_v3.py +166 -0
- behive-0.4.0/tests/test_80_heavy_modules.py +292 -0
- behive-0.4.0/tests/test_80_import_sweep.py +85 -0
- behive-0.4.0/tests/test_80_init_modules.py +303 -0
- behive-0.4.0/tests/test_80_integration.py +582 -0
- behive-0.4.0/tests/test_80_integration_h.py +378 -0
- behive-0.4.0/tests/test_80_intel_calib_domain.py +196 -0
- behive-0.4.0/tests/test_80_llm_db_preproc.py +156 -0
- behive-0.4.0/tests/test_80_llm_deep.py +77 -0
- behive-0.4.0/tests/test_80_low_modules.py +418 -0
- behive-0.4.0/tests/test_80_lowhanging.py +253 -0
- behive-0.4.0/tests/test_80_massive_clean.py +264 -0
- behive-0.4.0/tests/test_80_mega_push.py +414 -0
- behive-0.4.0/tests/test_80_mega_push2.py +354 -0
- behive-0.4.0/tests/test_80_mi_deep.py +165 -0
- behive-0.4.0/tests/test_80_mi_deep_v2.py +202 -0
- behive-0.4.0/tests/test_80_mi_synth_deep.py +237 -0
- behive-0.4.0/tests/test_80_mi_v3.py +176 -0
- behive-0.4.0/tests/test_80_omega.py +234 -0
- behive-0.4.0/tests/test_80_orch_deep.py +280 -0
- behive-0.4.0/tests/test_80_orch_plan_deep.py +187 -0
- behive-0.4.0/tests/test_80_orch_prescout_mega.py +304 -0
- behive-0.4.0/tests/test_80_orchestrator_deep_v2.py +159 -0
- behive-0.4.0/tests/test_80_orchestrator_helpers.py +135 -0
- behive-0.4.0/tests/test_80_orchestrator_v3.py +197 -0
- behive-0.4.0/tests/test_80_pipeline_mega.py +298 -0
- behive-0.4.0/tests/test_80_planner_entities.py +440 -0
- behive-0.4.0/tests/test_80_prescout_dance.py +138 -0
- behive-0.4.0/tests/test_80_prescout_deep_v2.py +139 -0
- behive-0.4.0/tests/test_80_prescout_feedback.py +319 -0
- behive-0.4.0/tests/test_80_prescout_pure.py +139 -0
- behive-0.4.0/tests/test_80_prescout_v3.py +189 -0
- behive-0.4.0/tests/test_80_process_classes.py +181 -0
- behive-0.4.0/tests/test_80_process_deep.py +215 -0
- behive-0.4.0/tests/test_80_process_killer.py +194 -0
- behive-0.4.0/tests/test_80_process_orch_harvest.py +329 -0
- behive-0.4.0/tests/test_80_process_pure.py +161 -0
- behive-0.4.0/tests/test_80_process_regex.py +158 -0
- behive-0.4.0/tests/test_80_process_v3.py +172 -0
- behive-0.4.0/tests/test_80_process_v4.py +181 -0
- behive-0.4.0/tests/test_80_pure_functions.py +506 -0
- behive-0.4.0/tests/test_80_quality_events.py +170 -0
- behive-0.4.0/tests/test_80_queen_mega.py +366 -0
- behive-0.4.0/tests/test_80_queen_memory_calibrator.py +169 -0
- behive-0.4.0/tests/test_80_queen_tools_deep.py +151 -0
- behive-0.4.0/tests/test_80_quorum_quality.py +156 -0
- behive-0.4.0/tests/test_80_rag_deep.py +271 -0
- behive-0.4.0/tests/test_80_rag_deep_v2.py +225 -0
- behive-0.4.0/tests/test_80_rag_deep_v3.py +156 -0
- behive-0.4.0/tests/test_80_rag_massive.py +250 -0
- behive-0.4.0/tests/test_80_rag_mega.py +250 -0
- behive-0.4.0/tests/test_80_rag_mi_deep.py +241 -0
- behive-0.4.0/tests/test_80_rag_mi_final.py +175 -0
- behive-0.4.0/tests/test_80_rag_v4.py +192 -0
- behive-0.4.0/tests/test_80_remaining.py +349 -0
- behive-0.4.0/tests/test_80_routing_validation.py +296 -0
- behive-0.4.0/tests/test_80_schema_deep.py +185 -0
- behive-0.4.0/tests/test_80_scout_deep.py +222 -0
- behive-0.4.0/tests/test_80_scout_feedback.py +242 -0
- behive-0.4.0/tests/test_80_scout_synth_v2.py +156 -0
- behive-0.4.0/tests/test_80_search_backends_v3.py +110 -0
- behive-0.4.0/tests/test_80_search_deep_v2.py +91 -0
- behive-0.4.0/tests/test_80_search_falsifier.py +352 -0
- behive-0.4.0/tests/test_80_search_llm.py +124 -0
- behive-0.4.0/tests/test_80_server_mcp.py +212 -0
- behive-0.4.0/tests/test_80_small_push.py +283 -0
- behive-0.4.0/tests/test_80_smaller_modules.py +212 -0
- behive-0.4.0/tests/test_80_surgical.py +350 -0
- behive-0.4.0/tests/test_80_surgical_targets.py +303 -0
- behive-0.4.0/tests/test_80_synth_deep_v2.py +227 -0
- behive-0.4.0/tests/test_80_synth_graph_extra.py +120 -0
- behive-0.4.0/tests/test_80_synth_killer.py +109 -0
- behive-0.4.0/tests/test_80_synth_mega.py +300 -0
- behive-0.4.0/tests/test_80_synth_mi_deep.py +290 -0
- behive-0.4.0/tests/test_80_synth_queen.py +182 -0
- behive-0.4.0/tests/test_80_targeted_lines.py +238 -0
- behive-0.4.0/tests/test_api_scout.py +13 -0
- behive-0.4.0/tests/test_beeworker_deep.py +416 -0
- behive-0.4.0/tests/test_bionic_quorum.py +13 -0
- behive-0.4.0/tests/test_blast_coverage.py +272 -0
- behive-0.4.0/tests/test_branch_coverage.py +258 -0
- behive-0.4.0/tests/test_cli.py +98 -0
- behive-0.4.0/tests/test_client.py +14 -0
- behive-0.4.0/tests/test_config.py +25 -0
- behive-0.4.0/tests/test_constants.py +55 -0
- behive-0.4.0/tests/test_content_quality.py +103 -0
- behive-0.4.0/tests/test_cov_40pct_push.py +427 -0
- behive-0.4.0/tests/test_cov_async_deep.py +358 -0
- behive-0.4.0/tests/test_cov_async_push.py +259 -0
- behive-0.4.0/tests/test_cov_breakthrough.py +285 -0
- behive-0.4.0/tests/test_cov_breakthrough2.py +360 -0
- behive-0.4.0/tests/test_cov_ceiling_breaker.py +291 -0
- behive-0.4.0/tests/test_cov_deep.py +279 -0
- behive-0.4.0/tests/test_cov_deep2.py +429 -0
- behive-0.4.0/tests/test_cov_deep3.py +230 -0
- behive-0.4.0/tests/test_cov_drones.py +39 -0
- behive-0.4.0/tests/test_cov_drones_direct.py +326 -0
- behive-0.4.0/tests/test_cov_falsifier.py +31 -0
- behive-0.4.0/tests/test_cov_final50.py +352 -0
- behive-0.4.0/tests/test_cov_final_push.py +462 -0
- behive-0.4.0/tests/test_cov_graph.py +40 -0
- behive-0.4.0/tests/test_cov_graph_rag.py +302 -0
- behive-0.4.0/tests/test_cov_harvest.py +61 -0
- behive-0.4.0/tests/test_cov_harvest_llm_api.py +302 -0
- behive-0.4.0/tests/test_cov_import_push.py +333 -0
- behive-0.4.0/tests/test_cov_massive.py +567 -0
- behive-0.4.0/tests/test_cov_master.py +32 -0
- behive-0.4.0/tests/test_cov_mock_pool.py +230 -0
- behive-0.4.0/tests/test_cov_orchestrator_deep.py +272 -0
- behive-0.4.0/tests/test_cov_orchestrator_full.py +315 -0
- behive-0.4.0/tests/test_cov_prescout.py +32 -0
- behive-0.4.0/tests/test_cov_prescout_harvest_pure.py +242 -0
- behive-0.4.0/tests/test_cov_process.py +159 -0
- behive-0.4.0/tests/test_cov_process_deep.py +307 -0
- behive-0.4.0/tests/test_cov_process_deep2.py +338 -0
- behive-0.4.0/tests/test_cov_processing_drones.py +217 -0
- behive-0.4.0/tests/test_cov_pure_functions.py +237 -0
- behive-0.4.0/tests/test_cov_push50.py +313 -0
- behive-0.4.0/tests/test_cov_queen_scout_full.py +307 -0
- behive-0.4.0/tests/test_cov_queen_tools.py +45 -0
- behive-0.4.0/tests/test_cov_rag_master.py +246 -0
- behive-0.4.0/tests/test_cov_real_execution.py +381 -0
- behive-0.4.0/tests/test_cov_server_client.py +111 -0
- behive-0.4.0/tests/test_cov_server_endpoints.py +130 -0
- behive-0.4.0/tests/test_cov_strategic.py +453 -0
- behive-0.4.0/tests/test_cov_synth.py +45 -0
- behive-0.4.0/tests/test_cov_synth_deep.py +236 -0
- behive-0.4.0/tests/test_cov_synth_graph_rag.py +325 -0
- behive-0.4.0/tests/test_cov_targeted_modules.py +383 -0
- behive-0.4.0/tests/test_cov_utilities_deep.py +325 -0
- behive-0.4.0/tests/test_cov_zero_modules.py +349 -0
- behive-0.4.0/tests/test_coverage_phase7.py +324 -0
- behive-0.4.0/tests/test_cross_35.py +250 -0
- behive-0.4.0/tests/test_db.py +33 -0
- {behive-0.3.2 → behive-0.4.0}/tests/test_db_integration.py +11 -11
- behive-0.4.0/tests/test_deep_execution.py +527 -0
- behive-0.4.0/tests/test_deep_functions.py +415 -0
- behive-0.4.0/tests/test_domain_reputation.py +40 -0
- behive-0.4.0/tests/test_drones.py +14 -0
- behive-0.4.0/tests/test_events.py +76 -0
- behive-0.4.0/tests/test_falsifier.py +140 -0
- behive-0.4.0/tests/test_final_30pct.py +230 -0
- behive-0.4.0/tests/test_functional.py +319 -0
- behive-0.4.0/tests/test_gap_fill_35.py +209 -0
- behive-0.4.0/tests/test_graph_engine.py +71 -0
- behive-0.4.0/tests/test_guardrail.py +105 -0
- behive-0.4.0/tests/test_harvest.py +24 -0
- behive-0.4.0/tests/test_heavy_coverage.py +223 -0
- behive-0.4.0/tests/test_integration_mocked.py +258 -0
- behive-0.4.0/tests/test_knowledge_graph.py +33 -0
- behive-0.4.0/tests/test_llm.py +85 -0
- behive-0.4.0/tests/test_lowest_coverage.py +459 -0
- behive-0.4.0/tests/test_mass_coverage_35.py +322 -0
- behive-0.4.0/tests/test_mcp.py +14 -0
- behive-0.4.0/tests/test_mega_coverage.py +639 -0
- behive-0.4.0/tests/test_micro_35.py +206 -0
- behive-0.4.0/tests/test_orch_harvest_35.py +327 -0
- behive-0.4.0/tests/test_orchestrator.py +86 -0
- behive-0.4.0/tests/test_preprocessor.py +60 -0
- behive-0.4.0/tests/test_prescout.py +22 -0
- behive-0.4.0/tests/test_prescout_deep_35.py +266 -0
- behive-0.4.0/tests/test_process.py +50 -0
- behive-0.4.0/tests/test_process_deep.py +82 -0
- behive-0.4.0/tests/test_process_orch_deep.py +364 -0
- behive-0.4.0/tests/test_push_30pct.py +312 -0
- behive-0.4.0/tests/test_push_35_final.py +271 -0
- behive-0.4.0/tests/test_queen_deep.py +272 -0
- behive-0.4.0/tests/test_queen_honey.py +301 -0
- behive-0.4.0/tests/test_queen_load_persist.py +230 -0
- behive-0.4.0/tests/test_rag.py +113 -0
- behive-0.4.0/tests/test_rag_orch_30pct.py +429 -0
- behive-0.4.0/tests/test_real_heavy.py +279 -0
- behive-0.4.0/tests/test_real_integration.py +189 -0
- {behive-0.3.2 → behive-0.4.0}/tests/test_regression.py +10 -3
- behive-0.4.0/tests/test_runpy_main.py +301 -0
- behive-0.4.0/tests/test_scout.py +38 -0
- behive-0.4.0/tests/test_search_backends.py +117 -0
- behive-0.4.0/tests/test_server.py +81 -0
- behive-0.4.0/tests/test_server_and_more.py +253 -0
- behive-0.4.0/tests/test_server_cli_35.py +164 -0
- {behive-0.3.2 → behive-0.4.0}/tests/test_server_integration.py +3 -1
- {behive-0.3.2 → behive-0.4.0}/tests/test_smoke.py +4 -2
- behive-0.4.0/tests/test_synth.py +22 -0
- behive-0.4.0/tests/test_uncovered_functions.py +257 -0
- behive-0.3.2/src/behive/engine/bedrock_compat.py +0 -152
- behive-0.3.2/src/behive/engine/queen.py +0 -839
- behive-0.3.2/src/behive/engine/queen_planner_extracted.py +0 -838
- behive-0.3.2/src/behive/engine/runner.py +0 -147
- behive-0.3.2/src/behive.egg-info/SOURCES.txt +0 -57
- behive-0.3.2/tests/test_llm.py +0 -179
- behive-0.3.2/tests/test_search_backends.py +0 -98
- {behive-0.3.2 → behive-0.4.0}/LICENSE +0 -0
- {behive-0.3.2 → behive-0.4.0}/setup.cfg +0 -0
- {behive-0.3.2 → behive-0.4.0}/src/behive/config.py +0 -0
- {behive-0.3.2 → behive-0.4.0}/src/behive/engine/__main__.py +0 -0
- {behive-0.3.2 → behive-0.4.0}/src/behive/engine/api_scout.py +0 -0
- {behive-0.3.2 → behive-0.4.0}/src/behive/engine/constants.py +0 -0
- {behive-0.3.2 → behive-0.4.0}/src/behive/engine/hive_api_sources.json +0 -0
- {behive-0.3.2 → behive-0.4.0}/src/behive/engine/preprocessor.py +0 -0
- {behive-0.3.2 → behive-0.4.0}/src/behive/engine/search_backends.py +0 -0
- {behive-0.3.2 → behive-0.4.0}/src/behive/init-db.sql +0 -0
- {behive-0.3.2 → behive-0.4.0}/src/behive/mcp_server.py +0 -0
- {behive-0.3.2 → behive-0.4.0}/src/behive/models.py +0 -0
- {behive-0.3.2 → behive-0.4.0}/src/behive.egg-info/dependency_links.txt +0 -0
- {behive-0.3.2 → behive-0.4.0}/src/behive.egg-info/entry_points.txt +0 -0
- {behive-0.3.2 → behive-0.4.0}/src/behive.egg-info/requires.txt +2 -2
- {behive-0.3.2 → behive-0.4.0}/src/behive.egg-info/top_level.txt +0 -0
- {behive-0.3.2 → behive-0.4.0}/tests/test_e2e_pipeline.py +0 -0
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: behive
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.4.0
|
|
4
4
|
Summary: Research engine that builds structured knowledge graphs from any topic
|
|
5
5
|
Author-email: QA10 <hello@qa10.io>
|
|
6
6
|
License-Expression: MIT
|
|
7
7
|
Project-URL: Homepage, https://github.com/qa10devteam/behive
|
|
8
|
-
Project-URL: Documentation, https://behive
|
|
8
|
+
Project-URL: Documentation, https://github.com/qa10devteam/behive/tree/main/docs
|
|
9
9
|
Project-URL: Repository, https://github.com/qa10devteam/behive
|
|
10
10
|
Keywords: research,knowledge-graph,ai,mcp,deep-research
|
|
11
11
|
Classifier: Development Status :: 4 - Beta
|
|
@@ -24,6 +24,8 @@ Requires-Dist: psycopg2-binary>=2.9
|
|
|
24
24
|
Requires-Dist: pydantic>=2.0
|
|
25
25
|
Requires-Dist: litellm>=1.40
|
|
26
26
|
Requires-Dist: feedparser>=6.0
|
|
27
|
+
Requires-Dist: fastapi>=0.100
|
|
28
|
+
Requires-Dist: uvicorn>=0.20
|
|
27
29
|
Provides-Extra: stealth
|
|
28
30
|
Requires-Dist: curl-cffi>=0.7; extra == "stealth"
|
|
29
31
|
Requires-Dist: primp>=0.13; extra == "stealth"
|
|
@@ -48,8 +50,6 @@ Requires-Dist: scikit-learn>=1.3; extra == "science"
|
|
|
48
50
|
Provides-Extra: mcp
|
|
49
51
|
Requires-Dist: fastmcp>=3.0; extra == "mcp"
|
|
50
52
|
Provides-Extra: api
|
|
51
|
-
Requires-Dist: fastapi>=0.100; extra == "api"
|
|
52
|
-
Requires-Dist: uvicorn>=0.20; extra == "api"
|
|
53
53
|
Provides-Extra: qdrant
|
|
54
54
|
Requires-Dist: qdrant-client>=1.7; extra == "qdrant"
|
|
55
55
|
Requires-Dist: sentence-transformers>=2.2; extra == "qdrant"
|
|
@@ -254,7 +254,7 @@ behive serve
|
|
|
254
254
|
**Step 3:** Restart Claude Desktop. Done. Now ask:
|
|
255
255
|
> "Research the EU AI Act enforcement timeline and penalties"
|
|
256
256
|
|
|
257
|
-
Claude will call BeHive automatically,
|
|
257
|
+
Claude will call BeHive automatically, search across multiple sources, and return scored claims instead of guessing from training data.
|
|
258
258
|
|
|
259
259
|
<details>
|
|
260
260
|
<summary><strong>What happens under the hood</strong></summary>
|
|
@@ -264,7 +264,7 @@ You ask Claude a question
|
|
|
264
264
|
↓
|
|
265
265
|
Claude calls BeHive MCP tool "research_topic"
|
|
266
266
|
↓
|
|
267
|
-
BeHive scouts
|
|
267
|
+
BeHive scouts 64 APIs (38 free, 26 BYOK), fetches 1000+ URLs via stealth drones
|
|
268
268
|
↓
|
|
269
269
|
Your LLM key extracts claims (Claude Haiku = ~$0.50 per mission)
|
|
270
270
|
↓
|
|
@@ -467,7 +467,7 @@ Layer 8 │ Archives — Wayback Machine + archive.org fallback
|
|
|
467
467
|
- `rss_feed` → RSS bee (structured, fast)
|
|
468
468
|
- `database_portal` → Dedicated connector (custom scraping logic)
|
|
469
469
|
|
|
470
|
-
###
|
|
470
|
+
### 64 API Sources (38 Free + 26 BYOK)
|
|
471
471
|
|
|
472
472
|
Scout bees don't just Google. They query **specialized APIs** across 37 categories:
|
|
473
473
|
|
|
@@ -554,7 +554,7 @@ Real results. No cherry-picking. Scale 30 (standard depth).
|
|
|
554
554
|
1. **Dual-model extraction** — Fast model (Haiku) for bulk extraction, powerful model (Sonnet) for enriching thin claims. Not just "summarize this page."
|
|
555
555
|
2. **Quality scoring** — Every claim gets a 0.0-1.0 score. Below threshold = rejected. No filler.
|
|
556
556
|
3. **Knowledge graph** — Entities and relationships persist across missions. Research compounds.
|
|
557
|
-
4. **
|
|
557
|
+
4. **64 API sources** — Not just web search. SEC filings, arXiv, patent databases, government APIs.
|
|
558
558
|
5. **Deduplication** — Jaccard 0.60 threshold prevents the same fact from different sources inflating counts.
|
|
559
559
|
|
|
560
560
|
---
|
|
@@ -717,7 +717,7 @@ behive serve # Starts both REST API (:8091) + MCP (:8090)
|
|
|
717
717
|
|
|
718
718
|
1. **You give it a topic.** "NVIDIA GPU market 2026"
|
|
719
719
|
|
|
720
|
-
2. **Scout bees plan the research.** The Queen decomposes it into 5 axes (market share, financials, products, competition, supply chain). Generates 12-14 search queries per axis. Checks
|
|
720
|
+
2. **Scout bees plan the research.** The Queen decomposes it into 5 axes (market share, financials, products, competition, supply chain). Generates 12-14 search queries per axis. Checks 64 APIs.
|
|
721
721
|
|
|
722
722
|
3. **Harvest bees collect sources.** Parallel HTTP fetches ~1000 URLs. HEAD sweep first (fast), then full content extraction on promising ones. Typically lands 60-90 usable documents.
|
|
723
723
|
|
|
@@ -773,7 +773,7 @@ No env vars set? DDG is the default. Add any key above to instantly upgrade sear
|
|
|
773
773
|
| Knowledge graph | ✅ Neo4j | ❌ | ❌ | ❌ | ❌ |
|
|
774
774
|
| Cross-session memory | ✅ Cumulative | ❌ | ❌ | ❌ | ❌ |
|
|
775
775
|
| MCP native | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
776
|
-
| API sources (
|
|
776
|
+
| API sources (64) | ✅ | ❌ Web only | ⚠️ Search | ⚠️ Search | ❌ Web only |
|
|
777
777
|
| Self-hosted | ✅ Full | ⚠️ Needs API keys | ❌ Cloud | ❌ Cloud | ✅ |
|
|
778
778
|
| Quality deduplication | ✅ Jaccard 0.60 | ❌ | ❌ | ❌ | ❌ |
|
|
779
779
|
| SSE streaming | ✅ Real-time | ❌ | ❌ | ❌ | ❌ |
|
|
@@ -191,7 +191,7 @@ behive serve
|
|
|
191
191
|
**Step 3:** Restart Claude Desktop. Done. Now ask:
|
|
192
192
|
> "Research the EU AI Act enforcement timeline and penalties"
|
|
193
193
|
|
|
194
|
-
Claude will call BeHive automatically,
|
|
194
|
+
Claude will call BeHive automatically, search across multiple sources, and return scored claims instead of guessing from training data.
|
|
195
195
|
|
|
196
196
|
<details>
|
|
197
197
|
<summary><strong>What happens under the hood</strong></summary>
|
|
@@ -201,7 +201,7 @@ You ask Claude a question
|
|
|
201
201
|
↓
|
|
202
202
|
Claude calls BeHive MCP tool "research_topic"
|
|
203
203
|
↓
|
|
204
|
-
BeHive scouts
|
|
204
|
+
BeHive scouts 64 APIs (38 free, 26 BYOK), fetches 1000+ URLs via stealth drones
|
|
205
205
|
↓
|
|
206
206
|
Your LLM key extracts claims (Claude Haiku = ~$0.50 per mission)
|
|
207
207
|
↓
|
|
@@ -404,7 +404,7 @@ Layer 8 │ Archives — Wayback Machine + archive.org fallback
|
|
|
404
404
|
- `rss_feed` → RSS bee (structured, fast)
|
|
405
405
|
- `database_portal` → Dedicated connector (custom scraping logic)
|
|
406
406
|
|
|
407
|
-
###
|
|
407
|
+
### 64 API Sources (38 Free + 26 BYOK)
|
|
408
408
|
|
|
409
409
|
Scout bees don't just Google. They query **specialized APIs** across 37 categories:
|
|
410
410
|
|
|
@@ -491,7 +491,7 @@ Real results. No cherry-picking. Scale 30 (standard depth).
|
|
|
491
491
|
1. **Dual-model extraction** — Fast model (Haiku) for bulk extraction, powerful model (Sonnet) for enriching thin claims. Not just "summarize this page."
|
|
492
492
|
2. **Quality scoring** — Every claim gets a 0.0-1.0 score. Below threshold = rejected. No filler.
|
|
493
493
|
3. **Knowledge graph** — Entities and relationships persist across missions. Research compounds.
|
|
494
|
-
4. **
|
|
494
|
+
4. **64 API sources** — Not just web search. SEC filings, arXiv, patent databases, government APIs.
|
|
495
495
|
5. **Deduplication** — Jaccard 0.60 threshold prevents the same fact from different sources inflating counts.
|
|
496
496
|
|
|
497
497
|
---
|
|
@@ -654,7 +654,7 @@ behive serve # Starts both REST API (:8091) + MCP (:8090)
|
|
|
654
654
|
|
|
655
655
|
1. **You give it a topic.** "NVIDIA GPU market 2026"
|
|
656
656
|
|
|
657
|
-
2. **Scout bees plan the research.** The Queen decomposes it into 5 axes (market share, financials, products, competition, supply chain). Generates 12-14 search queries per axis. Checks
|
|
657
|
+
2. **Scout bees plan the research.** The Queen decomposes it into 5 axes (market share, financials, products, competition, supply chain). Generates 12-14 search queries per axis. Checks 64 APIs.
|
|
658
658
|
|
|
659
659
|
3. **Harvest bees collect sources.** Parallel HTTP fetches ~1000 URLs. HEAD sweep first (fast), then full content extraction on promising ones. Typically lands 60-90 usable documents.
|
|
660
660
|
|
|
@@ -710,7 +710,7 @@ No env vars set? DDG is the default. Add any key above to instantly upgrade sear
|
|
|
710
710
|
| Knowledge graph | ✅ Neo4j | ❌ | ❌ | ❌ | ❌ |
|
|
711
711
|
| Cross-session memory | ✅ Cumulative | ❌ | ❌ | ❌ | ❌ |
|
|
712
712
|
| MCP native | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
713
|
-
| API sources (
|
|
713
|
+
| API sources (64) | ✅ | ❌ Web only | ⚠️ Search | ⚠️ Search | ❌ Web only |
|
|
714
714
|
| Self-hosted | ✅ Full | ⚠️ Needs API keys | ❌ Cloud | ❌ Cloud | ✅ |
|
|
715
715
|
| Quality deduplication | ✅ Jaccard 0.60 | ❌ | ❌ | ❌ | ❌ |
|
|
716
716
|
| SSE streaming | ✅ Real-time | ❌ | ❌ | ❌ | ❌ |
|
|
@@ -10,7 +10,7 @@ behive = ["init-db.sql", "engine/hive_api_sources.json"]
|
|
|
10
10
|
|
|
11
11
|
[project]
|
|
12
12
|
name = "behive"
|
|
13
|
-
version = "0.
|
|
13
|
+
version = "0.4.0"
|
|
14
14
|
description = "Research engine that builds structured knowledge graphs from any topic"
|
|
15
15
|
readme = "README.md"
|
|
16
16
|
license = "MIT"
|
|
@@ -36,6 +36,8 @@ dependencies = [
|
|
|
36
36
|
"pydantic>=2.0",
|
|
37
37
|
"litellm>=1.40",
|
|
38
38
|
"feedparser>=6.0",
|
|
39
|
+
"fastapi>=0.100",
|
|
40
|
+
"uvicorn>=0.20",
|
|
39
41
|
]
|
|
40
42
|
|
|
41
43
|
[project.optional-dependencies]
|
|
@@ -65,7 +67,7 @@ science = [
|
|
|
65
67
|
"scikit-learn>=1.3",
|
|
66
68
|
]
|
|
67
69
|
mcp = ["fastmcp>=3.0"]
|
|
68
|
-
api = [
|
|
70
|
+
api = [] # fastapi+uvicorn moved to core deps
|
|
69
71
|
qdrant = ["qdrant-client>=1.7", "sentence-transformers>=2.2"]
|
|
70
72
|
all = ["behive[stealth,harvest,process,science,mcp,api]"]
|
|
71
73
|
dev = ["pytest>=7.0", "pytest-asyncio>=0.21", "ruff>=0.3"]
|
|
@@ -75,7 +77,7 @@ behive = "behive.cli:main"
|
|
|
75
77
|
|
|
76
78
|
[project.urls]
|
|
77
79
|
Homepage = "https://github.com/qa10devteam/behive"
|
|
78
|
-
Documentation = "https://behive
|
|
80
|
+
Documentation = "https://github.com/qa10devteam/behive/tree/main/docs"
|
|
79
81
|
Repository = "https://github.com/qa10devteam/behive"
|
|
80
82
|
|
|
81
83
|
[tool.pytest.ini_options]
|
|
@@ -10,7 +10,11 @@ Usage:
|
|
|
10
10
|
print(result.report) # Synthesized markdown report
|
|
11
11
|
"""
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
try:
|
|
14
|
+
from importlib.metadata import version as _get_version
|
|
15
|
+
__version__ = _get_version("behive")
|
|
16
|
+
except Exception:
|
|
17
|
+
__version__ = "0.4.0"
|
|
14
18
|
|
|
15
19
|
from behive.client import research, BeHiveClient
|
|
16
20
|
from behive.models import ResearchResult, Claim, Entity
|
|
@@ -55,6 +55,9 @@ def main():
|
|
|
55
55
|
config_p.add_argument("--stage", choices=["scout", "harvest", "process", "synth"], help="Set model for single stage")
|
|
56
56
|
config_p.add_argument("--model", help="Model name or litellm string (use with --stage)")
|
|
57
57
|
|
|
58
|
+
# ─── doctor ──────────────────────────────────────────────────────────
|
|
59
|
+
sub.add_parser("doctor", help="Check system health (DB, LLM, browser, dependencies)")
|
|
60
|
+
|
|
58
61
|
# ─── version ──────────────────────────────────────────────────────────
|
|
59
62
|
sub.add_parser("version", help="Show version")
|
|
60
63
|
|
|
@@ -81,6 +84,8 @@ def main():
|
|
|
81
84
|
cmd_db(args)
|
|
82
85
|
elif args.command == "missions":
|
|
83
86
|
cmd_missions(args)
|
|
87
|
+
elif args.command == "doctor":
|
|
88
|
+
cmd_doctor()
|
|
84
89
|
elif args.command == "version":
|
|
85
90
|
from behive import __version__
|
|
86
91
|
print(f"behive {__version__}")
|
|
@@ -148,13 +153,15 @@ def cmd_config(args):
|
|
|
148
153
|
def cmd_serve(args):
|
|
149
154
|
"""Start BeHive API server + MCP endpoint."""
|
|
150
155
|
import multiprocessing
|
|
156
|
+
from behive import __version__
|
|
151
157
|
|
|
152
158
|
# Check required env vars
|
|
153
159
|
_check_env()
|
|
154
160
|
|
|
161
|
+
ver = __version__
|
|
155
162
|
print(f"""
|
|
156
163
|
\033[33m ╔══════════════════════════════════════╗
|
|
157
|
-
║ 🐝 BeHive Research Engine
|
|
164
|
+
║ 🐝 BeHive Research Engine v{ver:<6}║
|
|
158
165
|
╚══════════════════════════════════════╝\033[0m
|
|
159
166
|
|
|
160
167
|
API: http://{args.host}:{args.port}
|
|
@@ -201,25 +208,58 @@ def _run_mcp_server(host: str, port: int):
|
|
|
201
208
|
|
|
202
209
|
|
|
203
210
|
def _check_env():
|
|
204
|
-
"""Check that necessary environment variables are set."""
|
|
205
|
-
|
|
211
|
+
"""Check that necessary environment variables are set. Exit with helpful message if critical deps missing."""
|
|
212
|
+
issues = []
|
|
213
|
+
|
|
214
|
+
# Check LLM key
|
|
206
215
|
has_key = any(os.environ.get(k) for k in [
|
|
207
216
|
"ANTHROPIC_API_KEY",
|
|
208
217
|
"OPENAI_API_KEY",
|
|
218
|
+
"GROQ_API_KEY",
|
|
219
|
+
"MISTRAL_API_KEY",
|
|
209
220
|
"AWS_ACCESS_KEY_ID", # Bedrock
|
|
221
|
+
"BEHIVE_MODEL", # litellm model string (implies key is set)
|
|
210
222
|
])
|
|
211
223
|
if not has_key:
|
|
212
|
-
|
|
213
|
-
print(" Set one of: ANTHROPIC_API_KEY, OPENAI_API_KEY, or AWS credentials")
|
|
214
|
-
print(" Example: export ANTHROPIC_API_KEY=sk-...")
|
|
215
|
-
print()
|
|
216
|
-
print()
|
|
224
|
+
issues.append(("LLM", "No LLM API key found. Set one of: ANTHROPIC_API_KEY, OPENAI_API_KEY, GROQ_API_KEY, or AWS credentials."))
|
|
217
225
|
|
|
218
|
-
# Check DB
|
|
226
|
+
# Check DB connectivity
|
|
219
227
|
db_url = os.environ.get("DATABASE_URL") or os.environ.get("BEHIVE_DB_URL")
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
228
|
+
has_pg_vars = os.environ.get("HIVE_PG_USER") or os.environ.get("HIVE_PG_PASSWORD")
|
|
229
|
+
if not db_url and not has_pg_vars:
|
|
230
|
+
issues.append(("DB", "No database configured. Set BEHIVE_DB_URL or HIVE_PG_* environment variables."))
|
|
231
|
+
else:
|
|
232
|
+
# Test connection
|
|
233
|
+
try:
|
|
234
|
+
import psycopg2
|
|
235
|
+
from behive.server import get_db_url
|
|
236
|
+
conn = psycopg2.connect(get_db_url())
|
|
237
|
+
conn.close()
|
|
238
|
+
except Exception as e:
|
|
239
|
+
issues.append(("DB", f"Cannot connect to database: {e}"))
|
|
240
|
+
|
|
241
|
+
if issues:
|
|
242
|
+
print("\033[33m")
|
|
243
|
+
print(" ╔══════════════════════════════════════╗")
|
|
244
|
+
print(" ║ 🐝 BeHive — Setup Required ║")
|
|
245
|
+
print(" ╚══════════════════════════════════════╝\033[0m")
|
|
246
|
+
print()
|
|
247
|
+
for category, msg in issues:
|
|
248
|
+
print(f" \033[31m✗ [{category}]\033[0m {msg}")
|
|
249
|
+
print()
|
|
250
|
+
print(" Quick setup:")
|
|
251
|
+
print(" 1. Start PostgreSQL and create a database:")
|
|
252
|
+
print(" createdb behive")
|
|
253
|
+
print(" 2. Set environment variables:")
|
|
254
|
+
print(" export BEHIVE_DB_URL=postgresql://user:pass@localhost:5432/behive")
|
|
255
|
+
print(" export OPENAI_API_KEY=sk-...")
|
|
256
|
+
print(" 3. Initialize the schema:")
|
|
257
|
+
print(" behive db init")
|
|
258
|
+
print(" 4. Start the server:")
|
|
259
|
+
print(" behive serve")
|
|
260
|
+
print()
|
|
261
|
+
if any(cat == "DB" for cat, _ in issues):
|
|
262
|
+
sys.exit(1)
|
|
223
263
|
print()
|
|
224
264
|
|
|
225
265
|
|
|
@@ -286,6 +326,110 @@ def _print_result(result):
|
|
|
286
326
|
print(" ...")
|
|
287
327
|
|
|
288
328
|
|
|
329
|
+
# ═══════════════════════════════════════════════════════════════════════════════
|
|
330
|
+
# DOCTOR — system health check
|
|
331
|
+
# ═══════════════════════════════════════════════════════════════════════════════
|
|
332
|
+
|
|
333
|
+
def cmd_doctor():
|
|
334
|
+
"""Check all BeHive dependencies and report status."""
|
|
335
|
+
from behive import __version__
|
|
336
|
+
print(f"\n 🐝 BeHive Doctor v{__version__}\n")
|
|
337
|
+
checks = []
|
|
338
|
+
|
|
339
|
+
# 1. Python version
|
|
340
|
+
import platform
|
|
341
|
+
py_ver = platform.python_version()
|
|
342
|
+
ok = tuple(int(x) for x in py_ver.split(".")[:2]) >= (3, 10)
|
|
343
|
+
checks.append(("Python", f"{py_ver}", ok))
|
|
344
|
+
|
|
345
|
+
# 2. PostgreSQL connection
|
|
346
|
+
try:
|
|
347
|
+
import psycopg2
|
|
348
|
+
from behive.server import get_db_url
|
|
349
|
+
db_url = get_db_url()
|
|
350
|
+
conn = psycopg2.connect(db_url)
|
|
351
|
+
cur = conn.cursor()
|
|
352
|
+
cur.execute("SELECT COUNT(*) FROM information_schema.tables WHERE table_schema='public'")
|
|
353
|
+
tables = cur.fetchone()[0]
|
|
354
|
+
cur.execute("SELECT COUNT(*) FROM hive_missions")
|
|
355
|
+
missions = cur.fetchone()[0]
|
|
356
|
+
conn.close()
|
|
357
|
+
checks.append(("Database", f"connected ({tables} tables, {missions} missions)", True))
|
|
358
|
+
except Exception as e:
|
|
359
|
+
checks.append(("Database", str(e)[:80], False))
|
|
360
|
+
|
|
361
|
+
# 3. LLM connectivity
|
|
362
|
+
llm_keys = {
|
|
363
|
+
"OPENAI_API_KEY": "OpenAI",
|
|
364
|
+
"ANTHROPIC_API_KEY": "Anthropic",
|
|
365
|
+
"GROQ_API_KEY": "Groq",
|
|
366
|
+
"MISTRAL_API_KEY": "Mistral",
|
|
367
|
+
"AWS_ACCESS_KEY_ID": "Bedrock",
|
|
368
|
+
}
|
|
369
|
+
found_keys = [name for env, name in llm_keys.items() if os.environ.get(env)]
|
|
370
|
+
behive_model = os.environ.get("BEHIVE_MODEL", "")
|
|
371
|
+
if found_keys or behive_model:
|
|
372
|
+
detail = ", ".join(found_keys) if found_keys else f"BEHIVE_MODEL={behive_model}"
|
|
373
|
+
checks.append(("LLM", f"configured ({detail})", True))
|
|
374
|
+
else:
|
|
375
|
+
checks.append(("LLM", "no API key found", False))
|
|
376
|
+
|
|
377
|
+
# 4. Playwright/Chromium (for web search)
|
|
378
|
+
try:
|
|
379
|
+
import subprocess
|
|
380
|
+
result = subprocess.run(
|
|
381
|
+
["python3", "-c", "from playwright.sync_api import sync_playwright; print('ok')"],
|
|
382
|
+
capture_output=True, text=True, timeout=10
|
|
383
|
+
)
|
|
384
|
+
if result.returncode == 0:
|
|
385
|
+
checks.append(("Browser", "Playwright + Chromium available", True))
|
|
386
|
+
else:
|
|
387
|
+
checks.append(("Browser", "Playwright installed but Chromium missing (run: playwright install chromium)", False))
|
|
388
|
+
except FileNotFoundError:
|
|
389
|
+
checks.append(("Browser", "not installed (pip install playwright && playwright install chromium)", False))
|
|
390
|
+
except Exception as e:
|
|
391
|
+
checks.append(("Browser", f"check failed: {e}", False))
|
|
392
|
+
|
|
393
|
+
# 5. Optional: Neo4j
|
|
394
|
+
neo4j_uri = os.environ.get("BEHIVE_NEO4J_URI")
|
|
395
|
+
if neo4j_uri:
|
|
396
|
+
try:
|
|
397
|
+
from neo4j import GraphDatabase
|
|
398
|
+
driver = GraphDatabase.driver(neo4j_uri, auth=("neo4j", os.environ.get("BEHIVE_NEO4J_PASSWORD", "")))
|
|
399
|
+
driver.verify_connectivity()
|
|
400
|
+
driver.close()
|
|
401
|
+
checks.append(("Neo4j", f"connected ({neo4j_uri})", True))
|
|
402
|
+
except Exception as e:
|
|
403
|
+
checks.append(("Neo4j", f"configured but unreachable: {e}", False))
|
|
404
|
+
else:
|
|
405
|
+
checks.append(("Neo4j", "not configured (optional — for knowledge graphs)", None))
|
|
406
|
+
|
|
407
|
+
# 6. Optional: Qdrant
|
|
408
|
+
qdrant_url = os.environ.get("BEHIVE_QDRANT_URL")
|
|
409
|
+
if qdrant_url:
|
|
410
|
+
checks.append(("Qdrant", f"configured ({qdrant_url})", True))
|
|
411
|
+
else:
|
|
412
|
+
checks.append(("Qdrant", "not configured (optional — for vector search)", None))
|
|
413
|
+
|
|
414
|
+
# Print results
|
|
415
|
+
for name, detail, ok in checks:
|
|
416
|
+
if ok is True:
|
|
417
|
+
icon = "\033[32m✓\033[0m"
|
|
418
|
+
elif ok is False:
|
|
419
|
+
icon = "\033[31m✗\033[0m"
|
|
420
|
+
else:
|
|
421
|
+
icon = "\033[2m○\033[0m"
|
|
422
|
+
print(f" {icon} {name:<12} {detail}")
|
|
423
|
+
|
|
424
|
+
# Summary
|
|
425
|
+
critical = [(n, d) for n, d, ok in checks if ok is False]
|
|
426
|
+
if critical:
|
|
427
|
+
print(f"\n \033[31m{len(critical)} issue(s) found.\033[0m Fix them and run `behive doctor` again.\n")
|
|
428
|
+
sys.exit(1)
|
|
429
|
+
else:
|
|
430
|
+
print(f"\n \033[32mAll checks passed.\033[0m BeHive is ready.\n")
|
|
431
|
+
|
|
432
|
+
|
|
289
433
|
# ═══════════════════════════════════════════════════════════════════════════════
|
|
290
434
|
# STATUS
|
|
291
435
|
# ═══════════════════════════════════════════════════════════════════════════════
|
|
@@ -30,10 +30,7 @@ class BeHiveClient:
|
|
|
30
30
|
):
|
|
31
31
|
self.api_url = api_url or os.environ.get("BEHIVE_API_URL")
|
|
32
32
|
self.api_key = api_key or os.environ.get("BEHIVE_API_KEY")
|
|
33
|
-
self.db_url = db_url or os.environ.get(
|
|
34
|
-
"BEHIVE_DB_URL",
|
|
35
|
-
"postgresql://behive_user:REDACTED@localhost:5432/hive"
|
|
36
|
-
)
|
|
33
|
+
self.db_url = db_url or os.environ.get("BEHIVE_DB_URL")
|
|
37
34
|
self._backend = self._detect_backend()
|
|
38
35
|
|
|
39
36
|
def _detect_backend(self) -> str:
|
|
@@ -5,6 +5,6 @@ The engine modules were originally named hive2_*.py (flat files).
|
|
|
5
5
|
This package provides shims so existing import statements work
|
|
6
6
|
without modification.
|
|
7
7
|
|
|
8
|
-
Example: 'from
|
|
8
|
+
Example: 'from behive.engine.drones import get_strategy' resolves to
|
|
9
9
|
'from behive.engine.drones import get_strategy'
|
|
10
10
|
"""
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Legacy import shims: hive2_* → behive.engine.*
|
|
2
2
|
|
|
3
3
|
This module installs shims into sys.modules so that legacy imports like:
|
|
4
|
-
from
|
|
4
|
+
from behive.engine.drones import get_strategy
|
|
5
5
|
import hive2_db
|
|
6
6
|
|
|
7
7
|
resolve to the actual behive.engine.* modules.
|
|
@@ -34,6 +34,14 @@ SHIM_MAP = {
|
|
|
34
34
|
"hive2_queen_fact_mem": "behive.engine.queen_fact_mem",
|
|
35
35
|
"hive2_guardrail": "behive.engine.guardrail",
|
|
36
36
|
"hive_api_scout": "behive.engine.api_scout",
|
|
37
|
+
"hive2_falsifier": "behive.engine.falsifier",
|
|
38
|
+
"hive2_master_intelligence": "behive.engine.master_intelligence",
|
|
39
|
+
"hive2_intel_summary": "behive.engine.intel_summary",
|
|
40
|
+
"hive2_graph_engine": "behive.engine.graph_engine",
|
|
41
|
+
"hive2_content_quality": "behive.engine.content_quality",
|
|
42
|
+
"hive2_queen_tools": "behive.engine.queen_tools",
|
|
43
|
+
"hive2_queen_feedback": "behive.engine.queen_feedback",
|
|
44
|
+
"hive2_rag": "behive.engine.rag",
|
|
37
45
|
}
|
|
38
46
|
|
|
39
47
|
|
|
@@ -36,19 +36,23 @@ Usage:
|
|
|
36
36
|
"""
|
|
37
37
|
import logging
|
|
38
38
|
|
|
39
|
-
|
|
40
39
|
log = logging.getLogger(__name__)
|
|
40
|
+
|
|
41
|
+
# Auto-install compat shims so hive2_* imports resolve to behive.engine.*
|
|
42
|
+
try:
|
|
43
|
+
from behive.compat.shims import install_shims, install_ops_shim
|
|
44
|
+
install_ops_shim()
|
|
45
|
+
install_shims()
|
|
46
|
+
except ImportError:
|
|
47
|
+
pass
|
|
41
48
|
__all__ = [
|
|
42
49
|
"orchestrator",
|
|
43
|
-
"queen",
|
|
44
|
-
"runner",
|
|
45
50
|
"scout",
|
|
46
51
|
"harvest",
|
|
47
52
|
"process",
|
|
48
53
|
"synth",
|
|
49
54
|
"drones",
|
|
50
55
|
"api_scout",
|
|
51
|
-
"quality",
|
|
52
56
|
"db",
|
|
53
57
|
"events",
|
|
54
58
|
]
|
|
@@ -30,7 +30,7 @@ Scheme:
|
|
|
30
30
|
└──────────────────────────────────────────────────────────┘
|
|
31
31
|
|
|
32
32
|
Public API:
|
|
33
|
-
from
|
|
33
|
+
from behive.engine.bionic_quorum import QuorumChecker
|
|
34
34
|
qc = QuorumChecker(mission_id)
|
|
35
35
|
result = qc.check() # QuorumResult
|
|
36
36
|
if result.needs_expansion:
|
|
@@ -86,10 +86,10 @@ class QuorumResult:
|
|
|
86
86
|
)
|
|
87
87
|
|
|
88
88
|
|
|
89
|
-
def
|
|
90
|
-
"""Connect via
|
|
91
|
-
|
|
92
|
-
return
|
|
89
|
+
def _pg_connect(read_only: bool = False):
|
|
90
|
+
"""Connect to PostgreSQL (via connection pool)."""
|
|
91
|
+
from behive.engine.db import connect
|
|
92
|
+
return connect(read_only=read_only)
|
|
93
93
|
|
|
94
94
|
|
|
95
95
|
def _extract_keywords(topic: str) -> List[str]:
|
|
@@ -113,7 +113,7 @@ class QuorumChecker:
|
|
|
113
113
|
|
|
114
114
|
def _load_topic(self) -> str:
|
|
115
115
|
try:
|
|
116
|
-
con =
|
|
116
|
+
con = _pg_connect(read_only=True)
|
|
117
117
|
row = con.execute(
|
|
118
118
|
"SELECT topic FROM hive_missions WHERE id=?", [self.mission_id]
|
|
119
119
|
).fetchone()
|
|
@@ -126,7 +126,7 @@ class QuorumChecker:
|
|
|
126
126
|
def _load_expansion_count(self) -> int:
|
|
127
127
|
"""Jak wiele range expansions już zrobiliśmy dla tej misji."""
|
|
128
128
|
try:
|
|
129
|
-
con =
|
|
129
|
+
con = _pg_connect(read_only=True)
|
|
130
130
|
row = con.execute("""
|
|
131
131
|
SELECT COUNT(*) FROM hive_quorum_expansions
|
|
132
132
|
WHERE mission_id = ?
|
|
@@ -140,7 +140,7 @@ class QuorumChecker:
|
|
|
140
140
|
def check(self) -> QuorumResult:
|
|
141
141
|
"""Main check — returns QuorumResult with decision and optional expansion queries."""
|
|
142
142
|
try:
|
|
143
|
-
con =
|
|
143
|
+
con = _pg_connect(read_only=True)
|
|
144
144
|
total = con.execute(
|
|
145
145
|
"SELECT COUNT(*) FROM hive_sources WHERE mission_id=?",
|
|
146
146
|
[self.mission_id]
|
|
@@ -268,7 +268,7 @@ Return ONLY a JSON array of {EXPANSION_QUERIES} strings:
|
|
|
268
268
|
def _record_expansion(self, harvestable: int):
|
|
269
269
|
"""Zapisuje fakt ekspansji do DB (żeby nie loopować w nieskończoność)."""
|
|
270
270
|
try:
|
|
271
|
-
con =
|
|
271
|
+
con = _pg_connect()
|
|
272
272
|
con.execute("""
|
|
273
273
|
CREATE TABLE IF NOT EXISTS hive_quorum_expansions (
|
|
274
274
|
id VARCHAR DEFAULT gen_random_uuid()::VARCHAR PRIMARY KEY,
|
behive-0.3.2/src/behive/engine/quality.py → behive-0.4.0/src/behive/engine/content_quality.py
RENAMED
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
import logging
|
|
5
|
-
|
|
6
|
-
log = logging.getLogger(__name__)
|
|
1
|
+
#!/usr/bin/env python3
|
|
7
2
|
"""
|
|
8
3
|
HIVE 2.0 — hive2_content_quality.py
|
|
9
4
|
═════════════════════════════════════
|
|
@@ -15,7 +10,7 @@ Biologia:
|
|
|
15
10
|
Wirus jest niewidoczny bez aktywnego testu.
|
|
16
11
|
|
|
17
12
|
W HIVE:
|
|
18
|
-
|
|
13
|
+
Źródła które odpowiadają na HEAD (200 OK, content-length OK)
|
|
19
14
|
ale zwracają scraper-noise, nav-boilerplate, lub AI-generated fluff
|
|
20
15
|
są "covertly infected" — obniżają jakość całej syntezy.
|
|
21
16
|
|
|
@@ -28,12 +23,13 @@ Scoring: 4 ortogonalne sygnały (każdy 0.0–1.0, ważone)
|
|
|
28
23
|
Threshold: quality_score < 0.32 → "covertly infected" → penalizuj w scoring
|
|
29
24
|
|
|
30
25
|
Public API:
|
|
31
|
-
from
|
|
26
|
+
from behive.engine.content_quality import score_content, is_covert_infected
|
|
32
27
|
q = score_content(raw_text) # 0.0–1.0
|
|
33
28
|
bad = is_covert_infected(raw_text) # True/False
|
|
34
29
|
details = score_content_detailed(raw_text) # dict with all signals
|
|
35
30
|
"""
|
|
36
31
|
|
|
32
|
+
from __future__ import annotations
|
|
37
33
|
|
|
38
34
|
import re
|
|
39
35
|
from typing import Dict
|
|
@@ -206,18 +202,19 @@ def quality_label(score: float) -> str:
|
|
|
206
202
|
# CLI + batch analysis
|
|
207
203
|
# ─────────────────────────────────────────────────────────────────────────────
|
|
208
204
|
if __name__ == "__main__":
|
|
205
|
+
from behive.engine.db import connect as _db_connect_cq
|
|
209
206
|
import sys
|
|
210
207
|
|
|
211
208
|
if "--audit-mission" in sys.argv:
|
|
212
|
-
#
|
|
209
|
+
# Analiza jakości treści w misji
|
|
213
210
|
idx = sys.argv.index("--audit-mission")
|
|
214
211
|
mission_id = sys.argv[idx + 1] if len(sys.argv) > idx + 1 else None
|
|
215
212
|
if not mission_id:
|
|
216
213
|
print("Usage: python3 hive2_content_quality.py --audit-mission <mission_id>")
|
|
217
214
|
sys.exit(1)
|
|
218
215
|
|
|
219
|
-
#
|
|
220
|
-
con =
|
|
216
|
+
# pg removed — using hive2_db
|
|
217
|
+
con = _db_connect_cq(read_only=True)
|
|
221
218
|
rows = con.execute("""
|
|
222
219
|
SELECT id, url, full_text, word_count
|
|
223
220
|
FROM hive_content
|