How psharpx/python-labs works
This tree is a collection of independent Python applications, not one integrated product. The most developed workflow is TechDoc Builder: a user submits a request, the agent coordinates analysis and pauses for clarification or financial approval; catalog, tariff and graph-context capabilities are provided by a separate MCP application. The tree also contains a bookstore API, a product-review RAG scraper, and smaller agent projects. Relationships are shown only where excerpts or the source index support them; several unsampled workflow internals are therefore left unconnected.
Main entry points: workflow.py Workflow engine · main.py Builder CLI · product_service_service.py Catalog service · graph_rag_service.py Graph context
Components 34
TechDoc Builder
- Builder CLI
techdoc-agent/main.py - Workflow engine
techdoc-agent/src/workflow.py - Stage routing
techdoc-agent/src/routing.py - Requirements agent
techdoc-agent/src/tools/requirements/state_manager.py - Requirement schemas
techdoc-agent/src/tools/requirements/state_manager_input.py - Shared models
techdoc-agent/src/shared/models.py - State reducers
techdoc-agent/src/shared/reducers.py - Agent logging
techdoc-agent/src/middlewares/logging.py - Guardrails
techdoc-agent/src/middlewares/guardrails.py - Architecture tools
techdoc-agent/src/tools/architect - MCP clients
techdoc-agent/src/tools/mcp
TechDoc Catalog MCP
- MCP tools
techdoc-mcp/tools.py - Catalog service
techdoc-mcp/src/catalog/services/product_service_service.py - Catalog DTOs
techdoc-mcp/src/catalog/domain/product_service.py - Tariff calculation
techdoc-mcp/src/catalog/services/tariff_calculation_service.py - Graph context
techdoc-mcp/src/catalog/graph/services/graph_rag_service.py - Graph DTOs
techdoc-mcp/src/catalog/graph/domain/graph_rag_domain.py - Catalog database
techdoc-mcp/src/catalog/database.py - MCP app entry
techdoc-mcp/main.py
Bookstore API
- Book API routes
fastapi-bookstore/app/api/v1/routes/book_router.py - API router
fastapi-bookstore/app/api/v1/router.py - Author repository
fastapi-bookstore/app/infrastructure/repositories/author_repository_impl.py - Repository ports
fastapi-bookstore/app/application/ports/repositories/author_repository.py - Database models
fastapi-bookstore/app/infrastructure/database/models - Outbox worker
fastapi-bookstore/app/workers/outbox_worker.py - Outbox handler
fastapi-bookstore/app/application/use_cases/process_outbox/handler.py
Review Scraper
- Scraper entry
smarty-scraper/main.py - Index and retrieve
smarty-scraper/rag.py - Review agent
smarty-scraper/agent.py
Other components
- User
- Neo4j
- SQL database
- Bookstore client
- Review researcher
Connections 34
- User → Builder CLI: submits request
techdoc-agent/main.py - Builder CLI → Workflow engine: starts and resumes
- Builder CLI → User: requests input
techdoc-agent/main.py - Workflow engine → Stage routing: routes stages
- Workflow engine → Requirements agent: runs analysis
- Requirements agent → Requirement schemas: validates inputs
techdoc-agent/src/tools/requirements/state_manager.py - Requirements agent → Shared models: updates state
techdoc-agent/src/tools/requirements/state_manager.py - Builder CLI → Shared models: handles responses
techdoc-agent/main.py - Workflow engine → State reducers: combines state
- Workflow engine → Agent logging: emits logs
- Workflow engine → Guardrails: applies checks
- Workflow engine → Architecture tools: uses tools
- Workflow engine → MCP clients: uses clients
- MCP app entry → Catalog service: fetches catalog
techdoc-mcp/main.py - MCP app entry → Tariff calculation: calculates tariff
techdoc-mcp/main.py - MCP app entry → Graph context: fetches graph context
techdoc-mcp/main.py - MCP tools → Catalog service: registers capability
techdoc-mcp/tools.py - MCP tools → Tariff calculation: registers capability
techdoc-mcp/tools.py - MCP tools → Graph context: registers capability
techdoc-mcp/tools.py - Catalog service → Catalog DTOs: maps results
techdoc-mcp/src/catalog/services/product_service_service.py - Catalog service → Catalog database: opens session
techdoc-mcp/src/catalog/services/product_service_service.py - Tariff calculation → Catalog database: reads rates
techdoc-mcp/src/catalog/services/tariff_calculation_service.py - Graph context → Graph DTOs: builds DTOs
techdoc-mcp/src/catalog/graph/services/graph_rag_service.py - Graph context → Neo4j: queries graph
techdoc-mcp/src/catalog/graph/services/graph_rag_service.py - Catalog database → SQL database: connects
techdoc-mcp/src/catalog/database.py - Bookstore client → API router: calls API
- API router → Book API routes: routes requests
fastapi-bookstore/app/api/v1/router.py - Author repository → Repository ports: implements port
fastapi-bookstore/app/infrastructure/repositories/author_repository_impl.py - Author repository → Database models: persists records
fastapi-bookstore/app/infrastructure/repositories/author_repository_impl.py - Outbox worker → Outbox handler: invokes handler
fastapi-bookstore/app/workers/outbox_worker.py - Review researcher → Scraper entry: starts research
smarty-scraper/main.py - Scraper entry → Index and retrieve: indexes and retrieves
smarty-scraper/main.py - Scraper entry → Review agent: starts agent
smarty-scraper/main.py - Review agent → Index and retrieve: searches reviews