Forge
1.x
Docs/Forge/Configuration
Open

Deprecated

Use Cortex, Shield, Sentinel, Weave or Nexus instead.

Reading3 min
Updated31 Jul 2026
Sourcev1/extensions/ai/configuration.mdx

Config Model01

The extension config is ai.Config and is passed programmatically (ai.NewExtension(...) or ai.NewExtensionWithConfig(...)).

Top-Level Fields (ai.Config)02

  • EnableLLM (default true)

  • EnableAgents (default true)

  • EnableTraining (default false)

  • EnableInference (default true)

  • EnableCoordination (default true)

  • MaxConcurrency (default 10)

  • RequestTimeout (default 30s)

  • CacheSize (default 1000)

  • LLM (LLMConfiguration)

  • Inference (InferenceConfiguration)

  • Agents (AgentConfiguration)

  • Middleware (MiddlewareConfiguration)

  • StateStore (StateStoreConfig)

  • VectorStore (VectorStoreConfig)

  • Training (TrainingConfiguration)

LLM Configuration (LLMConfiguration)03

Fields:

  • DefaultProvider

  • Providers

  • MaxRetries

  • RetryDelay

  • Timeout

Important behavior:

  • CreateLLMManager uses DefaultProvider, retries, and timeout.

  • Providers from Providers are currently not auto-registered.

  • Register providers manually before startup for real model calls.

State Store (StateStoreConfig)04

Type values:

  • memory (default)

  • postgres

  • redis

Sub-configs:

  • Memory.TTL

  • Postgres.ConnString, Postgres.TableName

  • Redis.Addrs, Redis.Password, Redis.DB

Behavior:

  • invalid config or init errors trigger memory fallback in extension registration.

Vector Store (VectorStoreConfig)05

Type values:

  • memory (supported)

  • postgres (declared, currently not implemented)

  • pinecone (declared, currently not implemented)

  • weaviate (declared, currently not implemented)

Behavior:

  • unsupported/non-implemented backends return errors in factory code.

  • extension then falls back to in-memory vector store.

Training (TrainingConfiguration)06

Important fields:

  • Enabled

  • CheckpointPath

  • ModelPath

  • DataPath

  • MaxConcurrentJobs

  • DefaultResources (cpu, memory, gpu, timeout, priority)

  • Storage (local, s3, gcs, azure)

Important behavior:

  • DI registration of training services is controlled by Training.Enabled.

Inference, Agents, Middleware Blocks07

Inference, Agents, and Middleware config structs are available for package-level modules and future extension wiring.

Current extension behavior does not automatically instantiate inference engine or middleware from these blocks.

Practical Production Config (Go)08

cfg := ai.DefaultConfig()

cfg.LLM.DefaultProvider = "openai"
cfg.LLM.MaxRetries = 3
cfg.LLM.Timeout = 30 * time.Second

cfg.StateStore = ai.StateStoreConfig{
    Type: "postgres",
    Postgres: &ai.PostgresStateConfig{
        ConnString: os.Getenv("DATABASE_URL"),
        TableName:  "agent_state",
    },
}

// Keep memory unless you have a custom vector constructor.
cfg.VectorStore = ai.VectorStoreConfig{Type: "memory"}

cfg.Training = ai.TrainingConfiguration{
    Enabled:           true,
    CheckpointPath:    "./checkpoints",
    ModelPath:         "./models",
    DataPath:          "./data",
    MaxConcurrentJobs: 4,
    DefaultResources: ai.ResourcesConfig{
        CPU:      "4",
        Memory:   "8Gi",
        GPU:      0,
        Timeout:  4 * time.Hour,
        Priority: 1,
    },
    Storage: ai.StorageConfig{
        Type: "local",
        Local: &ai.LocalStorageConfig{BasePath: "./training-storage"},
    },
}

ext := ai.NewExtension(ai.WithConfig(cfg))

Validation Tips09

  • Fail fast on startup by keeping constructors eager.

  • Verify your provider can execute a simple prompt after app start.

  • Confirm state and vector store effective types from startup logs.