Sophia AI - Setup
Overview
Sophia is exclusively available as a managed service through RESTHeart Cloud in the dedicated tier. As a cloud service, there’s no software installation or infrastructure setup required on your end. This guide covers the essential configuration steps needed to set up your knowledge base and optimize Sophia for your organization.
Getting Started
1. RESTHeart Cloud Account
-
Sign up for RESTHeart Cloud with Sophia service enabled
-
Access your Sophia dashboard through the RESTHeart Cloud portal
-
Your Sophia instance is automatically provisioned and ready to use
2. AWS Bedrock Access Configuration
Required: Sophia requires AWS Bedrock access to provide AI responses. You must configure this before using the service:
Step 1: Create AWS IAM Policy
Create a custom managed policy named InvokeBedrockModel
:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "InvokeBedrockModel",
"Effect": "Allow",
"Action": [
"bedrock:InvokeModel",
"bedrock:InvokeModelWithResponseStream"
],
"Resource": "arn:aws:bedrock:*::foundation-model/*"
}
]
}
Step 2: Create AWS IAM User
-
Create a new IAM user dedicated to Sophia
-
Attach the
InvokeBedrockModel
policy to this user -
Generate access keys for the user
Step 3: Configure Sophia
-
In your Sophia dashboard, navigate to AWS Configuration
-
Enter your AWS Access Key ID and Secret Access Key
-
Select your preferred AWS region (must support Bedrock)
-
Test the connection to ensure proper access
3. Knowledge Base Setup
Once AWS Bedrock access is configured, set up your knowledge base:
-
Upload Documents: Add your organization’s documents through the admin interface
-
Configure Access: Set up user permissions and content tagging
-
Test Queries: Verify your knowledge base responds accurately
MongoDB Vector Index Configuration
For optimal document search performance, Sophia requires a vector search index on your knowledge base documents. You need to create the vector index on Mongo Atlas.
Vector Index Structure
The vector index enables semantic search across your documents. Here’s the standard configuration used by Sophia:
{
"name": "vector_index",
"fields": [
{
"numDimensions": 1536,
"path": "vector",
"similarity": "cosine",
"type": "vector"
},
{
"path": "metadata.tags",
"type": "filter"
}
]
}
Index Components
Vector Field
-
numDimensions: 1536
(matches Claude embedding dimensions) -
similarity: Cosine
similarity for document matching -
path: "vector"
field containing document embeddings
Filter Field
-
path: "metadata.tags"
for content access control -
type: "filter"
enables tag-based document filtering
Creating the Index
If you need to manually create or update the vector index:
Via MongoDB Atlas UI
-
Navigate to your MongoDB Atlas cluster
-
Go to "Search" → "Search Indexes"
-
Click "Create Search Index"
-
Select "JSON Editor"
-
Paste the vector index configuration above
-
Set index name as "vector_index"
-
Apply to the "textSegments" collection
Via MongoDB Compass
-
Connect to your MongoDB cluster
-
Navigate to the "textSegments" collection
-
Go to "Indexes" tab
-
Click "Create Index"
-
Use the index configuration provided above