Files
MtoRagSystem/config/services.yaml
2026-02-23 11:47:05 +01:00

219 lines
7.2 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ------------------------------------------------------------
# Parameters
# ------------------------------------------------------------
parameters:
mto.root: '%kernel.project_dir%'
mto.kernel.dir: '%mto.root%'
mto.locks.dir: '%mto.knowledge.root%/locks'
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'
mto.knowledge.tags_ndjson: '%mto.knowledge.root%/tags.ndjson'
mto.knowledge.vector_tags_index: '%mto.knowledge.root%/vector_tags.index'
mto.knowledge.vector_tags_index_meta: '%mto.knowledge.root%/vector_tags.index.meta.json'
mto.vector.script_dir: '%mto.root%/python/vector'
mto.vector.ingest_tags_script: '%mto.vector.script_dir%/vector_ingest_tags.py'
mto.vector.search_tags_script: '%mto.vector.script_dir%/vector_search_tags.py'
mto.tags.rebuild_lock: '%mto.locks.dir%/tag_rebuild.lock'
mto.vector.data.upload.path: '%mto.knowledge.upload%'
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
mto.vector.python_bin: '%kernel.project_dir%/.venv/bin/python3'
mto.vector.ingest_script: '%mto.vector.script_dir%/vector_ingest.py'
mto.vector.search_script: '%mto.vector.script_dir%/vector_search.py'
mto.vector.timeout: 600
mto.vector.service_url: 'http://127.0.0.1:8090'
# ------------------------------------------------------------
# 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)%'
$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\NdjsonHybridRetriever: ~
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
# ------------------------------------------------------------
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
# ------------------------------------------------------------
App\Index\IndexMetaManager:
arguments:
$metaPath: '%mto.knowledge.index_meta%'
$runTimePath: '%mto.runtime.meta%'
$provider: '@App\Index\IndexConfigurationProvider'
# ------------------------------------------------------------
# Vector Layer
# ------------------------------------------------------------
App\Vector\VectorSearchClient:
arguments:
$serviceUrl: '%mto.vector.service_url%'
$agentLogger: '@monolog.logger.agent'
App\Vector\VectorIndexBuilder:
arguments:
$pythonBin: '%mto.vector.python_bin%'
$scriptPath: '%mto.vector.ingest_script%'
$indexNdjsonPath: '%mto.knowledge.ndjson%'
$vectorIndexPath: '%mto.knowledge.vector_index%'
$timeoutSeconds: '%mto.vector.timeout%'
$configurationProvider: '@App\Index\IndexConfigurationProvider'
# ------------------------------------------------------------
# Ingest Layer (Phase B Refactor)
# ------------------------------------------------------------
App\Ingest\GuardrailValidator: ~
App\Ingest\ChunkWriteService: ~
App\Ingest\VectorRebuildService: ~
App\Ingest\IngestFlow: ~
# ------------------------------------------------------------
# Tags Export
# ------------------------------------------------------------
App\Tag\TagNdjsonExporter:
arguments:
$tagsNdjsonPath: '%mto.knowledge.tags_ndjson%'
# ------------------------------------------------------------
# Tags Vector
# ------------------------------------------------------------
App\Tag\TagVectorIndexBuilder:
arguments:
$pythonBin: '%mto.vector.python_bin%'
$scriptPath: '%mto.vector.ingest_tags_script%'
$tagsNdjsonPath: '%mto.knowledge.tags_ndjson%'
$vectorTagsIndexPath: '%mto.knowledge.vector_tags_index%'
$embeddingModel: '%mto.index.embedding_model%'
$timeoutSeconds: '%mto.vector.timeout%'
$agentLogger: '@monolog.logger.agent'
App\Tag\TagVectorSearchClient:
arguments:
$serviceUrl: '%mto.vector.service_url%'
$agentLogger: '@monolog.logger.agent'
App\Tag\TagRoutingService: ~
# ------------------------------------------------------------
# Tag Rebuild Jobs
# ------------------------------------------------------------
App\Service\TagRebuildJobService:
arguments:
$projectDir: '%mto.root%'
$agentLogger: '@monolog.logger.agent'
App\Command\TagRebuildRunJobCommand:
arguments:
$lockFilePath: '%mto.tags.rebuild_lock%'
# ------------------------------------------------------------
# Admin Utilities
# ------------------------------------------------------------
App\Service\Admin\IndexNdjsonInspector:
arguments:
$ndJsonPath: '%mto.knowledge.ndjson%'
$indexMetaPath: '%mto.knowledge.index_meta%'
App\Vector\VectorIndexHealthService:
arguments:
$indexNdjsonPath: '%mto.knowledge.ndjson%'
$vectorIndexPath: '%mto.knowledge.vector_index%'
$vectorMetaPath: '%mto.knowledge.vector_index_meta%'