🚀 PocketFlow-Nim Documentation

A powerful, production-ready flow-based agent framework for Nim with advanced LLM integration, RAG capabilities, and comprehensive orchestration features.

📦 Core Modules

pocketflow

Core

Main module that re-exports all PocketFlow functionality

context

Core

Shared context for passing data between nodes in a flow

node

Core

Node, BatchNode, and ParallelBatchNode implementations

flow

Core

Flow, BatchFlow, and ParallelBatchFlow orchestration

🤖 LLM Integration

llm

LLM

Multi-provider LLM client (OpenAI, Anthropic, Google, Ollama)

tokens

LLM

Token counting and cost tracking utilities

cache

LLM

LRU caching for LLM responses and embeddings

📄 RAG Capabilities

rag

RAG

Document chunking, embeddings, similarity search, and reranking

⚡ Advanced Features

advanced_nodes

Advanced

ConditionalNode, LoopNode, TimeoutNode, MapNode

observability

Util

Structured logging, metrics, and tracing spans

persistence

Util

State capture, save, load, and restore functionality

errors

Util

Custom exception types for error handling

benchmark

Util

Performance benchmarking utilities

📚 Resources