Skip to content

About

Typed Python SDK, CLI, and API for analytical ingestion, vector search, cited RAG, point-in-time features, streaming, and AI framework integrations.

Topics

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

AI Integration Fabric

About

A typed Python SDK, CLI, and HTTP API for analytical ingestion, vector retrieval, cited retrieval-augmented answers, and historical feature access. The project composes an existing database driver; it does not introduce a database engine or wire protocol.

The product and package names are vendor-neutral. The analytical database and upstream HTTP driver are real dependencies declared in the dependency and deployment configuration. This independent project has no vendor affiliation.

Documentation: User guide · Repository knowledge graph

Topics: python · sdk · fastapi · rag · vector-search · feature-store · langchain · llamaindex · kafka · opentelemetry · graphify · ai-integration

Overall System Architecture

The SDK is the shared execution core. The CLI, HTTP API, and framework adapters reuse its ingestion, retrieval, and historical-feature operations. Dashed boxes identify optional integrations.

flowchart TB
    Python["Python applications"]
    CLI["fabric CLI"]
    API["FastAPI / OpenAPI<br/>Bearer tenant scope<br/>Bounded HTTP requests"]
    Frameworks["LangChain / LlamaIndex<br/>Optional vector-store adapters"]
    Async["Async Python facade<br/>Bounded thread pool"]
    RAG["Extractive RAG<br/>Cited source retrieval"]
    SDK["FabricClient - shared core<br/>Typed validation / tenant scope<br/>Bounded ingestion batches"]
    Operations["Ingestion / exact vector search<br/>Historical feature retrieval"]
    Driver["Upstream HTTP driver"]
    Store[("Analytical database<br/>Documents / vectors / metadata<br/>Feature events / availability times")]
    Embed["Optional local embeddings<br/>Python / framework providers"]
    Stream["Optional Kafka replay<br/>Python producer → broker<br/>Validated consumer"]
    Automate["Optional automation<br/>Scheduler → Python SDK<br/>n8n → HTTP API"]
    Telemetry["Payload-free telemetry<br/>Optional OTLP collector"]

    Python --> SDK
    CLI --> SDK
    CLI -->|rag| RAG
    Python --> Async --> SDK
    Python --> RAG
    API --> SDK
    API -->|/rag| RAG
    Frameworks --> SDK
    RAG --> SDK
    Embed -.->|Vectors via caller| Python
    Stream -.->|Documents| SDK
    Automate -.->|n8n| API
    Automate -.->|Scheduler| SDK
    SDK --> Operations --> Driver
    Driver <-->|Queries / acknowledged inserts| Store
    SDK -.-> Telemetry
    classDef optional stroke-dasharray: 5 5
    class Frameworks,Embed,Stream,Automate optional
Loading

The SDK, adapters, async facade, RAG helper, and scheduler are Python components running in their caller's process. The CLI also exposes extractive RAG. The API can run on the host or in its Compose container; the database and selected Kafka/n8n/collector services use local containers. Async queue limits and HTTP admission limits apply at their respective entry points. Python producers publish records to Kafka, and the replay consumer commits offsets only after database acknowledgement.

Embedding happens in Python examples or injected framework embedding providers. CLI and HTTP search/RAG requests take vectors. CLI and HTTP RAG return cited extracts; Python callers can separately opt into local Ollama generation using retrieved sources, as shown below.

End-to-End Data Flow

flowchart TD
    subgraph Retrieval["Document ingestion and cited retrieval"]
        direction TB
        Documents["Documents / text"] --> Embed["Embed locally in Python<br/>or supply existing vectors"]
        Embed --> Validate["Validate tenant, model and dimensions"]
        Validate --> Write["Bound batches and insert"]
        Write --> DocumentStore[("Document and vector records")]
        Query["Question embedded in Python<br/>or supplied query vector"] --> Filter["Validate query and apply<br/>tenant / model / metadata filters"]
        DocumentStore --> Filter --> Search["Exact cosine ranking / top-k"]
        Search --> Hits["Source hits, IDs and scores"]
        Hits --> Extract["Cited extracts<br/>CLI / HTTP / Python default"]
        Extract --> Response["Response with retained sources"]
        Hits -.->|Python caller opts in| Generate["Optional Ollama generation<br/>Question plus retrieved sources"]
        Generate --> Response
    end
    subgraph Features["Historical feature retrieval"]
        direction TB
        Events["Feature events"] --> EventWrite["Validate tenant and timestamps<br/>Insert versioned events"]
        EventWrite --> FeatureStore[("Feature event history")]
        FeatureStore --> Cutoffs["Filter tenant and entity<br/>event_time AND available_at cutoffs"]
        Request["Entity, feature names<br/>and historical cutoffs"] --> Cutoffs
        Cutoffs --> Latest["Select latest eligible values"]
        Latest --> FeatureResponse["Values and timestamps<br/>Explicit missing / stale state"]
    end
    classDef optional stroke-dasharray: 5 5
    class Generate optional
Loading
  1. Enter through a supported interface. HTTP credentials bind tenant identity on the server; trusted Python/CLI callers configure their client scope.
  2. Ingest validated records. Tabular data, embedded documents, and replayed Kafka records reach the same client and driver. A write acknowledgement is distinct from an uncertain write outcome.
  3. Retrieve evidence or historical features. Vector queries preserve source identity; feature queries require both event-time and information-availability cutoffs.
  4. Return typed results and observe execution. Responses retain source IDs or feature timestamps. Telemetry records operation counts, durations, and failures without raw SQL, documents, or credentials.

See architecture and detailed system flows for ingestion acknowledgements, duplicate semantics, tenant boundaries, streaming, and cancellation. The Graphify index maps repository relationships for navigation; these diagrams describe application execution.

Start here

Use Python 3.12, uv, and Docker with Compose. Network access is needed to install pinned dependencies, pull images, and download the optional local embedding model. No paid API or GPU is required.

uv sync --all-extras --dev --locked
docker compose -f infra/compose.yaml up -d --wait
uv run fabric --help

Continue with the user walkthrough. The verification report is the sole source for executed checks and outstanding gaps; implementation alone does not establish a working integration or production readiness.

What is included

  • Typed synchronous/asynchronous query and insertion, bounded batching, explicit resource ownership, structured errors, and safe read retries.
  • Pandas, NumPy, and Arrow ingestion; tenant/model-scoped vector retrieval with metadata filtering.
  • Optional LangChain and LlamaIndex adapters and CPU-local embeddings.
  • Cited extracts by default, with optional local Ollama answer generation.
  • Historical feature values constrained by event time and information availability.
  • Kafka replay, n8n HTTP orchestration, a bounded scheduler, and payload-free telemetry.
  • Reproducible tests, CI, benchmarks, architecture diagrams, and explanations of every authored executable/configuration line.

Documentation map

Need Read
Install, run, and interact User guide
Understand components and data flow Architecture
Understand technology choices and integration boundaries Technology and integrations
Use configuration, SDK, CLI, and API API and contracts
Explore source and documentation relationships Repository knowledge graph
Understand each source line Local source walkthrough instructions
Trace the complete blueprint Source inventory and requirements matrix
Run checks and interpret evidence Testing, benchmarks, verification
Operate and diagnose the local prototype Operations
Understand threats and residual risks Security
Contribute safely Contribution guide

Verification

uv run ruff format --check .
uv run ruff check .
uv run mypy
uv run pytest
uv run python tools/documentation.py generate
uv run python tools/documentation.py check
uv build

Service/model checks have explicit prerequisites; see testing. A test that is not run is not a pass. Coverage is an exercised-code measure, not a guarantee of correctness.

Licensed under Apache-2.0. See SECURITY.md for vulnerability reporting.

⭐ Star this repo if you find it useful!

Report Bug · Request Feature · Ask Question

About

Typed Python SDK, CLI, and API for analytical ingestion, vector search, cited RAG, point-in-time features, streaming, and AI framework integrations.

Topics

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages