Documentation Index
Fetch the complete documentation index at: https://docs.statebase.org/llms.txt
Use this file to discover all available pages before exploring further.
The “Amalthea” Pattern
When using StateBase with OpenAI, we recommend a specific prompting pattern to maximize reliability: Context Injection. Instead of sending the raw chat history array to OpenAI, you let StateBase curate the context.Code Example
Why this works better?
- Token Efficiency: You don’t send 50 turns of history. You send a summarized state + 5 relevant turns.
- Accuracy: “Memories” (long-term facts) are injected explicitly, preventing the model from having to “search” its context window.
- Cost: Significantly reduces input token costs for long-running sessions.