Skip to main content
Keep both memory and knowledge on your own machine — a local LLM answers, a local Ollama embedder builds the vectors, and a local vector store holds them.

Quick Start

1

Pull the embedder

2

Local memory

3

Add local knowledge

Install the MongoDB extra first: pip install "praisonaiagents[mongodb]". Chroma is the default local vector store and needs no extra service.

How It Works

The same embedder block drives memory and knowledge — embed, store, and query all stay on your machine. The SDK now sizes the vector index at the model’s real dimension — nomic-embed-text is 768, not the 1536 default it was silently written as before PR #4802.

Choosing a Local Embedder

Pick by what matters most: speed, balance, or quality.

Common Patterns

Local memory with a local LLM:
Local knowledge with the Knowledge class:
Both together — one local LLM for memory, one local embedder for knowledge:

Best Practices

Atlas vector indexes are built for a fixed dimension. Moving from text-embedding-3-small (1536) to nomic-embed-text (768) means dropping and re-creating vector_index at the new size — otherwise writes succeed but searches error or return nothing.
The first embed call fails cold if the model isn’t downloaded. Run ollama pull nomic-embed-text before starting the agent.
Ollama defaults to http://localhost:11434. Point elsewhere by setting api_base explicitly on the embedder call or OLLAMA_HOST in the environment.
The {"provider": "...", "config": {"model": "..."}} block works identically across memory, knowledge, and the MongoDB adapters — reuse one dict everywhere.

MongoDB Memory

Configure the embedder on the MongoDB memory store

MongoDB Knowledge

Scoped, vector-searchable knowledge in MongoDB

Ollama Embeddings

Local embedding models and auto-detected dimensions

Local Models

Run the LLM side fully local