Building the Future of AI Infrastructure

Intelligent Systems.
Agentic Frameworks.
Built for Scale.

VivekaSutra delivers production-ready Python libraries and agentic AI frameworks so your team ships faster — not fights infrastructure.

3
Python Libraries
100%
Async Native
Python
3.11+ Support
Free
To Download & Use

Infrastructure for the AI Age

We design and build the foundational layers that AI-powered services depend on — so developers can focus on intelligence, not plumbing.

🤖

Agentic AI Frameworks

Composable, observable agent runtimes built for production. Design multi-step reasoning loops, tool-use pipelines, and autonomous workflows with confidence.

Async-First Infrastructure

Every library we ship is built async from the ground up — FastAPI, SQLAlchemy async, Redis asyncio. No blocking, no surprises under load.

🧱

Modular Python Libraries

Small, focused packages with clear responsibilities. Add what you need, leave what you don't. Each library works standalone or as part of the Viveka ecosystem.

🔒

Production Hardened

Connection pooling, rotating log files, cache fallbacks, transaction rollbacks — the operational concerns are handled so you never have to think about them.

🧩

Spring-Inspired Patterns

Familiar decorator-based APIs inspired by Spring Boot — @entity, @transactional, @cacheable — so teams coming from Java feel right at home.

📦

pip install Ready

Published on PyPI. Install in one line, integrate in minutes. Full type hints, py.typed markers, and IDE autocomplete out of the box.

The Viveka Ecosystem

Three focused libraries that form the backbone of any Viveka-powered service. Free to download and use — proprietary, no warranty.

📚

viveka-core-lib

v0.1.0

The core shared library. Provides configuration management, structured logging, and async Redis caching — the three cross-cutting concerns every service needs on day one.

  • ConfigService — env vars, config.ini, typed values
  • VivekaLogManager — rotating file + console handlers
  • VivekaCacheManager — async Redis with pluggable backends
  • RedisCacheService — production Redis implementation
  • No Viveka dependencies — install standalone
$ pip install viveka-core-lib
🗄️

viveka-db-lib

v0.1.0

A Spring JPA-inspired async database library. Declarative entity mapping, generic repositories, transaction management, and cache decorators — built on SQLAlchemy async and Redis.

  • @entity, @table — declarative ORM mapping
  • DbRepo[T] — generic CRUD repository
  • @transactional — HTTP & background task sessions
  • @cacheable / @cache_evict — Spring-style cache decorators
  • DbMiddleware — per-request session lifecycle
$ pip install viveka-db-lib
🚀

viveka-server-lib

v0.1.0

FastAPI + Uvicorn application factory. Spin up a production-ready API server with built-in health checks, CORS, exception handling, DB middleware, and lifecycle hooks — in under ten lines of code.

  • VivekaServer — FastAPI + Uvicorn wrapped factory
  • Built-in GET / and GET /health routes
  • Standard JSON exception responses
  • Auto-wired DB + Cache when enabled
  • Override startup() / shutdown() for custom logic
$ pip install viveka-server-lib

See viveka-db-lib in Action

Three self-contained FastAPI services showing how to use viveka-db-lib and viveka-server-lib in real applications. Clone the repo and run any demo in one command.

Port 8001 · Basic CRUD

Todo Manager

The simplest demo. One entity, one repository, full CRUD. The recommended starting point to understand how viveka-db-lib connects models, repositories, and the automatic session lifecycle.

  • @entity + @table — declarative entity mapping
  • VivekaDbBase — shared SQLAlchemy declarative base
  • DbRepo[T] — insert, get, update, delete, count built-in
  • @repository — marks the repository class
  • @transactional — session injected automatically per call
  • VivekaApp.startup() — creates DB tables on boot
  • VivekaServer.build_routes() — wires FastAPI routes
Run setup.bat todo
📄 SQLite · No extra setup required View source →
model/todo.py + repo/todo_repo.py
@entity
@table("todos")
class Todo(VivekaDbBase):
    id         = mapped_column(Integer, primary_key=True)
    title      = mapped_column(String(200), nullable=False)
    completed  = mapped_column(Boolean, default=False)
    created_at = mapped_column(DateTime, default=datetime.utcnow)


@repository
class TodoRepo(DbRepo[Todo]):

    @transactional
    async def save(self, todo: Todo) -> Todo:
        return (await self.insert_all([todo]))[0]

    @transactional
    async def complete(self, todo_id: int):
        todo = await self.get_by_id(todo_id)
        if todo:
            todo.completed = True
            return await self.update(todo)
API Endpoints
POST/api/v1/todosCreate a todo
GET/api/v1/todosList all (paginated)
GET/api/v1/todos/{id}Get by ID
PATCH/api/v1/todos/{id}/completeMark as done
DELETE/api/v1/todos/{id}Delete
GET/api/v1/todos/stats/countTotal count
Port 8002 · Relationships & Pagination

Employee Directory

Two related entities — Department and Employee. Shows how viveka-db-lib handles foreign key relationships, field-based queries, and paginated listing across two repos sharing a single service.

  • ForeignKey relationship — Employee.department_id → departments.id
  • find_all_by_field — fetch all employees in a department
  • find_by_field — lookup employee by email
  • get_all(skip, limit) — built-in pagination
  • count() — total record count without loading rows
  • Multiple routers registered in one VivekaServer
  • Shared service singleton across routers
Run setup.bat employee
📄 SQLite · No extra setup required View source →
model/employee.py + repo/employee_repo.py
@entity
@table("employees")
class Employee(VivekaDbBase):
    id            = mapped_column(Integer, primary_key=True)
    name          = mapped_column(String(200), nullable=False)
    role          = mapped_column(String(100), nullable=False)
    department_id = mapped_column(Integer, ForeignKey("departments.id"))


@repository
class EmployeeRepo(DbRepo[Employee]):

    @transactional
    async def find_by_department(self, dept_id: int):
        return await self.find_all_by_field("department_id", dept_id)

    @transactional
    async def list_all(self, skip=0, limit=100):
        return await self.get_all(skip=skip, limit=limit)
API Endpoints
POST/api/v1/departmentsCreate department
GET/api/v1/departmentsList all departments
GET/api/v1/departments/{id}/employeesEmployees in dept
POST/api/v1/employeesHire employee
GET/api/v1/employeesList all (paginated)
GET/api/v1/employees/{id}Get employee
PATCH/api/v1/employees/{id}/roleUpdate role
DELETE/api/v1/employees/{id}Remove employee
Port 8003 · Caching Decorators

Product Catalog

An e-commerce catalog with categories and products. The most feature-rich demo — focuses on the @cacheable and @cache_evict decorators. Works without Redis via graceful degradation; enable caching by uncommenting the Redis config.

  • @cacheable(key_prefix, ttl) — cache-aside read on GET /products/{id}
  • @cache_evict(key_prefix) — invalidates cache on price/stock update
  • Cache graceful degradation — works without Redis, zero code change
  • find_all_by_field — products by category
  • ForeignKey relationship — Product → Category
  • Separate category and product routers, shared service
Run setup.bat product
📄 SQLite · Redis optional for caching View source →
model/product.py + repo/product_repo.py
@entity
@table("products")
class Product(VivekaDbBase):
    id          = mapped_column(Integer, primary_key=True)
    name        = mapped_column(String(200), nullable=False)
    price       = mapped_column(Float, nullable=False)
    category_id = mapped_column(Integer, ForeignKey("categories.id"))


@repository
class ProductRepo(DbRepo[Product]):

    @transactional
    @cacheable(key_prefix="product", ttl=1800)
    async def get(self, product_id: int):
        return await self.get_by_id(product_id)

    @transactional
    @cache_evict(key_prefix="product")
    async def update_product(self, product: Product):
        return await self.update(product)
API Endpoints
POST/api/v1/categoriesCreate category
GET/api/v1/categories/{id}/productsProducts in category
POST/api/v1/productsAdd product
GET/api/v1/products/{id}Get product (cached)
PATCH/api/v1/products/{id}/priceUpdate price (evicts cache)
PATCH/api/v1/products/{id}/stockUpdate stock (evicts cache)
DELETE/api/v1/products/{id}Remove (evicts cache)
GET/api/v1/products/stats/countTotal count

Built on a Modern Stack

Every technology choice is deliberate — async-native, production-proven, and widely adopted in the Python ecosystem.

Python 3.11+
FastAPI
SQLAlchemy Async
asyncpg
aiomysql
Redis asyncio
Starlette
LangGraph
Qdrant
aiohttp
hiredis
ContextVar
PyPI

Start building with Viveka today

All three libraries are on PyPI. Install them in seconds and have your service infrastructure ready in minutes.