164 lines
5.3 KiB
YAML
164 lines
5.3 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.knowledge.upload: '%mto.knowledge.root%/uploads'
|
||
# Backward compatibility alias
|
||
mto.vector.data.upload.path: '%mto.knowledge.upload%'
|
||
|
||
# ------------------------------------------------------------
|
||
# Index Configuration (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: '%env(int:AI_LLM_TIMEOUT)%'
|
||
|
||
# ------------------------------------------------------------
|
||
# 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
|
||
|
||
# ------------------------------------------------------------
|
||
# Vector Search (noch unverändert – Umbau kommt in Schritt 2)
|
||
# ------------------------------------------------------------
|
||
App\Index\IndexMetaManager:
|
||
arguments:
|
||
$metaPath: '%mto.knowledge.index_meta%'
|
||
$config: '@App\Index\IndexConfiguration'
|
||
|
||
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%'
|
||
$indexConfiguration: '@App\Index\IndexConfiguration'
|
||
|
||
# ------------------------------------------------------------
|
||
# Index Configuration
|
||
# ------------------------------------------------------------
|
||
|
||
App\Index\IndexConfiguration:
|
||
arguments:
|
||
$chunkSize: '%mto.index.chunk_size%'
|
||
$chunkOverlap: '%mto.index.chunk_overlap%'
|
||
$embeddingModel: '%mto.index.embedding_model%'
|
||
$embeddingDimension: '%mto.index.embedding_dimension%'
|
||
$scoringVersion: '%mto.index.scoring_version%'
|
||
$indexFormat: 'ndjson'
|
||
$vectorBackend: 'faiss'
|
||
|
||
App\Service\Admin\IndexNdjsonInspector:
|
||
arguments:
|
||
$ndJsonPath: '%mto.knowledge.ndjson%'
|
||
$indexMetaPath: '%mto.knowledge.index_meta%'
|