You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: shiksha-api/durable-functions/README.md
+38-4Lines changed: 38 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,9 +25,21 @@ The application consists of the following components:
25
25
26
26
## RAG Agent Strategies
27
27
28
-
The system supports two distinct Retrieval-Augmented Generation (RAG) strategies for content generation:
28
+
The system supports multiple Retrieval-Augmented Generation (RAG) strategies for content generation, including:
29
29
30
-
### Vector Index RAG Agent (`VectorIndexRAGAgent`)
30
+
31
+
### Qdrant RAG Agent (`QdrantRAGAgent`)
32
+
33
+
-**Strategy**: Uses Qdrant vector database for scalable, production-grade vector search and retrieval
34
+
-**Implementation**: Integrates with `QdrantRagOps` for querying Qdrant collections
35
+
-**Best for**: Large-scale, high-performance semantic search and retrieval tasks
36
+
-**How it works**:
37
+
- The agent parses the `index_path` to determine the Qdrant collection and metadata filter
38
+
- Uses Azure OpenAI for both embedding and completion
39
+
- Queries Qdrant for relevant content using vector similarity and metadata filtering
40
+
- Handles structured JSON responses and robust error handling
41
+
42
+
### Vector Index RAG Agent (Data store- Azure Blob) (`VectorIndexRAGAgent`)
31
43
32
44
-**Strategy**: Traditional vector-based retrieval using similarity search
33
45
-**Implementation**: Uses `InMemRagOps` from the rag-wrapper library
@@ -37,7 +49,8 @@ The system supports two distinct Retrieval-Augmented Generation (RAG) strategies
37
49
- Queries are embedded and matched against document vectors using cosine similarity
38
50
- Most relevant content is retrieved based on semantic similarity
39
51
40
-
### Graph Index RAG Agent (`GraphIndexRAGAgent`)
52
+
53
+
### Graph Index RAG Agent (Data store- Azure Blob) (`GraphIndexRAGAgent`)
41
54
42
55
-**Strategy**: Property graph-based retrieval with entity and relationship awareness
43
56
-**Implementation**: Uses `InMemGraphRagOps` from the rag-wrapper library
@@ -47,12 +60,27 @@ The system supports two distinct Retrieval-Augmented Generation (RAG) strategies
47
60
- Enables sophisticated reasoning over interconnected concepts
48
61
- Supports complex queries that require understanding of entity relationships
49
62
50
-
Both agents inherit from `BaseAzureBlobRAGAgent` which provides:
63
+
64
+
#### RAG agents with Azure blob as data store inherit `BaseAzureBlobRAGAgent` which provides:
51
65
52
66
- Azure OpenAI integration with structured JSON response formatting
53
67
- Blob storage management for downloading and caching RAG indexes
54
68
- Resource cleanup and error handling
55
69
70
+
## Agent Pool
71
+
72
+
The `AgentPool` class manages singleton instances of all agent types, ensuring efficient resource usage and consistent access throughout the application.
73
+
74
+
-**Purpose**: Centralized factory and cache for all agent instances (GPT, RAG, Validator, etc.)
75
+
-**Features**:
76
+
- Prevents duplicate instantiation of agents
77
+
- Supports multiple RAG agent types (Qdrant, Vector, Graph) based on identifier
78
+
- Provides methods to clear and reset agent resources
79
+
-**Usage**:
80
+
-`AgentPool.get_rag_agent(identifier)`: Returns the correct RAG agent instance for the given index/identifier
81
+
-`AgentPool.get_gpt_agent()`: Returns the singleton GPT agent
82
+
-`AgentPool.clear_rag_agent_resources(identifier)`: Clears resources for a specific RAG agent
83
+
56
84
## Lesson Plan Creation Flow
57
85
58
86
The lesson plan generation follows a sophisticated workflow orchestration pattern using Directed Acyclic Graphs (DAGs) for optimal parallel execution:
@@ -108,12 +136,18 @@ The lesson plan generation follows a sophisticated workflow orchestration patter
108
136
109
137
#### Generation Agents
110
138
139
+
111
140
-**`BaseAzureBlobRAGAgent`**: Abstract base class for RAG agents
141
+
-**`QdrantRAGAgent`**: Qdrant vector database-based content retrieval (see details above)
0 commit comments