Chatea con tus documentos
De un documento puedes hacerle preguntas a la IA sobre el mismo como si fuera una conversación
+2
graph TD
%%{init: {'theme': 'mc','layout': 'elk'}}%%
ChatOutput-s3yx9[<div><img src="/_astro/messages-square.BaSDmT6g.svg" style="height: 20px !important;width: 20px !important"/></div>Chat Output]
style ChatOutput-s3yx9 stroke:#a170ff
ChatInput-nbeu2[<div><img src="/_astro/messages-square.BaSDmT6g.svg" style="height: 20px !important;width: 20px !important"/></div>Pregunta]
style ChatInput-nbeu2 stroke:#a170ff
GDriveFilesComponent-ield1[<div><img src="/_astro/google_drive.wKmDsV2c.svg" style="height: 20px !important;width: 20px !important"/></div>Obtener documento]
style GDriveFilesComponent-ield1 stroke:#a170ff
OpenAIEmbeddings-8lgaa[<div><img src="/_astro/openAI.BhmuxEs3.svg" style="height: 20px !important;width: 20px !important"/></div>OpenAI Embeddings]
style OpenAIEmbeddings-8lgaa stroke:#a170ff
LanguageRecursiveTextSplitter-60k4u[Separador de texto]
style LanguageRecursiveTextSplitter-60k4u stroke:#a170ff
AdvancedAgent-8vhpf[Agent]
style AdvancedAgent-8vhpf stroke:#a170ff
OpenAIModel-1ec5c[<div><img src="/_astro/openAI.BhmuxEs3.svg" style="height: 20px !important;width: 20px !important"/></div>OpenAI]
style OpenAIModel-1ec5c stroke:#a170ff
AstraDB-0wxah[Astra DB2]
style AstraDB-0wxah stroke:#a170ff
RetrieverTool-9ghrj[<div><img src="/_astro/langchain-icon.BXtvU_nA.svg" style="height: 20px !important;width: 20px !important"/></div>RetrieverTool]
style RetrieverTool-9ghrj stroke:#a170ff
AstraDB-jjmpw[Astra DB]
style AstraDB-jjmpw stroke:#a170ff
OpenAIEmbeddings-m1or6[<div><img src="/_astro/openAI.BhmuxEs3.svg" style="height: 20px !important;width: 20px !important"/></div>OpenAI Embeddings2]
style OpenAIEmbeddings-m1or6 stroke:#a170ff
GDriveFilesComponent-ield1 -.- LanguageRecursiveTextSplitter-60k4u
linkStyle 0 stroke:#a170ff
ChatInput-nbeu2 -.- AdvancedAgent-8vhpf
linkStyle 1 stroke:#a170ff
AdvancedAgent-8vhpf -.- ChatOutput-s3yx9
linkStyle 2 stroke:#a170ff
OpenAIModel-1ec5c -.- AdvancedAgent-8vhpf
linkStyle 3 stroke:#a170ff
LanguageRecursiveTextSplitter-60k4u -.- AstraDB-0wxah
linkStyle 4 stroke:#a170ff
OpenAIEmbeddings-8lgaa -.- AstraDB-0wxah
linkStyle 5 stroke:#a170ff
RetrieverTool-9ghrj -.- AdvancedAgent-8vhpf
linkStyle 6 stroke:#a170ff
AstraDB-jjmpw -.- RetrieverTool-9ghrj
linkStyle 7 stroke:#a170ff
OpenAIEmbeddings-m1or6 -.- AstraDB-jjmpw
linkStyle 8 stroke:#a170ff
Chatea con tus documentos (Chat with Your Documents)
🧩 Overview
This workflow enables users to interact conversationally with their documents using an AI assistant. It automates the process of retrieving and processing documents from Google Drive, creating a searchable knowledge base, and allowing users to ask questions in natural language. The AI agent then provides answers based exclusively on the content found within the provided documents, ensuring responses are grounded in the source material.
⚙️ Main Features
- Enables a conversational interface for querying document content.
- Automatically ingests and processes documents from Google Drive into a vector database.
- Uses a retrieval-augmented generation (RAG) agent to find relevant information before formulating an answer.
- Provides a dedicated tool for the agent to search the document knowledge base on-demand.
🔄 Workflow Steps
| Component Name | Role in the Workflow | Key Inputs | Key Outputs |
|---|---|---|---|
| Get Document | Retrieves the target document file from a specified Google Drive location. | Selected file from Google Drive. | Document file data. |
| Text Splitter | Splits the retrieved document into smaller, manageable chunks of text for processing. | Document data. | Chunks of text data. |
| OpenAI Embeddings | Generates vector embeddings (numerical representations) for the text chunks. | Embedding model configuration. | Embedding model. |
| Astra DB (Ingestion) | Stores the text chunks and their corresponding vector embeddings in a vector database to create a searchable knowledge base. | Text chunks and the embedding model. | Populated vector store. |
| OpenAI Embeddings (Query) | Generates vector embeddings for user queries to enable semantic search. | Embedding model configuration. | Embedding model for queries. |
| Astra DB (Retriever) | Creates a retriever interface to search the vector database for content relevant to a user's question. | Embedding model and collection name. | Document retriever. |
| Retriever Tool | Wraps the document retriever into a tool that the AI agent can call to find information. | Document retriever, tool name, and description. | Search tool for the agent. |
| OpenAI Model | Provides the core language model that powers the AI agent's reasoning and response generation. | Model configuration (e.g., GPT-4.1-mini). | Language model instance. |
| Question | Captures the user's natural language question to be processed by the workflow. | User's input text. | Formatted message for the agent. |
| Agent | The central AI agent that orchestrates the response. It uses the provided tools (like the retriever) and the language model to answer the user's question based on the documents. | User's question, language model, system prompt, and tools. | AI-generated response message. |
| Chat Output | Displays the final, formatted answer from the AI agent back to the user in the chat interface. | Agent's response message. | Displayed chat message. |
🧠 Notes
- The workflow is designed for a question-and-answer interaction model where the AI's responses are strictly based on the ingested document content.
- It requires valid API credentials for OpenAI (for the language model and embeddings) and Astra DB (for the vector database).
- The system prompt instructs the agent to always use its retrieval tool ("datospararesponder") to find information before answering, preventing hallucinations.
- The initial document ingestion and vector storage is a one-time setup step; subsequent queries operate on the pre-built knowledge base.