{"id":29016511,"url":"https://github.com/memgraph/genai-stack","last_synced_at":"2025-06-25T22:30:33.026Z","repository":{"id":241508493,"uuid":"804797272","full_name":"memgraph/genai-stack","owner":"memgraph","description":"A template for building GenAI applications with Memgraph.","archived":false,"fork":false,"pushed_at":"2025-01-30T14:15:09.000Z","size":197,"stargazers_count":5,"open_issues_count":1,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-30T15:26:38.840Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/memgraph.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-05-23T09:36:57.000Z","updated_at":"2025-01-30T14:15:09.000Z","dependencies_parsed_at":"2024-06-05T11:02:45.759Z","dependency_job_id":null,"html_url":"https://github.com/memgraph/genai-stack","commit_stats":null,"previous_names":["memgraph/genai-stack"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/memgraph/genai-stack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memgraph%2Fgenai-stack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memgraph%2Fgenai-stack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memgraph%2Fgenai-stack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memgraph%2Fgenai-stack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/memgraph","download_url":"https://codeload.github.com/memgraph/genai-stack/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/memgraph%2Fgenai-stack/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261962050,"owners_count":23236859,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-25T22:30:31.892Z","updated_at":"2025-06-25T22:30:32.987Z","avatar_url":"https://github.com/memgraph.png","language":"Python","readme":"# Memgraph GenAI Stack\n**Docker Compose + FastAPI + LangChain + Ollama + Memgraph**\n\nThis demo is a template for building GenAI applications with Memgraph.\n\n## App architecture\n\n![genai-stack](./memgraph-gen-ai-stack.png)\n\n## Dataset \nIn order for schema to be generated, a dataset needs to be loaded in Memgraph before the application is started. The Game of Thrones dataset is preloaded in this demo. To preload your own dataset, update the `dataset.cypherl` file.\nThe first three lines in the CYPHERL file are there, so the data doesn't reload on each run. (`STORAGE MODE IN_MEMORY_ANALYTICAL; DROP GRAPH; STORAGE MODE IN_MEMORY_TRANSACTIONAL;`)\n\n## Start the app\n\nTo utilize `GPT-4` model, create the `.env` file in the root directory and set your OpenAI API key:\n```\nOPENAI_API_KEY=\u003cYOUR_OPENAI_API_KEY\u003e\n``` \n\nRun the app:\n```\ndocker compose up\n```\n\nThis demo offers querying Memgraph with the natural language via LangChain utilizing two different models:\n\n- [GPT-4](#ask-memgraph-with-gpt-4)\n- [Llama 3](#ask-memgraph-with-llama-3)\n\n### Ask Memgraph with GPT-4\n\nAsk Memgraph with GPT-4 model:\n```\ncurl -X POST \"http://localhost:8000/ask/gpt\" -H \"Content-Type: application/json\" -d '{\"question\": \"How many seasons there are?\"}'\n```\n\nHere is the response:\n```\n{\"question\":\"How many seasons there are?\",\"response\":\"There are 8 seasons.\"}% \n```\n\n### Ask Memgraph with Llama 3\n\nAsk Memgraph with Llama3 model:\n```\ncurl -X POST \"http://localhost:8000/ask/llama\" -H \"Content-Type: application/json\" -d '{\"question\": \"How many seasons there are?\"}' \n```\n\nHere is the response:\n```\n{\"question\":\"How many seasons there are?\",\"response\":\"There are 8 seasons.\"}% \n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmemgraph%2Fgenai-stack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmemgraph%2Fgenai-stack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmemgraph%2Fgenai-stack/lists"}