Architecture
Titancore is an async-first application framework for agentic AI, stateful workflows, orchestration, and concurrent data processing. It provides application conventions and composition over established Python libraries.
Principles¶
- Delegate. Use a mature library for infrastructure mechanics.
- Adapt. Add a narrow adapter only when an application boundary needs it.
- Compose. Keep services and lifecycles connected through the application.
- Extend only where needed. Add framework behavior for a demonstrated application requirement.
The framework delegates dependency resolution to its configured resolver,
configuration file parsing to PyYAML, and ASGI hosting and route matching to
FastAPI and Starlette. Titancore adds a small route-declaration adapter for
the conventional routes/api.py files. Its PostgreSQL database integration
delegates ORM behavior and SQL construction to SQLAlchemy, driver I/O to
Psycopg 3, vector types and codecs to pgvector, and migration execution to
Alembic.
Retained packages¶
| Package | Responsibility |
|---|---|
titancore |
Public application, error, and version exports. |
titancore.foundation |
Application paths, provider composition, and lifecycle. |
titancore.config |
The bootstrap-created dotted configuration repository. |
titancore.cache |
Redis-backed application cache and lifecycle provider. |
titancore.facades |
Thin framework-shaped proxies for retained framework services. |
titancore.routing |
Route declarations and FastAPI compilation. |
titancore.container |
framework-shaped container and service declarations. |
titancore.database |
PostgreSQL sessions, fluent queries, models, and vector support. |
FastAPI owns route matching, request handling, and ASGI behavior. Titancore's
route facade owns only declaration metadata and grouping. The configured
resolver owns dependency graphs, scopes, and provider resources. SQLAlchemy
owns model mapping, query compilation, identity management, and transaction
mechanics. Application code uses those boundaries through Application.
PostgreSQL with pgvector is the only supported database, and Redis is the only
supported cache backend.
Application composition¶
An application creates a titancore.Application, registers providers, and
instantiates titancore.foundation.http.Kernel for its FastAPI app. The HTTP
kernel supplies the bootstrap sequence, which loads dotenv values and YAML
configuration before its lifespan starts and shuts down the application
container. Tests cover base-directory resolution,
configuration loading, provider resolution, request injection, and resource
cleanup.
The official application skeleton is the primary consumer and practical example of these APIs. Framework work should begin with an application requirement demonstrated there.
Planned direction¶
AI agents and durable workflows compose LangChain, LangGraph, the model SDKs, and the framework's existing cache and execution services. Redis checkpoints require RedisJSON and RediSearch on database zero. Background queues, dedicated data-processing APIs, and RAG/MCP integrations remain planned.