From 6f12d74bc712dc8f451e75c72ce6e8f2c09afe90 Mon Sep 17 00:00:00 2001
From: James Briggs <james.briggs@hotmail.com>
Date: Sat, 31 Aug 2024 17:37:06 +0200
Subject: [PATCH] feat: many new docs

---
 .../semantic_router.encoders.AutoEncoder.rst  |   2 +-
 ...antic_router.encoders.base.BaseEncoder.rst |   2 +-
 ...router.encoders.bedrock.BedrockEncoder.rst |   2 +-
 ...antic_router.encoders.bm25.BM25Encoder.rst |   2 +-
 ...antic_router.encoders.clip.CLIPEncoder.rst |   2 +-
 ...c_router.encoders.cohere.CohereEncoder.rst |   2 +-
 ...er.encoders.fastembed.FastEmbedEncoder.rst |   2 +-
 ...c_router.encoders.google.GoogleEncoder.rst |   2 +-
 ...encoders.huggingface.HFEndpointEncoder.rst |   2 +-
 ...ncoders.huggingface.HuggingFaceEncoder.rst |   2 +-
 ...router.encoders.mistral.MistralEncoder.rst |   2 +-
 ...c_router.encoders.openai.OpenAIEncoder.rst |   3 +-
 ...tic_router.encoders.tfidf.TfidfEncoder.rst |   2 +-
 ...emantic_router.encoders.vit.VitEncoder.rst |   2 +-
 ...outer.encoders.zure.AzureOpenAIEncoder.rst |   3 +-
 ...c_router.hybrid_layer.HybridRouteLayer.rst |   2 +-
 .../semantic_router.index.base.BaseIndex.rst  |   4 +-
 ...semantic_router.index.local.LocalIndex.rst |   3 +-
 ...ic_router.index.pinecone.PineconeIndex.rst |   3 +-
 ...c_router.index.pinecone.PineconeRecord.rst |   2 +-
 ....index.postgres.MetricPgVecOperatorMap.rst |  28 ++++
 ...ic_router.index.postgres.PostgresIndex.rst |  65 +++++++++
 ...ter.index.postgres.PostgresIndexRecord.rst |  63 +++++++++
 ...router.index.postgres.clean_route_name.rst |   6 +
 ...tic_router.index.postgres.parse_vector.rst |   6 +
 .../semantic_router.index.postgres.rst        |  41 ++++++
 ...mantic_router.index.qdrant.QdrantIndex.rst |   3 +-
 .../_autosummary/semantic_router.index.rst    |   3 +-
 .../semantic_router.layer.LayerConfig.rst     |   2 +-
 .../semantic_router.layer.RouteLayer.rst      |   2 +-
 .../semantic_router.llms.base.BaseLLM.rst     |   2 +-
 .../semantic_router.llms.cohere.CohereLLM.rst |   2 +-
 ...antic_router.llms.llamacpp.LlamaCppLLM.rst |   2 +-
 ...antic_router.llms.mistral.MistralAILLM.rst |   2 +-
 .../semantic_router.llms.ollama.OllamaLLM.rst |   2 +-
 .../semantic_router.llms.openai.OpenAILLM.rst |   2 +-
 ...c_router.llms.openrouter.OpenRouterLLM.rst |   2 +-
 ...mantic_router.llms.zure.AzureOpenAILLM.rst |   2 +-
 .../semantic_router.route.Route.rst           |   2 +-
 .../semantic_router.schema.DocumentSplit.rst  |   2 +-
 .../semantic_router.schema.EncoderInfo.rst    |   2 +-
 .../semantic_router.schema.EncoderType.rst    |   2 +-
 .../semantic_router.schema.Message.rst        |   2 +-
 .../semantic_router.schema.Metric.rst         |   2 +-
 .../semantic_router.schema.RouteChoice.rst    |   2 +-
 ...tic_router.splitters.base.BaseSplitter.rst |   2 +-
 ...consecutive_sim.ConsecutiveSimSplitter.rst |   2 +-
 ...s.cumulative_sim.CumulativeSimSplitter.rst |   2 +-
 ...s.rolling_window.RollingWindowSplitter.rst |   2 +-
 ...litters.rolling_window.SplitStatistics.rst |   2 +-
 .../semantic_router.text.Conversation.rst     |   2 +-
 ...c_router.utils.defaults.EncoderDefault.rst |   2 +-
 ...ter.utils.function_call.FunctionSchema.rst |  36 +++++
 ...c_router.utils.function_call.Parameter.rst |  48 +++++++
 .../semantic_router.utils.function_call.rst   |  11 +-
 ...ic_router.utils.logger.CustomFormatter.rst |   2 +-
 docs/source/api.rst                           |   9 --
 docs/source/index.rst                         |  16 ++-
 docs/source/route_layer.rst                   | 130 ++++++++++++++++++
 docs/source/route_layer/route_filter.rst      |   5 +
 docs/source/route_layer/sync.rst              |  68 +++++++++
 61 files changed, 570 insertions(+), 64 deletions(-)
 create mode 100644 docs/source/_autosummary/semantic_router.index.postgres.MetricPgVecOperatorMap.rst
 create mode 100644 docs/source/_autosummary/semantic_router.index.postgres.PostgresIndex.rst
 create mode 100644 docs/source/_autosummary/semantic_router.index.postgres.PostgresIndexRecord.rst
 create mode 100644 docs/source/_autosummary/semantic_router.index.postgres.clean_route_name.rst
 create mode 100644 docs/source/_autosummary/semantic_router.index.postgres.parse_vector.rst
 create mode 100644 docs/source/_autosummary/semantic_router.index.postgres.rst
 create mode 100644 docs/source/_autosummary/semantic_router.utils.function_call.FunctionSchema.rst
 create mode 100644 docs/source/_autosummary/semantic_router.utils.function_call.Parameter.rst
 delete mode 100644 docs/source/api.rst
 create mode 100644 docs/source/route_layer.rst
 create mode 100644 docs/source/route_layer/route_filter.rst
 create mode 100644 docs/source/route_layer/sync.rst

diff --git a/docs/source/_autosummary/semantic_router.encoders.AutoEncoder.rst b/docs/source/_autosummary/semantic_router.encoders.AutoEncoder.rst
index 74cf9bec..bd6e51bc 100644
--- a/docs/source/_autosummary/semantic_router.encoders.AutoEncoder.rst
+++ b/docs/source/_autosummary/semantic_router.encoders.AutoEncoder.rst
@@ -1,4 +1,4 @@
-semantic\_router.encoders.AutoEncoder
+semantic\_router.encoders.AutoEncoder
 =====================================
 
 .. currentmodule:: semantic_router.encoders
diff --git a/docs/source/_autosummary/semantic_router.encoders.base.BaseEncoder.rst b/docs/source/_autosummary/semantic_router.encoders.base.BaseEncoder.rst
index 2eab803d..8d9e0e7a 100644
--- a/docs/source/_autosummary/semantic_router.encoders.base.BaseEncoder.rst
+++ b/docs/source/_autosummary/semantic_router.encoders.base.BaseEncoder.rst
@@ -1,4 +1,4 @@
-semantic\_router.encoders.base.BaseEncoder
+semantic\_router.encoders.base.BaseEncoder
 ==========================================
 
 .. currentmodule:: semantic_router.encoders.base
diff --git a/docs/source/_autosummary/semantic_router.encoders.bedrock.BedrockEncoder.rst b/docs/source/_autosummary/semantic_router.encoders.bedrock.BedrockEncoder.rst
index cc8f7e33..ccc1a0ee 100644
--- a/docs/source/_autosummary/semantic_router.encoders.bedrock.BedrockEncoder.rst
+++ b/docs/source/_autosummary/semantic_router.encoders.bedrock.BedrockEncoder.rst
@@ -1,4 +1,4 @@
-semantic\_router.encoders.bedrock.BedrockEncoder
+semantic\_router.encoders.bedrock.BedrockEncoder
 ================================================
 
 .. currentmodule:: semantic_router.encoders.bedrock
diff --git a/docs/source/_autosummary/semantic_router.encoders.bm25.BM25Encoder.rst b/docs/source/_autosummary/semantic_router.encoders.bm25.BM25Encoder.rst
index 2eea5149..7b73d955 100644
--- a/docs/source/_autosummary/semantic_router.encoders.bm25.BM25Encoder.rst
+++ b/docs/source/_autosummary/semantic_router.encoders.bm25.BM25Encoder.rst
@@ -1,4 +1,4 @@
-semantic\_router.encoders.bm25.BM25Encoder
+semantic\_router.encoders.bm25.BM25Encoder
 ==========================================
 
 .. currentmodule:: semantic_router.encoders.bm25
diff --git a/docs/source/_autosummary/semantic_router.encoders.clip.CLIPEncoder.rst b/docs/source/_autosummary/semantic_router.encoders.clip.CLIPEncoder.rst
index 59df55ca..dbc8b5fa 100644
--- a/docs/source/_autosummary/semantic_router.encoders.clip.CLIPEncoder.rst
+++ b/docs/source/_autosummary/semantic_router.encoders.clip.CLIPEncoder.rst
@@ -1,4 +1,4 @@
-semantic\_router.encoders.clip.CLIPEncoder
+semantic\_router.encoders.clip.CLIPEncoder
 ==========================================
 
 .. currentmodule:: semantic_router.encoders.clip
diff --git a/docs/source/_autosummary/semantic_router.encoders.cohere.CohereEncoder.rst b/docs/source/_autosummary/semantic_router.encoders.cohere.CohereEncoder.rst
index b37412df..b8da4ed7 100644
--- a/docs/source/_autosummary/semantic_router.encoders.cohere.CohereEncoder.rst
+++ b/docs/source/_autosummary/semantic_router.encoders.cohere.CohereEncoder.rst
@@ -1,4 +1,4 @@
-semantic\_router.encoders.cohere.CohereEncoder
+semantic\_router.encoders.cohere.CohereEncoder
 ==============================================
 
 .. currentmodule:: semantic_router.encoders.cohere
diff --git a/docs/source/_autosummary/semantic_router.encoders.fastembed.FastEmbedEncoder.rst b/docs/source/_autosummary/semantic_router.encoders.fastembed.FastEmbedEncoder.rst
index bee72bcf..38b220aa 100644
--- a/docs/source/_autosummary/semantic_router.encoders.fastembed.FastEmbedEncoder.rst
+++ b/docs/source/_autosummary/semantic_router.encoders.fastembed.FastEmbedEncoder.rst
@@ -1,4 +1,4 @@
-semantic\_router.encoders.fastembed.FastEmbedEncoder
+semantic\_router.encoders.fastembed.FastEmbedEncoder
 ====================================================
 
 .. currentmodule:: semantic_router.encoders.fastembed
diff --git a/docs/source/_autosummary/semantic_router.encoders.google.GoogleEncoder.rst b/docs/source/_autosummary/semantic_router.encoders.google.GoogleEncoder.rst
index 81b47873..e7f2c435 100644
--- a/docs/source/_autosummary/semantic_router.encoders.google.GoogleEncoder.rst
+++ b/docs/source/_autosummary/semantic_router.encoders.google.GoogleEncoder.rst
@@ -1,4 +1,4 @@
-semantic\_router.encoders.google.GoogleEncoder
+semantic\_router.encoders.google.GoogleEncoder
 ==============================================
 
 .. currentmodule:: semantic_router.encoders.google
diff --git a/docs/source/_autosummary/semantic_router.encoders.huggingface.HFEndpointEncoder.rst b/docs/source/_autosummary/semantic_router.encoders.huggingface.HFEndpointEncoder.rst
index fcef2410..be9a4bca 100644
--- a/docs/source/_autosummary/semantic_router.encoders.huggingface.HFEndpointEncoder.rst
+++ b/docs/source/_autosummary/semantic_router.encoders.huggingface.HFEndpointEncoder.rst
@@ -1,4 +1,4 @@
-semantic\_router.encoders.huggingface.HFEndpointEncoder
+semantic\_router.encoders.huggingface.HFEndpointEncoder
 =======================================================
 
 .. currentmodule:: semantic_router.encoders.huggingface
diff --git a/docs/source/_autosummary/semantic_router.encoders.huggingface.HuggingFaceEncoder.rst b/docs/source/_autosummary/semantic_router.encoders.huggingface.HuggingFaceEncoder.rst
index e78399ab..6a569fc4 100644
--- a/docs/source/_autosummary/semantic_router.encoders.huggingface.HuggingFaceEncoder.rst
+++ b/docs/source/_autosummary/semantic_router.encoders.huggingface.HuggingFaceEncoder.rst
@@ -1,4 +1,4 @@
-semantic\_router.encoders.huggingface.HuggingFaceEncoder
+semantic\_router.encoders.huggingface.HuggingFaceEncoder
 ========================================================
 
 .. currentmodule:: semantic_router.encoders.huggingface
diff --git a/docs/source/_autosummary/semantic_router.encoders.mistral.MistralEncoder.rst b/docs/source/_autosummary/semantic_router.encoders.mistral.MistralEncoder.rst
index e5e8e30a..2b992fb2 100644
--- a/docs/source/_autosummary/semantic_router.encoders.mistral.MistralEncoder.rst
+++ b/docs/source/_autosummary/semantic_router.encoders.mistral.MistralEncoder.rst
@@ -1,4 +1,4 @@
-semantic\_router.encoders.mistral.MistralEncoder
+semantic\_router.encoders.mistral.MistralEncoder
 ================================================
 
 .. currentmodule:: semantic_router.encoders.mistral
diff --git a/docs/source/_autosummary/semantic_router.encoders.openai.OpenAIEncoder.rst b/docs/source/_autosummary/semantic_router.encoders.openai.OpenAIEncoder.rst
index 3a388a84..e5a2f710 100644
--- a/docs/source/_autosummary/semantic_router.encoders.openai.OpenAIEncoder.rst
+++ b/docs/source/_autosummary/semantic_router.encoders.openai.OpenAIEncoder.rst
@@ -1,4 +1,4 @@
-semantic\_router.encoders.openai.OpenAIEncoder
+semantic\_router.encoders.openai.OpenAIEncoder
 ==============================================
 
 .. currentmodule:: semantic_router.encoders.openai
@@ -45,6 +45,7 @@ semantic\_router.encoders.openai.OpenAIEncoder
       ~OpenAIEncoder.dimensions
       ~OpenAIEncoder.token_limit
       ~OpenAIEncoder.type
+      ~OpenAIEncoder.max_retries
       ~OpenAIEncoder.name
       ~OpenAIEncoder.score_threshold
    
diff --git a/docs/source/_autosummary/semantic_router.encoders.tfidf.TfidfEncoder.rst b/docs/source/_autosummary/semantic_router.encoders.tfidf.TfidfEncoder.rst
index 2bed919c..c5e456ba 100644
--- a/docs/source/_autosummary/semantic_router.encoders.tfidf.TfidfEncoder.rst
+++ b/docs/source/_autosummary/semantic_router.encoders.tfidf.TfidfEncoder.rst
@@ -1,4 +1,4 @@
-semantic\_router.encoders.tfidf.TfidfEncoder
+semantic\_router.encoders.tfidf.TfidfEncoder
 ============================================
 
 .. currentmodule:: semantic_router.encoders.tfidf
diff --git a/docs/source/_autosummary/semantic_router.encoders.vit.VitEncoder.rst b/docs/source/_autosummary/semantic_router.encoders.vit.VitEncoder.rst
index 3fe1db29..d32b9207 100644
--- a/docs/source/_autosummary/semantic_router.encoders.vit.VitEncoder.rst
+++ b/docs/source/_autosummary/semantic_router.encoders.vit.VitEncoder.rst
@@ -1,4 +1,4 @@
-semantic\_router.encoders.vit.VitEncoder
+semantic\_router.encoders.vit.VitEncoder
 ========================================
 
 .. currentmodule:: semantic_router.encoders.vit
diff --git a/docs/source/_autosummary/semantic_router.encoders.zure.AzureOpenAIEncoder.rst b/docs/source/_autosummary/semantic_router.encoders.zure.AzureOpenAIEncoder.rst
index d19d5936..da09f956 100644
--- a/docs/source/_autosummary/semantic_router.encoders.zure.AzureOpenAIEncoder.rst
+++ b/docs/source/_autosummary/semantic_router.encoders.zure.AzureOpenAIEncoder.rst
@@ -1,4 +1,4 @@
-semantic\_router.encoders.zure.AzureOpenAIEncoder
+semantic\_router.encoders.zure.AzureOpenAIEncoder
 =================================================
 
 .. currentmodule:: semantic_router.encoders.zure
@@ -49,6 +49,7 @@ semantic\_router.encoders.zure.AzureOpenAIEncoder
       ~AzureOpenAIEncoder.azure_endpoint
       ~AzureOpenAIEncoder.api_version
       ~AzureOpenAIEncoder.model
+      ~AzureOpenAIEncoder.max_retries
       ~AzureOpenAIEncoder.name
       ~AzureOpenAIEncoder.score_threshold
    
diff --git a/docs/source/_autosummary/semantic_router.hybrid_layer.HybridRouteLayer.rst b/docs/source/_autosummary/semantic_router.hybrid_layer.HybridRouteLayer.rst
index f29381ef..39764990 100644
--- a/docs/source/_autosummary/semantic_router.hybrid_layer.HybridRouteLayer.rst
+++ b/docs/source/_autosummary/semantic_router.hybrid_layer.HybridRouteLayer.rst
@@ -1,4 +1,4 @@
-semantic\_router.hybrid\_layer.HybridRouteLayer
+semantic\_router.hybrid\_layer.HybridRouteLayer
 ===============================================
 
 .. currentmodule:: semantic_router.hybrid_layer
diff --git a/docs/source/_autosummary/semantic_router.index.base.BaseIndex.rst b/docs/source/_autosummary/semantic_router.index.base.BaseIndex.rst
index b0b423ea..f99b4b12 100644
--- a/docs/source/_autosummary/semantic_router.index.base.BaseIndex.rst
+++ b/docs/source/_autosummary/semantic_router.index.base.BaseIndex.rst
@@ -1,4 +1,4 @@
-semantic\_router.index.base.BaseIndex
+semantic\_router.index.base.BaseIndex
 =====================================
 
 .. currentmodule:: semantic_router.index.base
@@ -18,6 +18,7 @@ semantic\_router.index.base.BaseIndex
    
       ~BaseIndex.__init__
       ~BaseIndex.add
+      ~BaseIndex.aget_routes
       ~BaseIndex.aquery
       ~BaseIndex.construct
       ~BaseIndex.copy
@@ -26,6 +27,7 @@ semantic\_router.index.base.BaseIndex
       ~BaseIndex.describe
       ~BaseIndex.dict
       ~BaseIndex.from_orm
+      ~BaseIndex.get_routes
       ~BaseIndex.json
       ~BaseIndex.parse_file
       ~BaseIndex.parse_obj
diff --git a/docs/source/_autosummary/semantic_router.index.local.LocalIndex.rst b/docs/source/_autosummary/semantic_router.index.local.LocalIndex.rst
index c6d00026..c38c48e1 100644
--- a/docs/source/_autosummary/semantic_router.index.local.LocalIndex.rst
+++ b/docs/source/_autosummary/semantic_router.index.local.LocalIndex.rst
@@ -1,4 +1,4 @@
-semantic\_router.index.local.LocalIndex
+semantic\_router.index.local.LocalIndex
 =======================================
 
 .. currentmodule:: semantic_router.index.local
@@ -18,6 +18,7 @@ semantic\_router.index.local.LocalIndex
    
       ~LocalIndex.__init__
       ~LocalIndex.add
+      ~LocalIndex.aget_routes
       ~LocalIndex.aquery
       ~LocalIndex.construct
       ~LocalIndex.copy
diff --git a/docs/source/_autosummary/semantic_router.index.pinecone.PineconeIndex.rst b/docs/source/_autosummary/semantic_router.index.pinecone.PineconeIndex.rst
index 6e800738..8cef2726 100644
--- a/docs/source/_autosummary/semantic_router.index.pinecone.PineconeIndex.rst
+++ b/docs/source/_autosummary/semantic_router.index.pinecone.PineconeIndex.rst
@@ -1,4 +1,4 @@
-semantic\_router.index.pinecone.PineconeIndex
+semantic\_router.index.pinecone.PineconeIndex
 =============================================
 
 .. currentmodule:: semantic_router.index.pinecone
@@ -18,6 +18,7 @@ semantic\_router.index.pinecone.PineconeIndex
    
       ~PineconeIndex.__init__
       ~PineconeIndex.add
+      ~PineconeIndex.aget_routes
       ~PineconeIndex.aquery
       ~PineconeIndex.construct
       ~PineconeIndex.copy
diff --git a/docs/source/_autosummary/semantic_router.index.pinecone.PineconeRecord.rst b/docs/source/_autosummary/semantic_router.index.pinecone.PineconeRecord.rst
index cc88ffe4..5c5f8d9a 100644
--- a/docs/source/_autosummary/semantic_router.index.pinecone.PineconeRecord.rst
+++ b/docs/source/_autosummary/semantic_router.index.pinecone.PineconeRecord.rst
@@ -1,4 +1,4 @@
-semantic\_router.index.pinecone.PineconeRecord
+semantic\_router.index.pinecone.PineconeRecord
 ==============================================
 
 .. currentmodule:: semantic_router.index.pinecone
diff --git a/docs/source/_autosummary/semantic_router.index.postgres.MetricPgVecOperatorMap.rst b/docs/source/_autosummary/semantic_router.index.postgres.MetricPgVecOperatorMap.rst
new file mode 100644
index 00000000..99ab2ce2
--- /dev/null
+++ b/docs/source/_autosummary/semantic_router.index.postgres.MetricPgVecOperatorMap.rst
@@ -0,0 +1,28 @@
+semantic\_router.index.postgres.MetricPgVecOperatorMap
+======================================================
+
+.. currentmodule:: semantic_router.index.postgres
+
+.. autoclass:: MetricPgVecOperatorMap
+   :members:
+   :show-inheritance:
+   :inherited-members:
+
+   
+   .. automethod:: __init__
+
+   
+   
+
+   
+   
+   .. rubric:: Attributes
+
+   .. autosummary::
+   
+      ~MetricPgVecOperatorMap.cosine
+      ~MetricPgVecOperatorMap.dotproduct
+      ~MetricPgVecOperatorMap.euclidean
+      ~MetricPgVecOperatorMap.manhattan
+   
+   
\ No newline at end of file
diff --git a/docs/source/_autosummary/semantic_router.index.postgres.PostgresIndex.rst b/docs/source/_autosummary/semantic_router.index.postgres.PostgresIndex.rst
new file mode 100644
index 00000000..3e435938
--- /dev/null
+++ b/docs/source/_autosummary/semantic_router.index.postgres.PostgresIndex.rst
@@ -0,0 +1,65 @@
+semantic\_router.index.postgres.PostgresIndex
+=============================================
+
+.. currentmodule:: semantic_router.index.postgres
+
+.. autoclass:: PostgresIndex
+   :members:
+   :show-inheritance:
+   :inherited-members:
+
+   
+   .. automethod:: __init__
+
+   
+   .. rubric:: Methods
+
+   .. autosummary::
+   
+      ~PostgresIndex.__init__
+      ~PostgresIndex.add
+      ~PostgresIndex.aget_routes
+      ~PostgresIndex.aquery
+      ~PostgresIndex.construct
+      ~PostgresIndex.copy
+      ~PostgresIndex.delete
+      ~PostgresIndex.delete_all
+      ~PostgresIndex.delete_index
+      ~PostgresIndex.describe
+      ~PostgresIndex.dict
+      ~PostgresIndex.from_orm
+      ~PostgresIndex.get_routes
+      ~PostgresIndex.json
+      ~PostgresIndex.parse_file
+      ~PostgresIndex.parse_obj
+      ~PostgresIndex.parse_raw
+      ~PostgresIndex.query
+      ~PostgresIndex.schema
+      ~PostgresIndex.schema_json
+      ~PostgresIndex.setup_index
+      ~PostgresIndex.update_forward_refs
+      ~PostgresIndex.validate
+   
+   
+
+   
+   
+   .. rubric:: Attributes
+
+   .. autosummary::
+   
+      ~PostgresIndex.connection_string
+      ~PostgresIndex.index_prefix
+      ~PostgresIndex.index_name
+      ~PostgresIndex.dimensions
+      ~PostgresIndex.metric
+      ~PostgresIndex.namespace
+      ~PostgresIndex.conn
+      ~PostgresIndex.type
+      ~PostgresIndex.index
+      ~PostgresIndex.routes
+      ~PostgresIndex.utterances
+      ~PostgresIndex.init_async_index
+      ~PostgresIndex.sync
+   
+   
\ No newline at end of file
diff --git a/docs/source/_autosummary/semantic_router.index.postgres.PostgresIndexRecord.rst b/docs/source/_autosummary/semantic_router.index.postgres.PostgresIndexRecord.rst
new file mode 100644
index 00000000..85408f38
--- /dev/null
+++ b/docs/source/_autosummary/semantic_router.index.postgres.PostgresIndexRecord.rst
@@ -0,0 +1,63 @@
+semantic\_router.index.postgres.PostgresIndexRecord
+===================================================
+
+.. currentmodule:: semantic_router.index.postgres
+
+.. autoclass:: PostgresIndexRecord
+   :members:
+   :show-inheritance:
+   :inherited-members:
+
+   
+   .. automethod:: __init__
+
+   
+   .. rubric:: Methods
+
+   .. autosummary::
+   
+      ~PostgresIndexRecord.__init__
+      ~PostgresIndexRecord.construct
+      ~PostgresIndexRecord.copy
+      ~PostgresIndexRecord.dict
+      ~PostgresIndexRecord.from_orm
+      ~PostgresIndexRecord.json
+      ~PostgresIndexRecord.model_construct
+      ~PostgresIndexRecord.model_copy
+      ~PostgresIndexRecord.model_dump
+      ~PostgresIndexRecord.model_dump_json
+      ~PostgresIndexRecord.model_json_schema
+      ~PostgresIndexRecord.model_parametrized_name
+      ~PostgresIndexRecord.model_post_init
+      ~PostgresIndexRecord.model_rebuild
+      ~PostgresIndexRecord.model_validate
+      ~PostgresIndexRecord.model_validate_json
+      ~PostgresIndexRecord.model_validate_strings
+      ~PostgresIndexRecord.parse_file
+      ~PostgresIndexRecord.parse_obj
+      ~PostgresIndexRecord.parse_raw
+      ~PostgresIndexRecord.schema
+      ~PostgresIndexRecord.schema_json
+      ~PostgresIndexRecord.to_dict
+      ~PostgresIndexRecord.update_forward_refs
+      ~PostgresIndexRecord.validate
+   
+   
+
+   
+   
+   .. rubric:: Attributes
+
+   .. autosummary::
+   
+      ~PostgresIndexRecord.model_computed_fields
+      ~PostgresIndexRecord.model_config
+      ~PostgresIndexRecord.model_extra
+      ~PostgresIndexRecord.model_fields
+      ~PostgresIndexRecord.model_fields_set
+      ~PostgresIndexRecord.id
+      ~PostgresIndexRecord.route
+      ~PostgresIndexRecord.utterance
+      ~PostgresIndexRecord.vector
+   
+   
\ No newline at end of file
diff --git a/docs/source/_autosummary/semantic_router.index.postgres.clean_route_name.rst b/docs/source/_autosummary/semantic_router.index.postgres.clean_route_name.rst
new file mode 100644
index 00000000..326bac5a
--- /dev/null
+++ b/docs/source/_autosummary/semantic_router.index.postgres.clean_route_name.rst
@@ -0,0 +1,6 @@
+semantic\_router.index.postgres.clean\_route\_name
+==================================================
+
+.. currentmodule:: semantic_router.index.postgres
+
+.. autofunction:: clean_route_name
\ No newline at end of file
diff --git a/docs/source/_autosummary/semantic_router.index.postgres.parse_vector.rst b/docs/source/_autosummary/semantic_router.index.postgres.parse_vector.rst
new file mode 100644
index 00000000..ba1b2b2a
--- /dev/null
+++ b/docs/source/_autosummary/semantic_router.index.postgres.parse_vector.rst
@@ -0,0 +1,6 @@
+semantic\_router.index.postgres.parse\_vector
+=============================================
+
+.. currentmodule:: semantic_router.index.postgres
+
+.. autofunction:: parse_vector
\ No newline at end of file
diff --git a/docs/source/_autosummary/semantic_router.index.postgres.rst b/docs/source/_autosummary/semantic_router.index.postgres.rst
new file mode 100644
index 00000000..3bfef78a
--- /dev/null
+++ b/docs/source/_autosummary/semantic_router.index.postgres.rst
@@ -0,0 +1,41 @@
+semantic\_router.index.postgres
+===============================
+
+.. automodule:: semantic_router.index.postgres
+  
+   
+   
+   
+
+   
+   
+   .. rubric:: Functions
+
+   .. autosummary::
+      :toctree:
+   
+      clean_route_name
+      parse_vector
+   
+   
+
+   
+   
+   .. rubric:: Classes
+
+   .. autosummary::
+      :toctree:
+      :template: custom-class-template.rst
+   
+      MetricPgVecOperatorMap
+      PostgresIndex
+      PostgresIndexRecord
+   
+   
+
+   
+   
+   
+
+
+
diff --git a/docs/source/_autosummary/semantic_router.index.qdrant.QdrantIndex.rst b/docs/source/_autosummary/semantic_router.index.qdrant.QdrantIndex.rst
index 87379ade..bc1dd782 100644
--- a/docs/source/_autosummary/semantic_router.index.qdrant.QdrantIndex.rst
+++ b/docs/source/_autosummary/semantic_router.index.qdrant.QdrantIndex.rst
@@ -1,4 +1,4 @@
-semantic\_router.index.qdrant.QdrantIndex
+semantic\_router.index.qdrant.QdrantIndex
 =========================================
 
 .. currentmodule:: semantic_router.index.qdrant
@@ -18,6 +18,7 @@ semantic\_router.index.qdrant.QdrantIndex
    
       ~QdrantIndex.__init__
       ~QdrantIndex.add
+      ~QdrantIndex.aget_routes
       ~QdrantIndex.aquery
       ~QdrantIndex.construct
       ~QdrantIndex.convert_metric
diff --git a/docs/source/_autosummary/semantic_router.index.rst b/docs/source/_autosummary/semantic_router.index.rst
index 7925fbdd..e48fb383 100644
--- a/docs/source/_autosummary/semantic_router.index.rst
+++ b/docs/source/_autosummary/semantic_router.index.rst
@@ -1,4 +1,4 @@
-semantic\_router.index
+semantic\_router.index
 ======================
 
 .. automodule:: semantic_router.index
@@ -31,5 +31,6 @@ semantic\_router.index
    semantic_router.index.base
    semantic_router.index.local
    semantic_router.index.pinecone
+   semantic_router.index.postgres
    semantic_router.index.qdrant
 
diff --git a/docs/source/_autosummary/semantic_router.layer.LayerConfig.rst b/docs/source/_autosummary/semantic_router.layer.LayerConfig.rst
index e477eea5..b49febe2 100644
--- a/docs/source/_autosummary/semantic_router.layer.LayerConfig.rst
+++ b/docs/source/_autosummary/semantic_router.layer.LayerConfig.rst
@@ -1,4 +1,4 @@
-semantic\_router.layer.LayerConfig
+semantic\_router.layer.LayerConfig
 ==================================
 
 .. currentmodule:: semantic_router.layer
diff --git a/docs/source/_autosummary/semantic_router.layer.RouteLayer.rst b/docs/source/_autosummary/semantic_router.layer.RouteLayer.rst
index 11c02875..4acccc89 100644
--- a/docs/source/_autosummary/semantic_router.layer.RouteLayer.rst
+++ b/docs/source/_autosummary/semantic_router.layer.RouteLayer.rst
@@ -1,4 +1,4 @@
-semantic\_router.layer.RouteLayer
+semantic\_router.layer.RouteLayer
 =================================
 
 .. currentmodule:: semantic_router.layer
diff --git a/docs/source/_autosummary/semantic_router.llms.base.BaseLLM.rst b/docs/source/_autosummary/semantic_router.llms.base.BaseLLM.rst
index b53d0116..cac8beae 100644
--- a/docs/source/_autosummary/semantic_router.llms.base.BaseLLM.rst
+++ b/docs/source/_autosummary/semantic_router.llms.base.BaseLLM.rst
@@ -1,4 +1,4 @@
-semantic\_router.llms.base.BaseLLM
+semantic\_router.llms.base.BaseLLM
 ==================================
 
 .. currentmodule:: semantic_router.llms.base
diff --git a/docs/source/_autosummary/semantic_router.llms.cohere.CohereLLM.rst b/docs/source/_autosummary/semantic_router.llms.cohere.CohereLLM.rst
index a7422525..3281652c 100644
--- a/docs/source/_autosummary/semantic_router.llms.cohere.CohereLLM.rst
+++ b/docs/source/_autosummary/semantic_router.llms.cohere.CohereLLM.rst
@@ -1,4 +1,4 @@
-semantic\_router.llms.cohere.CohereLLM
+semantic\_router.llms.cohere.CohereLLM
 ======================================
 
 .. currentmodule:: semantic_router.llms.cohere
diff --git a/docs/source/_autosummary/semantic_router.llms.llamacpp.LlamaCppLLM.rst b/docs/source/_autosummary/semantic_router.llms.llamacpp.LlamaCppLLM.rst
index 055a6536..d7c86b28 100644
--- a/docs/source/_autosummary/semantic_router.llms.llamacpp.LlamaCppLLM.rst
+++ b/docs/source/_autosummary/semantic_router.llms.llamacpp.LlamaCppLLM.rst
@@ -1,4 +1,4 @@
-semantic\_router.llms.llamacpp.LlamaCppLLM
+semantic\_router.llms.llamacpp.LlamaCppLLM
 ==========================================
 
 .. currentmodule:: semantic_router.llms.llamacpp
diff --git a/docs/source/_autosummary/semantic_router.llms.mistral.MistralAILLM.rst b/docs/source/_autosummary/semantic_router.llms.mistral.MistralAILLM.rst
index a865730b..1f8db49d 100644
--- a/docs/source/_autosummary/semantic_router.llms.mistral.MistralAILLM.rst
+++ b/docs/source/_autosummary/semantic_router.llms.mistral.MistralAILLM.rst
@@ -1,4 +1,4 @@
-semantic\_router.llms.mistral.MistralAILLM
+semantic\_router.llms.mistral.MistralAILLM
 ==========================================
 
 .. currentmodule:: semantic_router.llms.mistral
diff --git a/docs/source/_autosummary/semantic_router.llms.ollama.OllamaLLM.rst b/docs/source/_autosummary/semantic_router.llms.ollama.OllamaLLM.rst
index 0538d2e7..0dcaa469 100644
--- a/docs/source/_autosummary/semantic_router.llms.ollama.OllamaLLM.rst
+++ b/docs/source/_autosummary/semantic_router.llms.ollama.OllamaLLM.rst
@@ -1,4 +1,4 @@
-semantic\_router.llms.ollama.OllamaLLM
+semantic\_router.llms.ollama.OllamaLLM
 ======================================
 
 .. currentmodule:: semantic_router.llms.ollama
diff --git a/docs/source/_autosummary/semantic_router.llms.openai.OpenAILLM.rst b/docs/source/_autosummary/semantic_router.llms.openai.OpenAILLM.rst
index c203c2b2..42e834e4 100644
--- a/docs/source/_autosummary/semantic_router.llms.openai.OpenAILLM.rst
+++ b/docs/source/_autosummary/semantic_router.llms.openai.OpenAILLM.rst
@@ -1,4 +1,4 @@
-semantic\_router.llms.openai.OpenAILLM
+semantic\_router.llms.openai.OpenAILLM
 ======================================
 
 .. currentmodule:: semantic_router.llms.openai
diff --git a/docs/source/_autosummary/semantic_router.llms.openrouter.OpenRouterLLM.rst b/docs/source/_autosummary/semantic_router.llms.openrouter.OpenRouterLLM.rst
index 71060394..8024ce20 100644
--- a/docs/source/_autosummary/semantic_router.llms.openrouter.OpenRouterLLM.rst
+++ b/docs/source/_autosummary/semantic_router.llms.openrouter.OpenRouterLLM.rst
@@ -1,4 +1,4 @@
-semantic\_router.llms.openrouter.OpenRouterLLM
+semantic\_router.llms.openrouter.OpenRouterLLM
 ==============================================
 
 .. currentmodule:: semantic_router.llms.openrouter
diff --git a/docs/source/_autosummary/semantic_router.llms.zure.AzureOpenAILLM.rst b/docs/source/_autosummary/semantic_router.llms.zure.AzureOpenAILLM.rst
index c94ac8e0..f3d341e8 100644
--- a/docs/source/_autosummary/semantic_router.llms.zure.AzureOpenAILLM.rst
+++ b/docs/source/_autosummary/semantic_router.llms.zure.AzureOpenAILLM.rst
@@ -1,4 +1,4 @@
-semantic\_router.llms.zure.AzureOpenAILLM
+semantic\_router.llms.zure.AzureOpenAILLM
 =========================================
 
 .. currentmodule:: semantic_router.llms.zure
diff --git a/docs/source/_autosummary/semantic_router.route.Route.rst b/docs/source/_autosummary/semantic_router.route.Route.rst
index 4a5f3449..24b32600 100644
--- a/docs/source/_autosummary/semantic_router.route.Route.rst
+++ b/docs/source/_autosummary/semantic_router.route.Route.rst
@@ -1,4 +1,4 @@
-semantic\_router.route.Route
+semantic\_router.route.Route
 ============================
 
 .. currentmodule:: semantic_router.route
diff --git a/docs/source/_autosummary/semantic_router.schema.DocumentSplit.rst b/docs/source/_autosummary/semantic_router.schema.DocumentSplit.rst
index f2e556fa..2a25758d 100644
--- a/docs/source/_autosummary/semantic_router.schema.DocumentSplit.rst
+++ b/docs/source/_autosummary/semantic_router.schema.DocumentSplit.rst
@@ -1,4 +1,4 @@
-semantic\_router.schema.DocumentSplit
+semantic\_router.schema.DocumentSplit
 =====================================
 
 .. currentmodule:: semantic_router.schema
diff --git a/docs/source/_autosummary/semantic_router.schema.EncoderInfo.rst b/docs/source/_autosummary/semantic_router.schema.EncoderInfo.rst
index bff52290..cedf4088 100644
--- a/docs/source/_autosummary/semantic_router.schema.EncoderInfo.rst
+++ b/docs/source/_autosummary/semantic_router.schema.EncoderInfo.rst
@@ -1,4 +1,4 @@
-semantic\_router.schema.EncoderInfo
+semantic\_router.schema.EncoderInfo
 ===================================
 
 .. currentmodule:: semantic_router.schema
diff --git a/docs/source/_autosummary/semantic_router.schema.EncoderType.rst b/docs/source/_autosummary/semantic_router.schema.EncoderType.rst
index 3f69d026..64fdb558 100644
--- a/docs/source/_autosummary/semantic_router.schema.EncoderType.rst
+++ b/docs/source/_autosummary/semantic_router.schema.EncoderType.rst
@@ -1,4 +1,4 @@
-semantic\_router.schema.EncoderType
+semantic\_router.schema.EncoderType
 ===================================
 
 .. currentmodule:: semantic_router.schema
diff --git a/docs/source/_autosummary/semantic_router.schema.Message.rst b/docs/source/_autosummary/semantic_router.schema.Message.rst
index 184c7e85..2f8a893a 100644
--- a/docs/source/_autosummary/semantic_router.schema.Message.rst
+++ b/docs/source/_autosummary/semantic_router.schema.Message.rst
@@ -1,4 +1,4 @@
-semantic\_router.schema.Message
+semantic\_router.schema.Message
 ===============================
 
 .. currentmodule:: semantic_router.schema
diff --git a/docs/source/_autosummary/semantic_router.schema.Metric.rst b/docs/source/_autosummary/semantic_router.schema.Metric.rst
index d7904b2b..f7fd0535 100644
--- a/docs/source/_autosummary/semantic_router.schema.Metric.rst
+++ b/docs/source/_autosummary/semantic_router.schema.Metric.rst
@@ -1,4 +1,4 @@
-semantic\_router.schema.Metric
+semantic\_router.schema.Metric
 ==============================
 
 .. currentmodule:: semantic_router.schema
diff --git a/docs/source/_autosummary/semantic_router.schema.RouteChoice.rst b/docs/source/_autosummary/semantic_router.schema.RouteChoice.rst
index 79c627d2..f9249dfa 100644
--- a/docs/source/_autosummary/semantic_router.schema.RouteChoice.rst
+++ b/docs/source/_autosummary/semantic_router.schema.RouteChoice.rst
@@ -1,4 +1,4 @@
-semantic\_router.schema.RouteChoice
+semantic\_router.schema.RouteChoice
 ===================================
 
 .. currentmodule:: semantic_router.schema
diff --git a/docs/source/_autosummary/semantic_router.splitters.base.BaseSplitter.rst b/docs/source/_autosummary/semantic_router.splitters.base.BaseSplitter.rst
index 4e8f3f11..274f88f9 100644
--- a/docs/source/_autosummary/semantic_router.splitters.base.BaseSplitter.rst
+++ b/docs/source/_autosummary/semantic_router.splitters.base.BaseSplitter.rst
@@ -1,4 +1,4 @@
-semantic\_router.splitters.base.BaseSplitter
+semantic\_router.splitters.base.BaseSplitter
 ============================================
 
 .. currentmodule:: semantic_router.splitters.base
diff --git a/docs/source/_autosummary/semantic_router.splitters.consecutive_sim.ConsecutiveSimSplitter.rst b/docs/source/_autosummary/semantic_router.splitters.consecutive_sim.ConsecutiveSimSplitter.rst
index 5a464951..b955aefb 100644
--- a/docs/source/_autosummary/semantic_router.splitters.consecutive_sim.ConsecutiveSimSplitter.rst
+++ b/docs/source/_autosummary/semantic_router.splitters.consecutive_sim.ConsecutiveSimSplitter.rst
@@ -1,4 +1,4 @@
-semantic\_router.splitters.consecutive\_sim.ConsecutiveSimSplitter
+semantic\_router.splitters.consecutive\_sim.ConsecutiveSimSplitter
 ==================================================================
 
 .. currentmodule:: semantic_router.splitters.consecutive_sim
diff --git a/docs/source/_autosummary/semantic_router.splitters.cumulative_sim.CumulativeSimSplitter.rst b/docs/source/_autosummary/semantic_router.splitters.cumulative_sim.CumulativeSimSplitter.rst
index 7b990209..f3f5217b 100644
--- a/docs/source/_autosummary/semantic_router.splitters.cumulative_sim.CumulativeSimSplitter.rst
+++ b/docs/source/_autosummary/semantic_router.splitters.cumulative_sim.CumulativeSimSplitter.rst
@@ -1,4 +1,4 @@
-semantic\_router.splitters.cumulative\_sim.CumulativeSimSplitter
+semantic\_router.splitters.cumulative\_sim.CumulativeSimSplitter
 ================================================================
 
 .. currentmodule:: semantic_router.splitters.cumulative_sim
diff --git a/docs/source/_autosummary/semantic_router.splitters.rolling_window.RollingWindowSplitter.rst b/docs/source/_autosummary/semantic_router.splitters.rolling_window.RollingWindowSplitter.rst
index 48e6d57f..8be63f50 100644
--- a/docs/source/_autosummary/semantic_router.splitters.rolling_window.RollingWindowSplitter.rst
+++ b/docs/source/_autosummary/semantic_router.splitters.rolling_window.RollingWindowSplitter.rst
@@ -1,4 +1,4 @@
-semantic\_router.splitters.rolling\_window.RollingWindowSplitter
+semantic\_router.splitters.rolling\_window.RollingWindowSplitter
 ================================================================
 
 .. currentmodule:: semantic_router.splitters.rolling_window
diff --git a/docs/source/_autosummary/semantic_router.splitters.rolling_window.SplitStatistics.rst b/docs/source/_autosummary/semantic_router.splitters.rolling_window.SplitStatistics.rst
index be102ef7..f2dd8877 100644
--- a/docs/source/_autosummary/semantic_router.splitters.rolling_window.SplitStatistics.rst
+++ b/docs/source/_autosummary/semantic_router.splitters.rolling_window.SplitStatistics.rst
@@ -1,4 +1,4 @@
-semantic\_router.splitters.rolling\_window.SplitStatistics
+semantic\_router.splitters.rolling\_window.SplitStatistics
 ==========================================================
 
 .. currentmodule:: semantic_router.splitters.rolling_window
diff --git a/docs/source/_autosummary/semantic_router.text.Conversation.rst b/docs/source/_autosummary/semantic_router.text.Conversation.rst
index 07921466..adfaf88b 100644
--- a/docs/source/_autosummary/semantic_router.text.Conversation.rst
+++ b/docs/source/_autosummary/semantic_router.text.Conversation.rst
@@ -1,4 +1,4 @@
-semantic\_router.text.Conversation
+semantic\_router.text.Conversation
 ==================================
 
 .. currentmodule:: semantic_router.text
diff --git a/docs/source/_autosummary/semantic_router.utils.defaults.EncoderDefault.rst b/docs/source/_autosummary/semantic_router.utils.defaults.EncoderDefault.rst
index 47d8b21f..a1babfa0 100644
--- a/docs/source/_autosummary/semantic_router.utils.defaults.EncoderDefault.rst
+++ b/docs/source/_autosummary/semantic_router.utils.defaults.EncoderDefault.rst
@@ -1,4 +1,4 @@
-semantic\_router.utils.defaults.EncoderDefault
+semantic\_router.utils.defaults.EncoderDefault
 ==============================================
 
 .. currentmodule:: semantic_router.utils.defaults
diff --git a/docs/source/_autosummary/semantic_router.utils.function_call.FunctionSchema.rst b/docs/source/_autosummary/semantic_router.utils.function_call.FunctionSchema.rst
new file mode 100644
index 00000000..32cbf6b5
--- /dev/null
+++ b/docs/source/_autosummary/semantic_router.utils.function_call.FunctionSchema.rst
@@ -0,0 +1,36 @@
+semantic\_router.utils.function\_call.FunctionSchema
+====================================================
+
+.. currentmodule:: semantic_router.utils.function_call
+
+.. autoclass:: FunctionSchema
+   :members:
+   :show-inheritance:
+   :inherited-members:
+
+   
+   .. automethod:: __init__
+
+   
+   .. rubric:: Methods
+
+   .. autosummary::
+   
+      ~FunctionSchema.__init__
+      ~FunctionSchema.to_ollama
+   
+   
+
+   
+   
+   .. rubric:: Attributes
+
+   .. autosummary::
+   
+      ~FunctionSchema.description
+      ~FunctionSchema.name
+      ~FunctionSchema.output
+      ~FunctionSchema.parameters
+      ~FunctionSchema.signature
+   
+   
\ No newline at end of file
diff --git a/docs/source/_autosummary/semantic_router.utils.function_call.Parameter.rst b/docs/source/_autosummary/semantic_router.utils.function_call.Parameter.rst
new file mode 100644
index 00000000..60c5a243
--- /dev/null
+++ b/docs/source/_autosummary/semantic_router.utils.function_call.Parameter.rst
@@ -0,0 +1,48 @@
+semantic\_router.utils.function\_call.Parameter
+===============================================
+
+.. currentmodule:: semantic_router.utils.function_call
+
+.. autoclass:: Parameter
+   :members:
+   :show-inheritance:
+   :inherited-members:
+
+   
+   .. automethod:: __init__
+
+   
+   .. rubric:: Methods
+
+   .. autosummary::
+   
+      ~Parameter.__init__
+      ~Parameter.construct
+      ~Parameter.copy
+      ~Parameter.dict
+      ~Parameter.from_orm
+      ~Parameter.json
+      ~Parameter.parse_file
+      ~Parameter.parse_obj
+      ~Parameter.parse_raw
+      ~Parameter.schema
+      ~Parameter.schema_json
+      ~Parameter.to_ollama
+      ~Parameter.update_forward_refs
+      ~Parameter.validate
+   
+   
+
+   
+   
+   .. rubric:: Attributes
+
+   .. autosummary::
+   
+      ~Parameter.name
+      ~Parameter.description
+      ~Parameter.type
+      ~Parameter.default
+      ~Parameter.required
+   
+   
\ No newline at end of file
diff --git a/docs/source/_autosummary/semantic_router.utils.function_call.rst b/docs/source/_autosummary/semantic_router.utils.function_call.rst
index 7df22f9a..5c2a6961 100644
--- a/docs/source/_autosummary/semantic_router.utils.function_call.rst
+++ b/docs/source/_autosummary/semantic_router.utils.function_call.rst
@@ -1,4 +1,4 @@
-semantic\_router.utils.function\_call
+semantic\_router.utils.function\_call
 =====================================
 
 .. automodule:: semantic_router.utils.function_call
@@ -23,6 +23,15 @@ semantic\_router.utils.function\_call
 
    
    
+   .. rubric:: Classes
+
+   .. autosummary::
+      :toctree:
+      :template: custom-class-template.rst
+   
+      FunctionSchema
+      Parameter
+   
    
 
    
diff --git a/docs/source/_autosummary/semantic_router.utils.logger.CustomFormatter.rst b/docs/source/_autosummary/semantic_router.utils.logger.CustomFormatter.rst
index cf6971d8..3ad99855 100644
--- a/docs/source/_autosummary/semantic_router.utils.logger.CustomFormatter.rst
+++ b/docs/source/_autosummary/semantic_router.utils.logger.CustomFormatter.rst
@@ -1,4 +1,4 @@
-semantic\_router.utils.logger.CustomFormatter
+semantic\_router.utils.logger.CustomFormatter
 =============================================
 
 .. currentmodule:: semantic_router.utils.logger
diff --git a/docs/source/api.rst b/docs/source/api.rst
deleted file mode 100644
index 7ddaf33c..00000000
--- a/docs/source/api.rst
+++ /dev/null
@@ -1,9 +0,0 @@
-API
-===
-
-.. autosummary::
-   :toctree: _autosummary
-   :template: custom-module-template.rst
-   :recursive:
-
-   semantic_router
\ No newline at end of file
diff --git a/docs/source/index.rst b/docs/source/index.rst
index 79780592..2f233085 100644
--- a/docs/source/index.rst
+++ b/docs/source/index.rst
@@ -1,6 +1,15 @@
 Semantic Router documentation
 =============================
 
+.. toctree::
+   :hidden:
+   :maxdepth: 2
+
+   Home page <self>
+   Quickstart <quickstart>
+   Route Layer <route_layer>
+   API reference <_autosummary/semantic_router>
+
 Semantic Router is a superfast decision-making layer for your LLMs and agents. Rather than waiting for slow LLM generations to make tool-use decisions, we use the magic of semantic vector space to make those decisions — *routing* our requests using *semantic* meaning.
 
 Integrations
@@ -10,10 +19,3 @@ The *encoders* of semantic router include easy-to-use integrations with `Cohere
 
 Our utterance vector space also integrates with `Pinecone <https://github.com/aurelio-labs/semantic-router/blob/main/docs/indexes/pinecone.ipynb>`_ and `Qdrant <https://github.com/aurelio-labs/semantic-router/blob/main/docs/indexes/qdrant.ipynb>`_!
 
-.. toctree::
-   :hidden:
-
-   Home page <self>
-   Quickstart <quickstart>
-   Jupyter tutorials <tutorials>
-   API reference <_autosummary/semantic_router>
diff --git a/docs/source/route_layer.rst b/docs/source/route_layer.rst
new file mode 100644
index 00000000..04d23af5
--- /dev/null
+++ b/docs/source/route_layer.rst
@@ -0,0 +1,130 @@
+Route Layer
+===========
+
+The `RouteLayer` is the main class of the semantic router. It is responsible
+for making decisions about which route to take based on an input utterance.
+A `RouteLayer` consists of an `encoder`, an `index`, and a list of `routes`.
+Route layers that include dynamic routes (i.e. routes that can generate dynamic
+decision outputs) also include an `llm`.
+
+.. toctree::
+   :hidden:
+   :maxdepth: 2
+   :glob:
+
+   route_layer/*
+
+To use a `RouteLayer` we first need some `routes`. We can initialize them like
+so:
+
+.. code-block:: python
+
+    from semantic_router import Route
+
+    politics = Route(
+        name="politics",
+        utterances=[
+            "isn't politics the best thing ever",
+            "why don't you tell me about your political opinions",
+            "don't you just love the president",
+            "don't you just hate the president",
+            "they're going to destroy this country!",
+            "they will save the country!",
+        ],
+    )
+
+    chitchat = Route(
+        name="chitchat",
+        utterances=[
+            "how's the weather today?",
+            "how are things going?",
+            "lovely weather today",
+            "the weather is horrendous",
+            "let's go to the chippy",
+        ],
+    )
+
+We initialize an encoder — there are many options available here, from local
+to API-based. For now we'll use the `OpenAIEncoder`.
+
+.. code-block:: python
+
+    import os
+    from semantic_router.encoders import OpenAIEncoder
+
+    os.environ["OPENAI_API_KEY"] = "<YOUR_API_KEY>"
+
+    encoder = OpenAIEncoder()
+
+Now we define the `RouteLayer`. When called, the route layer will consume text
+(a query) and output the category (`Route`) it belongs to — to initialize a
+`RouteLayer` we need our `encoder` model and a list of `routes`.
+
+.. code-block:: python
+
+    from semantic_router.layer import RouteLayer
+
+    rl = RouteLayer(encoder=encoder, routes=routes)
+
+Now we can call the `RouteLayer` with an input query:
+
+.. code-block:: python
+
+    rl("don't you love politics?")
+
+.. code-block:: none
+
+    [Out]: RouteChoice(name='politics', function_call=None, similarity_score=None)
+
+The output is a `RouteChoice` object, which contains the name of the route,
+the function call (if any), and the similarity score that triggered the route
+choice.
+
+We can try another query:
+
+.. code-block:: python
+
+    rl("how's the weather today?")
+
+.. code-block:: none
+
+    [Out]: RouteChoice(name='chitchat', function_call=None, similarity_score=None)
+
+Both are classified accurately, what if we send a query that is unrelated to
+our existing Route objects?
+
+.. code-block:: python
+
+    rl("I'm interested in learning about llama 3")
+
+.. code-block:: none
+
+    [Out]: RouteChoice(name=None, function_call=None, similarity_score=None)
+
+In this case, the `RouteLayer` is unable to find a route that matches the
+input query and so returns a `RouteChoice` with `name=None`.
+
+We can also retrieve multiple routes with their associated score using
+`retrieve_multiple_routes`:
+
+.. code-block:: python
+
+    rl.retrieve_multiple_routes("Hi! How are you doing in politics??")
+
+.. code-block:: none
+
+    [Out]: [RouteChoice(name='politics', function_call=None, similarity_score=0.859),
+            RouteChoice(name='chitchat', function_call=None, similarity_score=0.835)]
+
+If `retrieve_multiple_routes` is called with a query that does not match any
+routes, it will return an empty list:
+
+.. code-block:: python
+
+    rl.retrieve_multiple_routes("I'm interested in learning about llama 3")
+
+.. code-block:: none
+
+    [Out]: []
+
+You can find an introductory notebook for the [route layer here](https://github.com/aurelio-labs/semantic-router/blob/main/docs/00-introduction.ipynb).
diff --git a/docs/source/route_layer/route_filter.rst b/docs/source/route_layer/route_filter.rst
new file mode 100644
index 00000000..e4e43c2b
--- /dev/null
+++ b/docs/source/route_layer/route_filter.rst
@@ -0,0 +1,5 @@
+Calling the Route Layer
+=======================
+
+You can use the `route_filter` parameter with a list of route names to filter
+the routes that will be considered.
\ No newline at end of file
diff --git a/docs/source/route_layer/sync.rst b/docs/source/route_layer/sync.rst
new file mode 100644
index 00000000..ee471dc2
--- /dev/null
+++ b/docs/source/route_layer/sync.rst
@@ -0,0 +1,68 @@
+Synchronizing with Remote Instances
+===================================
+
+Semantic router supports several *remote instances* that store our routes and
+utterances, such as Pinecone or Qdrant, supported via the `PineconeIndex` and
+`QdrantIndex` respectively.
+
+Using these remote instances is optional, but it allows us to scale our
+semantic router to a larger number of routes and utterances. However, we must
+decide how to synchronize between our local metadata and the remote instance —
+particularly when reinitializing a local instance that should connect to an
+existing remote instance.
+
+Semantic router supports several synchronization strategies that can be passed
+to the `sync` parameter of the various `BaseIndex` objects. Those strategies
+are:
+
+* `error`: Raise an error if local and remote are not synchronized.
+* `remote`: Take remote as the source of truth and update local to align.
+* `local`: Take local as the source of truth and update remote to align.
+* `merge-force-remote`: Merge both local and remote taking only remote routes
+  utterances when a route with same route name is present both locally and
+  remotely.
+* `merge-force-local`: Merge both local and remote taking only local routes
+  utterances when a route with same route name is present both locally and
+  remotely.
+* `merge`: Merge both local and remote, merging also local and remote utterances
+  when a route with same route name is present both locally and remotely.
+
+You can try this yourself by running the following:
+
+.. code-block:: python
+
+    from semantic_router import Route
+    from semantic_router.encoders import OpenAIEncoder
+    from semantic_router.index.pinecone import PineconeIndex
+    from semantic_router.layer import RouteLayer
+
+
+    politics = Route(
+        name="politics",
+        utterances=[
+            "isn't politics the best thing ever",
+            "why don't you tell me about your political opinions",
+            "don't you just love the president",
+        ],
+    )
+
+    chitchat = Route(
+        name="chitchat",
+        utterances=[
+            "how's the weather today?",
+            "how are things going?",
+        ],
+    )
+
+    routes = [politics, chitchat]
+
+    encoder = OpenAIEncoder(openai_api_key=openai_api_key)
+
+    pc_index = PineconeIndex(
+        api_key=pinecone_api_key,
+        region="us-east-1",
+        index_name="sync-example",
+        sync="local",  # here we specify the synchronization strategy
+    )
+
+    rl = RouteLayer(encoder=encoder, routes=routes, index=pc_index)
-- 
GitLab