Overview
What's Included
- Milvus 2.4 Standalone with Docker
- HNSW and IVF indexing for fast similarity search
- PyMilvus Python SDK integration
- Authentication and RBAC enabled
- Prometheus metrics and monitoring
- Separate 20GB EBS data volume
- S3 backup integration ready
Step-by-Step Guide
1
Launch the AMI
Find "Milvus FlowOps" on AWS Marketplace, select your instance type (m5.large minimum), and launch.
# Recommended instance types:
# m5.large (8GB) - Development, up to 500K vectors
# r5.xlarge (32GB) - Production, up to 5M vectors
# r5.2xlarge (64GB) - Large scale, up to 15M vectors
2
Connect and Get Credentials
SSH into your instance and retrieve the auto-generated root password.
ssh -i your-key.pem ubuntu@your-instance-ip
# View credentials
sudo cat /opt/flowops/credentials.txt
# Check Milvus is running (wait ~90 seconds for startup)
curl http://localhost:9091/healthz
3
Create a Collection
Connect with PyMilvus and create your first vector collection.
from pymilvus import connections, Collection, FieldSchema, CollectionSchema, DataType
# Connect to Milvus
connections.connect(host="localhost", port="19530",
user="root", password="your-password")
# Define schema for RAG documents
fields = [
FieldSchema("id", DataType.INT64, is_primary=True, auto_id=True),
FieldSchema("embedding", DataType.FLOAT_VECTOR, dim=1536), # OpenAI dimensions
FieldSchema("text", DataType.VARCHAR, max_length=65535),
FieldSchema("metadata", DataType.JSON)
]
schema = CollectionSchema(fields, "RAG documents")
collection = Collection("documents", schema)
# Create HNSW index for fast search
collection.create_index("embedding", {
"index_type": "HNSW",
"metric_type": "COSINE",
"params": {"M": 16, "efConstruction": 256}
})
4
Insert and Search Vectors
Store document embeddings and perform similarity search.
import openai
def get_embedding(text):
response = openai.embeddings.create(
model="text-embedding-3-small",
input=text
)
return response.data[0].embedding
# Insert documents
docs = [
{"text": "Milvus is a vector database for AI", "metadata": {"source": "docs"}},
{"text": "RAG combines retrieval with generation", "metadata": {"source": "blog"}}
]
embeddings = [get_embedding(d["text"]) for d in docs]
texts = [d["text"] for d in docs]
metadata = [d["metadata"] for d in docs]
collection.insert([embeddings, texts, metadata])
collection.flush()
# Search for similar documents
collection.load()
results = collection.search(
data=[get_embedding("How do I build AI search?")],
anns_field="embedding",
param={"metric_type": "COSINE", "params": {"ef": 64}},
limit=5,
output_fields=["text", "metadata"]
)
for hits in results:
for hit in hits:
print(f"{1-hit.distance:.3f}: {hit.entity.get('text')}")
Comparison
| Feature | Milvus | Pinecone | Weaviate |
|---|---|---|---|
| Open Source | Yes (Apache 2.0) | No | Yes |
| Self-Hosted | Yes | No | Yes |
| Billion Scale | Yes | Yes | Limited |
| Hybrid Search | Yes | Yes | Yes |
| Cost Control | You control | Pay per query | You control |
Use Cases
- Semantic search engines
- RAG (Retrieval-Augmented Generation)
- Recommendation systems
- Image/video similarity search
- Anomaly detection
- Drug discovery
Pricing
Our AMIs are available on AWS Marketplace with simple hourly pricing:
- Software: $0.10-0.15/hour (varies by product)
- EC2: Standard AWS pricing for your chosen instance
- Support: 24/7 included with guaranteed 24-hour response
Need Help?
Our UK-based support team is here to help you get the most out of your deployment. Email us at support@flowopsconsulting.co.uk for any questions.
Comments