175 lines
5.9 KiB
YAML
175 lines
5.9 KiB
YAML
# ------------------------------------------------------------
|
||
# Parameters
|
||
# ------------------------------------------------------------
|
||
|
||
parameters:
|
||
# ------------------------------------------------------------
|
||
# Root
|
||
# ------------------------------------------------------------
|
||
|
||
mto.root: '%kernel.project_dir%'
|
||
mto.kernel.dir: '%mto.root%'
|
||
|
||
# ------------------------------------------------------------
|
||
# Knowledge Root (ZENTRAL)
|
||
# ------------------------------------------------------------
|
||
|
||
mto.knowledge.root: '%mto.root%/var/knowledge'
|
||
|
||
mto.knowledge.ndjson: '%mto.knowledge.root%/index.ndjson'
|
||
mto.knowledge.index_meta: '%mto.knowledge.root%/index_meta.json'
|
||
mto.knowledge.vector_index: '%mto.knowledge.root%/vector.index'
|
||
mto.knowledge.vector_index_meta: '%mto.knowledge.root%/vector.index.meta.json'
|
||
mto.runtime.meta: '%mto.knowledge.root%/index_runtime.json'
|
||
mto.knowledge.upload: '%mto.knowledge.root%/uploads'
|
||
|
||
# Backward compatibility alias
|
||
mto.vector.data.upload.path: '%mto.knowledge.upload%'
|
||
|
||
# ------------------------------------------------------------
|
||
# Index Configuration (Fallback Guardrails)
|
||
# ------------------------------------------------------------
|
||
|
||
mto.index.chunk_size: 800
|
||
mto.index.chunk_overlap: 100
|
||
mto.index.embedding_model: 'all-MiniLM-L6-v2'
|
||
mto.index.embedding_dimension: 768
|
||
mto.index.scoring_version: 1
|
||
|
||
# ------------------------------------------------------------
|
||
# Python / Vector Runtime
|
||
# ------------------------------------------------------------
|
||
|
||
mto.vector.python_bin: '/var/www/html/.venv/bin/python3'
|
||
mto.vector.ingest_script: '%mto.root%/src/Vector/vector_ingest.py'
|
||
mto.vector.search_script: '%mto.root%/src/Vector/vector_search.py'
|
||
mto.vector.timeout: 600
|
||
|
||
|
||
# ------------------------------------------------------------
|
||
# Services
|
||
# ------------------------------------------------------------
|
||
|
||
services:
|
||
|
||
_defaults:
|
||
autowire: true
|
||
autoconfigure: true
|
||
bind:
|
||
Psr\Log\LoggerInterface $agentLogger: '@monolog.logger.agent'
|
||
string $projectDir: '%mto.root%'
|
||
|
||
App\:
|
||
resource: '../src/'
|
||
exclude:
|
||
- '../src/DependencyInjection/'
|
||
- '../src/Entity/'
|
||
- '../src/Kernel.php'
|
||
|
||
App\Controller\:
|
||
resource: '../src/Controller/'
|
||
tags: [ 'controller.service_arguments' ]
|
||
|
||
# ------------------------------------------------------------
|
||
# AI Agent – Infrastructure
|
||
# ------------------------------------------------------------
|
||
|
||
App\Infrastructure\OllamaClient:
|
||
arguments:
|
||
$apiUrl: '%env(AI_LLM_API_URL)%'
|
||
$model: '%env(AI_LLM_MODEL)%'
|
||
$timeoutSeconds: 600
|
||
$configProvider: '@App\Service\ModelGenerationConfigProvider'
|
||
|
||
# ------------------------------------------------------------
|
||
# AI Agent – Context & Runner
|
||
# ------------------------------------------------------------
|
||
|
||
App\Context\ContextService:
|
||
arguments:
|
||
$historyDir: '%env(AI_HISTORY_DIR)%'
|
||
$projectDir: '%mto.root%'
|
||
|
||
App\Agent\AgentRunner:
|
||
arguments:
|
||
$debug: '%env(bool:AI_DEBUG)%'
|
||
$logPrompt: '%env(bool:AI_LOG_PROMPT)%'
|
||
$logContext: '%env(bool:AI_LOG_CONTEXT)%'
|
||
|
||
# ------------------------------------------------------------
|
||
# NDJSON Retrieval Stack
|
||
# ------------------------------------------------------------
|
||
|
||
App\Knowledge\Retrieval\NdjsonChunkLookup: ~
|
||
|
||
App\Knowledge\Retrieval\NdjsonKeywordSearch: ~
|
||
|
||
App\Knowledge\Retrieval\NdjsonHybridRetriever:
|
||
arguments:
|
||
$maxChunks: 3
|
||
$vectorTopK: 5
|
||
|
||
App\Knowledge\Retrieval\CachedRetriever:
|
||
arguments:
|
||
$inner: '@App\Knowledge\Retrieval\NdjsonHybridRetriever'
|
||
$cache: '@cache.app'
|
||
$ttlSeconds: 600
|
||
|
||
App\Knowledge\Retrieval\RetrieverInterface:
|
||
alias: App\Knowledge\Retrieval\CachedRetriever
|
||
|
||
# ------------------------------------------------------------
|
||
# Index Configuration Provider (DB + Fallback)
|
||
# ------------------------------------------------------------
|
||
|
||
App\Index\IndexConfigurationProvider:
|
||
arguments:
|
||
$repository: '@App\Repository\IngestProfileRepository'
|
||
$fallbackChunkSize: '%mto.index.chunk_size%'
|
||
$fallbackChunkOverlap: '%mto.index.chunk_overlap%'
|
||
$fallbackEmbeddingModel: '%mto.index.embedding_model%'
|
||
$fallbackEmbeddingDimension: '%mto.index.embedding_dimension%'
|
||
$fallbackScoringVersion: '%mto.index.scoring_version%'
|
||
|
||
# ------------------------------------------------------------
|
||
# Index Meta Manager (uses Provider)
|
||
# ------------------------------------------------------------
|
||
|
||
App\Index\IndexMetaManager:
|
||
arguments:
|
||
$metaPath: '%mto.knowledge.index_meta%'
|
||
$runTimePath: '%mto.runtime.meta%'
|
||
$provider: '@App\Index\IndexConfigurationProvider'
|
||
|
||
# ------------------------------------------------------------
|
||
# Vector Layer
|
||
# ------------------------------------------------------------
|
||
|
||
App\Vector\VectorSearchClient:
|
||
arguments:
|
||
$pythonBin: '%mto.vector.python_bin%'
|
||
$scriptPath: '%mto.vector.search_script%'
|
||
$vectorIndexPath: '%mto.knowledge.vector_index%'
|
||
$vectorMetaPath: '%mto.knowledge.vector_index_meta%'
|
||
$indexMetaPath: '%mto.knowledge.index_meta%'
|
||
$agentLogger: '@monolog.logger.agent'
|
||
|
||
App\Vector\VectorIndexBuilder:
|
||
arguments:
|
||
$pythonBin: '%mto.vector.python_bin%'
|
||
$scriptPath: '%mto.vector.ingest_script%'
|
||
$indexNdjsonPath: '%mto.knowledge.ndjson%'
|
||
$indexMetaPath: '%mto.knowledge.index_meta%'
|
||
$vectorIndexPath: '%mto.knowledge.vector_index%'
|
||
$timeoutSeconds: '%mto.vector.timeout%'
|
||
$configurationProvider: '@App\Index\IndexConfigurationProvider'
|
||
|
||
# ------------------------------------------------------------
|
||
# Admin Utilities
|
||
# ------------------------------------------------------------
|
||
|
||
App\Service\Admin\IndexNdjsonInspector:
|
||
arguments:
|
||
$ndJsonPath: '%mto.knowledge.ndjson%'
|
||
$indexMetaPath: '%mto.knowledge.index_meta%'
|