New to configuration?See the Setup Configuration Overview for the complete workflow:install extras → create
.env → choose providers → handle pruning.Supported Frameworks
Cognee supports two structured output approaches:- LiteLLM + Instructor — Provider-agnostic client with Pydantic coercion (default)
- BAML — DSL-based framework with type registry and guardrails
How It Works
Cognee uses a unified interface that abstracts the underlying framework:STRUCTURED_OUTPUT_FRAMEWORK environment variable determines which backend processes your requests, but the API remains identical.
Configuration
- LiteLLM + Instructor (Default)
- BAML
The default framework — no extra install needed. Uses LiteLLM and the Optionally, control how the model is prompted for structured output:
instructor library to coerce LLM responses into Pydantic models.Important Notes
- Unified Interface: Your application code uses the same
acreate_structured_output()call regardless of framework - Provider Flexibility: Both frameworks support the same LLM providers
- Output Consistency: Both produce identical Pydantic-validated results
- Performance: Framework choice doesn’t significantly impact performance
LLM Providers
Configure LLM providers for text generation
Overview
Return to setup configuration overview
Custom Prompts
Learn about custom prompt configuration