Appearance
RAG and memory
Optional extras:
bash
pip install --extra-index-url https://elsai-agents.elsai.ai/root/ "elsai-agents-tools[mem0-memory]==0.3.0"
pip install --extra-index-url https://elsai-agents.elsai.ai/root/ "elsai-agents-tools[elasticsearch-memory]==0.3.0"
pip install --extra-index-url https://elsai-agents.elsai.ai/root/ "elsai-agents-tools[mongodb-memory]==0.3.0"Tools
retrieve
Query Amazon Bedrock Knowledge Bases with semantic search and return ranked passages for agent context
Environment variables
| Variable | Required | Default | Description |
|---|---|---|---|
KNOWLEDGE_BASE_ID | yes | — | Default Bedrock Knowledge Base ID for retrieve |
AWS_REGION | yes | — | AWS region for Bedrock / AgentCore (needed when not already configured in your AWS environment) |
MIN_SCORE | optional | 0.4 | Lowest relevance score to keep from retrieve |
RETRIEVE_ENABLE_METADATA_DEFAULT | optional | false | Whether retrieve results include metadata by default |
memory
Full CRUD over Knowledge Base documents — store, list, get, delete, and retrieve entries the agent can reference later
Environment variables
| Variable | Required | Default | Description |
|---|---|---|---|
ELSAI_KNOWLEDGE_BASE_ID | yes | — | Default Knowledge Base ID for memory (separate from KNOWLEDGE_BASE_ID) |
AWS_REGION | yes | — | AWS region for Bedrock / AgentCore (needed when not already configured in your AWS environment) |
MEMORY_DEFAULT_MIN_SCORE | optional | 0.4 | Lowest relevance score for memory retrieve |
MEMORY_DEFAULT_MAX_RESULTS | optional | 50 | Max results for memory retrieve |
Also respects BYPASS_TOOL_CONSENT (see Tool consent).
agent_core_memory
Persistent short- and long-term memory through Bedrock AgentCore — record facts, retrieve by query, and manage session history
Extra: base (AWS)
Environment variables
| Variable | Required | Default | Description |
|---|---|---|---|
AWS_REGION | yes | — | AWS region for Bedrock / AgentCore (needed when not already configured in your AWS environment) |
mem0_memory
Long-term agent memory and user personalization backed by Mem0, with vector search over past interactions
Extra: mem0-memory
Environment variables
| Variable | Required | Default | Description |
|---|---|---|---|
MEM0_API_KEY | yes | — | Mem0 cloud API key (uses the cloud backend when set) |
OPENSEARCH_HOST | yes | — | OpenSearch host for Mem0 (do not combine with Neptune Analytics graph ID) |
NEPTUNE_ANALYTICS_GRAPH_IDENTIFIER | yes | — | Neptune Analytics graph for Mem0 vector storage |
NEPTUNE_DATABASE_ENDPOINT | yes | — | Neptune DB endpoint for Mem0 |
AWS_REGION | yes | — | AWS region for Bedrock / AgentCore (needed when not already configured in your AWS environment) |
MEM0_EMBEDDER_PROVIDER | optional | aws_bedrock | Embedder provider for Mem0 |
MEM0_EMBEDDER_MODEL | optional | amazon.titan-embed-text-v2:0 | Embedding model for Mem0 |
MEM0_LLM_PROVIDER | optional | aws_bedrock | LLM provider for Mem0 |
MEM0_LLM_MODEL | optional | Claude Haiku default | LLM model for Mem0 |
MEM0_LLM_TEMPERATURE | optional | 0.1 | LLM temperature for Mem0 |
MEM0_LLM_MAX_TOKENS | optional | 2000 | LLM max tokens for Mem0 |
OPENSEARCH_COLLECTION | optional | mem0 | OpenSearch collection name |
NEPTUNE_ANALYTICS_VECTOR_COLLECTION | optional | mem0 | Neptune Analytics vector collection name |
Also respects BYPASS_TOOL_CONSENT (see Tool consent).
elasticsearch_memory
Store and recall agent memory in Elasticsearch with vector similarity search for fast semantic lookup
Extra: elasticsearch-memory
Environment variables
| Variable | Required | Default | Description |
|---|---|---|---|
ELASTICSEARCH_URL / ELASTICSEARCH_CLOUD_ID | yes | — | Elasticsearch connection URL or cloud ID |
ELASTICSEARCH_API_KEY | yes | — | Elasticsearch API key (when your cluster requires it) |
ELASTICSEARCH_INDEX_NAME | yes | — | Elasticsearch index for agent memory |
mongodb_memory
Store and retrieve agent memory using MongoDB Atlas Vector Search for scalable, document-oriented recall
Extra: mongodb-memory
Environment variables
| Variable | Required | Default | Description |
|---|---|---|---|
MONGODB_ATLAS_CLUSTER_URI | yes | — | MongoDB Atlas connection URI |
MONGODB_DATABASE_NAME | yes | — | MongoDB database name |
MONGODB_COLLECTION_NAME | yes | — | MongoDB collection name |
Examples
retrieve
Requires OPENAI_API_KEY, AWS credentials, and KNOWLEDGE_BASE_ID.
bash
pip install --extra-index-url https://elsai-agents.elsai.ai/root/ elsai-agents==0.3.1
pip install --extra-index-url https://core-packages.elsai.ai/root/ "elsai-model[openai]==2.1.0"
pip install --extra-index-url https://elsai-agents.elsai.ai/root/ elsai-agents-tools==0.3.0python
import os
from elsai import Agent
from elsai.agent import AgentConfig
from elsai_model.openai import OpenAIModel
from elsai_tools.retrieve import retrieve
agent = Agent(
model=OpenAIModel(
model_id="gpt-4o-mini",
client_args={"api_key": os.environ["OPENAI_API_KEY"]},
),
tools=[retrieve],
system_prompt=(
"Use retrieve to search the knowledge base before answering. "
"After using tools, answer the user clearly in plain text."
),
config=AgentConfig(name="rag_assistant"),
)
result = agent("What does our knowledge base say about refunds?")
print(result)mem0_memory
Requires OPENAI_API_KEY, MEM0_API_KEY, and the Mem0 extra. For demos set BYPASS_TOOL_CONSENT=true.
bash
pip install --extra-index-url https://elsai-agents.elsai.ai/root/ elsai-agents==0.3.1
pip install --extra-index-url https://core-packages.elsai.ai/root/ "elsai-model[openai]==2.1.0"
pip install --extra-index-url https://elsai-agents.elsai.ai/root/ "elsai-agents-tools[mem0-memory]==0.3.0"python
import os
from elsai import Agent
from elsai.agent import AgentConfig
from elsai_model.openai import OpenAIModel
from elsai_tools.mem0_memory import mem0_memory
agent = Agent(
model=OpenAIModel(
model_id="gpt-4o-mini",
client_args={"api_key": os.environ["OPENAI_API_KEY"]},
),
tools=[mem0_memory],
system_prompt=(
"Use mem0_memory to store and recall user preferences. "
"After using tools, answer the user clearly in plain text."
),
config=AgentConfig(name="memory_assistant"),
)
result = agent("Remember that my favourite colour is blue, then confirm what you stored.")
print(result)API reference
See RAG and memory API for parameters and import paths.