Building a Sci-Fi Movie RAG Agent in ~60 Lines of TypeScript
mastra_ai · reddit · 2026-08-28
Mastra integrated native Elasticsearch vector support to build a RAG agent over 500 sci-fi movies using 60 lines of TypeScript.
Core Flow:
User query → Agent decides search → vectorQueryTool → Elasticsearch → retrieved chunks → answer.
Key Details:
- Memory in one line: new Memory() provides conversation context.
- Swappable retrieval: Works across Elasticsearch, PgVector, Pinecone, etc.
- Agent-controlled retrieval: Retrieval is a tool, not a hardcoded step, keeping code clean.
- Backend agnostic: The agent doesn't care if the backend uses vector, hybrid search, or reranking.
More from coding & agent
- Nanjing Univ. Releases Procedura: Agentic 3D Modeling with Procedural Control — nanjinguniv · 2026-08-28
- Agent tool calls fail silently with no traces, breaking production pipelines — Icy-Weakness8310 · 2026-08-28
- Helm MCP: Give AI assistants access to real Helm chart data, stop hallucinations — modelcontextprotocol · 2026-08-28
- SymPy Sandbox MCP: Secure symbolic math computation for LLMs via SymPy — modelcontextprotocol · 2026-08-28
- Survey on LLM Agent Evaluation: Taxonomy and Enterprise Challenges — kalyan_kpl · 2026-08-28
- Use gpt-image-2 to generate benchmarks for builds without real-world complements — mattshumer_ · 2026-08-28