Technology Stack
Graffold is a production AI platform for knowledge graph construction and natural language querying. This document catalogs every technology in the stack, organized by domain.
Buzzwords at a Glance
AI & Retrieval: GraphRAG, Retrieval-Augmented Generation, Agentic AI, Multi-Strategy Retrieval, Hybrid Search, Vector Search, Semantic Search, Knowledge Graphs, LLM Orchestration, Prompt Engineering, Context Compression, Cross-Encoder Re-Ranking, Entity Resolution, Ontology Alignment
Architecture: Event-Driven, Async-First, Multi-Tenant, Factory Pattern, Strategy Pattern, Event Sourcing, Domain-Driven Design, Dependency Injection, ASGI, HTTP/2, Server-Sent Events (SSE), Streaming Inference
Data & ML Engineering: ETL Pipelines, Multi-Source Ingestion, NLP, Named Entity Recognition (NER), Embedding Models, Vector Indexes (HNSW), Community Detection, Graph Algorithms, Property-Based Testing, Golden Dataset Evaluation
Infrastructure & DevOps: Containerized Deployment, Infrastructure-as-Code (CDK), Multi-Backend Database Abstraction, Docker Container Provisioning, Distributed Tracing (OpenTelemetry), Observability, Prometheus Metrics, Grafana Dashboards
Security & Compliance: Defense-in-Depth, PII Detection & Redaction, Prompt Injection Prevention, Cypher Injection Prevention, Parameterized Queries, Audit Logging, Provenance Tracking, Data Lineage, Multi-Tenant Isolation, Tier-Based Access Control
Product & Platform: SaaS, Subscription Billing (Stripe), Tiered Pricing, Self-Service KG Provisioning, Interactive Graph Visualization, Conversational AI Interface, Real-Time Streaming, Developer CLI/TUI, API-First Design, OpenAPI
Core AI / ML
| Technology |
Role in Graffold |
| LangChain + LangGraph |
LLM orchestration — agent pipelines, tool calling, chain composition |
| AWS Bedrock |
Primary LLM provider (Claude, Titan) for production inference |
| AWS SageMaker |
Secondary LLM hosting for custom/fine-tuned models |
| Ollama |
Local LLM inference for development and cost-sensitive workloads |
| sentence-transformers |
Embedding generation (all-mpnet-base-v2, 768d) for vector search |
| HuggingFace Transformers |
Model loading, tokenization, cross-encoder re-ranking (ms-marco-MiniLM) |
| tiktoken |
BPE tokenization for accurate token counting and cost estimation |
| Presidio |
PII detection and redaction in inputs and outputs |
| PyTorch |
ML runtime for transformer models and embeddings |
| NetworkX |
Graph algorithms — community detection, centrality, path analysis |
| python-louvain |
Louvain community detection for graph clustering |
Knowledge Graph & Databases
| Technology |
Role in Graffold |
| Memgraph |
Primary graph database — in-memory, openCypher, MAGE algorithms, per-tenant container isolation |
| Cloudflare Vectorize |
Vector embedding storage and similarity search (split from graph layer) |
| Neo4j |
Legacy/enterprise graph backend — Cypher queries, HNSW vector indexes, fulltext indexes |
| neo4j-rust-ext |
Rust Bolt protocol driver for high-throughput Neo4j communication |
| FalkorDB |
Alternative graph backend — Redis-native, native multi-graph isolation |
| graphrag-sdk |
FalkorDB's GraphRAG SDK for vector + graph hybrid retrieval |
| Redis |
Cache, sessions, user store, rate limiting, dynamic domain configs |
| hiredis |
C-based Redis protocol parser for lower latency |
Split Database Architecture
Graffold uses a split architecture: Memgraph handles nodes, relationships, and graph traversals while Cloudflare Vectorize handles vector embeddings for semantic similarity search. This decouples graph memory from vector index scaling. See Database Architecture for details.
API & Backend
| Technology |
Role in Graffold |
| FastAPI |
REST API framework — async endpoints, dependency injection, OpenAPI docs |
| Pydantic v2 |
Request/response validation, domain models, config management |
| Granian |
Rust-based ASGI server (HTTP/2) for production deployment |
| Uvicorn |
ASGI server for development |
| Starlette |
ASGI toolkit — middleware, SSE streaming |
| Stripe |
Subscription billing, webhook-driven tier management |
| aiohttp / httpx |
Async HTTP clients for external API calls |
Data Processing & Ingestion
| Technology |
Role in Graffold |
| pandas |
Tabular data processing for CSV/Excel ingestion |
| polars |
High-performance DataFrames for large dataset operations |
| BioPython |
PubMed API access, biological sequence/format parsing |
| obonet |
OBO ontology parsing (MONDO disease ontology) |
| PyPDF |
PDF text extraction for document ingestion |
| markitdown |
Markdown conversion for document processing |
| openpyxl |
Excel file reading for tabular data ingestion |
Observability & Monitoring
| Technology |
Role in Graffold |
| OpenTelemetry |
Distributed tracing — per-phase timing, tool call traces, entity discovery logs |
| Prometheus |
Metrics collection — query latency, token usage, cache hit rates |
| Grafana |
Dashboards for system health, query performance, cost tracking |
Testing & Quality
| Technology |
Role in Graffold |
| pytest |
Test framework with async support, parallel execution |
| Hypothesis |
Property-based testing — correctness properties, edge case discovery |
| fakeredis |
In-memory Redis mock for isolated testing |
| mypy (strict) |
Static type checking across the entire src/ directory |
| Ruff |
Linting + formatting (88 rule categories enabled) |
Infrastructure & DevOps
| Technology |
Role in Graffold |
| Docker + Docker Compose |
Containerized deployment, per-user Memgraph container provisioning |
| AWS CDK |
Infrastructure-as-code for cloud deployment |
| boto3 |
AWS SDK — Bedrock API calls, S3, SageMaker |
Frontend
| Technology |
Role in Graffold |
| React |
Web UI — conversational query interface, KG management, dashboards |
| Sigma.js |
Interactive graph visualization — node/edge rendering, force-directed layout |
| Technology |
Role in Graffold |
| Click |
CLI framework (graffold command — serve, health, query) |
| Rich |
Terminal formatting — progress bars, tables, syntax highlighting |
| Textual |
TUI framework for interactive terminal dashboard |
| Technology |
Why It Matters |
| orjson |
3-10x faster JSON serialization than stdlib json |
| neo4j-rust-ext |
Rust Bolt protocol — lower latency on high-throughput graph queries |
| granian |
Rust HTTP/2 server — better throughput than pure-Python ASGI servers |
| pydantic-core |
Rust validation engine — fast model parsing at API boundaries |
| tiktoken |
Native BPE tokenizer — fast token counting for cost tracking |
| hiredis |
C Redis parser — lower overhead on cache/session operations |
| polars |
Rust DataFrame engine — fast columnar operations on large datasets |
Architecture Patterns
- Deterministic retrieval pipeline — LLM only synthesizes, never decides what to search
- Factory pattern — Pluggable LLM providers, embedding models, database backends, query agents
- Strategy pattern — Multiple query agents and search strategies, selected at runtime
- Split database architecture — Memgraph for graph (nodes/relationships), Cloudflare Vectorize for embeddings (vector search)
- Multi-backend graph isolation — Label-prefix (shared Neo4j), named graphs (FalkorDB), dedicated containers (Memgraph)
- Event sourcing —
GraphEvent model tracks all graph mutations with full provenance
- Async-first — All I/O is async/await with sync bridging for CLI callers
Scale Numbers
| Metric |
Value |
| Query agents |
4 types with 6 retrieval modes |
| LLM providers |
5 (Bedrock, SageMaker, Ollama, Cloudflare, OpenAI-compatible) |
| Graph tool registry |
15+ tools with schema-aware activation |
| Ruff lint rules |
88 categories enabled |
| Test markers |
7 (unit, integration, slow, properties, memgraph, falkordb, xfail) |