How hdz65/ai-server works
Project type and purpose
• This is a NestJS–based backend “AI server” that exposes HTTP endpoints, integrates with an Ollama LLM process, and performs Retrieval-Augmented Generation (RAG) using an embeddings store and markdown utilities.
File structure
• Top‐level files: Nest config (nest-cli.json, tsconfig.json), lint/prettier, package.json.
• src/main.ts boots the Nest application.
• src/app.*: global AppModule, AppController & AppService (example “health check” or root endpoint).
• src/ollama: OllamaModule, OllamaController (exposes LLM endpoints), OllamaService (invokes the Ollama binary/HTTP API).
• src/rag: rag/embeddings.store.ts (manages vector store of embeddings), rag/markdown.ts (prepares docs for RAG pipeline).
• src/utils: md.ts (shared markdown parsing/utility functions).
• test/: E2E tests for API.
Detailed breakdown to capture essential elements
→ sends → External: Ollama LLM Server
← receives text ←
← receives vectors ←
← receives raw markdown ←
• (Optionally) show Test Suite hitting endpoints via Nest TestingModule