vxcontrol/pentagi · error
memory is not available
Error message
memory is not available
What it means
The memory tool's Handle was invoked when m.IsAvailable() is false — i.e. the tool was constructed without a pgvector store (and related dependencies), so it cannot operate at all. It's an availability guard, not a runtime failure.
Source
Thrown at backend/pkg/tools/memory.go:44
)
type memory struct {
flowID int64
store *pgvector.Store
vslp VectorStoreLogProvider
}
func NewMemoryTool(flowID int64, store *pgvector.Store, vslp VectorStoreLogProvider) Tool {
return &memory{
flowID: flowID,
store: store,
vslp: vslp,
}
}
func (m *memory) Handle(ctx context.Context, name string, args json.RawMessage) (string, error) {
if !m.IsAvailable() {
return "", fmt.Errorf("memory is not available")
}
ctx, observation := obs.Observer.NewObservation(ctx)
logger := logrus.WithContext(ctx).WithFields(enrichLogrusFields(m.flowID, nil, nil, logrus.Fields{
"tool": name,
"args": string(args),
}))
if m.store == nil {
logger.Error("pgvector store is not initialized")
return "", fmt.Errorf("pgvector store is not initialized")
}
switch name {
case SearchInMemoryToolName:
var action SearchInMemoryAction
if err := json.Unmarshal(args, &action); err != nil {
logger.WithError(err).Error("failed to unmarshal search in memory action arguments")View on GitHub (pinned to ea665308ba)
Solutions
- Check startup logs for pgvector store initialization errors before the flow ran.
- Ensure the pgvector store is configured (DB URL with pgvector extension) so NewMemoryTool gets a non-nil store.
- Don't register the memory tool with agents when the store is nil — gate registration on availability.
- Verify DB migrations applied so the store constructor succeeds.
Example fix
// before: register unconditionally
tools = append(tools, NewMemoryTool(flowID, store, vslp))
// after: register only when available
if m := NewMemoryTool(flowID, store, vslp); m.IsAvailable() {
tools = append(tools, m)
} Defensive patterns
Strategy: type-guard
Validate before calling
func memoryAvailable(store *pgvector.Store) bool {
return store != nil
} Type guard
func withMemoryTool(store *pgvector.Store) Tool {
if store == nil {
return nil // caller must skip registration
}
return NewMemoryTool(flowID, store, vslp)
} Try / catch
out, err := tool.Handle(ctx, "search_in_memory", args)
if err != nil && strings.Contains(err.Error(), "memory is not available") {
log.Println("memory store disabled; continuing without memory lookup")
return emptyResult, nil
} Prevention
- Gate tool registration on IsAvailable() at flow startup
- Check pgvector configuration (.env DB settings) before enabling memory features
- Fail fast at deploy time if pgvector is expected but not initialized
- Make the agent prompt omit unavailable tools so the model never calls them
When it happens
Trigger: Calling search_in_memory (or any memory tool name) when NewMemoryTool received a nil store; this happens when the deployment has no pgvector store configured (DB not set up, vector-store disabled at startup) yet the tool was still registered with the agent.
Common situations: PostgreSQL/pgvector not configured in .env; vector store initialization failed at startup but tools were still registered; running flows against an environment without the memory feature enabled.
Related errors
- extension %q is installed in schema %q, but multi-tenant mod
- pgvector store is not initialized
- pgvector store is not initialized
- token validation disabled with default salt
- Token.CreationDisabled
AI-assisted analysis of vxcontrol/pentagi@ea665308ba (2026-09-01).
Data as JSON: /api/errors/560adfebfc801af9.
Report an issue: GitHub.