Skip to content

The graphiti is not working propley with initial setup #353

@Vildnex

Description

@Vildnex

I tried to get the graphiti and add it to the Cursor IDE by following the steps below, but I couldn't make it work properly. I am not sure if this is a bug or if I forgot to miss configure something even if I followed the documentation.

Steps:

  • clone the repo git clone https://github.com/getzep/graphiti
  • go to repo cd graphiti
  • go to mcp server cd mcp_server
  • create an .env file with mv .env.example .env
  • The first .env configuration that I've tried is:
OPENAI_API_KEY='<MY_SECRET_KEY>'
NEO4J_URI='bolt://localhost:7687'
NEO4J_PORT=7687
NEO4J_USER='neo4j'
NEO4J_PASSWORD='demodemo'
  • running the docker-compose file with podman (using docker-podman) via podman compose up -d
  • Adding the custom rules to the Cursor IDE
  • Adding the MCP config to my Cursor:
{
  "mcpServers": {
    "graphiti": {
      "transport": "sse",
      "url": "http://localhost:8000/sse"
    }
  }
}

After all of those were done, I asked Cursor to do something, but it couldn't add the information to the actual graph. Below are the logs from the graffiti container.

LOG:

2025-04-15 06:42:03,133 - neo4j.notifications - INFO - Received notification from DBMS server: {severity: INFORMATION} {code: Neo.ClientNotification.Schema.IndexOrConstraintAlreadyExists} {category: SCHEMA} {title: `CREATE FULLTEXT INDEX edge_name_and_fact IF NOT EXISTS FOR ()-[e:RELATES_TO]-() ON EACH [e.name, e.fact, e.group_id]` has no effect.} {description: `FULLTEXT INDEX edge_name_and_fact FOR ()-[e:RELATES_TO]-() ON EACH [e.name, e.fact, e.group_id]` already exists.} {position: None} for query: 'CREATE FULLTEXT INDEX edge_name_and_fact IF NOT EXISTS \n        FOR ()-[e:RELATES_TO]-() ON EACH [e.name, e.fact, e.group_id]'
2025-04-15 06:42:03,136 - __main__ - INFO - Graphiti client initialized successfully
2025-04-15 06:42:03,136 - __main__ - INFO - Using OpenAI model: gpt-4.1-mini
2025-04-15 06:42:03,136 - __main__ - INFO - Using temperature: 0.0
2025-04-15 06:42:03,136 - __main__ - INFO - Using group_id: graph_46c747cd
2025-04-15 06:42:03,136 - __main__ - INFO - Custom entity extraction: disabled
2025-04-15 06:42:03,136 - __main__ - INFO - Starting MCP server with transport: sse
2025-04-15 06:42:03,136 - __main__ - INFO - Running MCP server with SSE transport on 0.0.0.0:8000
INFO:     Started server process [5]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
INFO:     10.89.0.3:53622 - "GET /sse HTTP/1.1" 200 OK
INFO:     10.89.0.3:53628 - "GET /sse HTTP/1.1" 200 OK
INFO:     10.89.0.3:35736 - "POST /messages/?session_id=000c82cf56f54d92bc89f55fc6e3e62c HTTP/1.1" 202 Accepted
ERROR:    Exception in ASGI application
  + Exception Group Traceback (most recent call last):
  |   File "/app/.venv/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 403, in run_asgi
  |     result = await app(  # type: ignore[func-returns-value]
  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/app/.venv/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
  |     return await self.app(scope, receive, send)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/app/.venv/lib/python3.11/site-packages/starlette/applications.py", line 112, in __call__
  |     await self.middleware_stack(scope, receive, send)
  |   File "/app/.venv/lib/python3.11/site-packages/starlette/middleware/errors.py", line 187, in __call__
  |     raise exc
  |   File "/app/.venv/lib/python3.11/site-packages/starlette/middleware/errors.py", line 165, in __call__
  |     await self.app(scope, receive, _send)
  |   File "/app/.venv/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
  |     await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  |   File "/app/.venv/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
  |     raise exc
  |   File "/app/.venv/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
  |     await app(scope, receive, sender)
  |   File "/app/.venv/lib/python3.11/site-packages/starlette/routing.py", line 714, in __call__
  |     await self.middleware_stack(scope, receive, send)
  |   File "/app/.venv/lib/python3.11/site-packages/starlette/routing.py", line 734, in app
  |     await route.handle(scope, receive, send)
  |   File "/app/.venv/lib/python3.11/site-packages/starlette/routing.py", line 288, in handle
  |     await self.app(scope, receive, send)
  |   File "/app/.venv/lib/python3.11/site-packages/starlette/routing.py", line 76, in app
  |     await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  |   File "/app/.venv/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
  |     raise exc
  |   File "/app/.venv/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
  |     await app(scope, receive, sender)
  |   File "/app/.venv/lib/python3.11/site-packages/starlette/routing.py", line 73, in app
  |     response = await f(request)
  |                ^^^^^^^^^^^^^^^^
  |   File "/app/.venv/lib/python3.11/site-packages/mcp/server/fastmcp/server.py", line 485, in handle_sse
  |     async with sse.connect_sse(
  |   File "/usr/local/lib/python3.11/contextlib.py", line 231, in __aexit__
  |     await self.gen.athrow(typ, value, traceback)
  |   File "/app/.venv/lib/python3.11/site-packages/mcp/server/sse.py", line 123, in connect_sse
  |     async with anyio.create_task_group() as tg:
  |   File "/app/.venv/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 772, in __aexit__
  |     raise BaseExceptionGroup(
  | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
  +-+---------------- 1 ----------------
    | Exception Group Traceback (most recent call last):
    |   File "/app/.venv/lib/python3.11/site-packages/mcp/server/sse.py", line 131, in connect_sse
    |     yield (read_stream, write_stream)
    |   File "/app/.venv/lib/python3.11/site-packages/mcp/server/fastmcp/server.py", line 490, in handle_sse
    |     await self._mcp_server.run(
    |   File "/app/.venv/lib/python3.11/site-packages/mcp/server/lowlevel/server.py", line 483, in run
    |     async with AsyncExitStack() as stack:
    |   File "/usr/local/lib/python3.11/contextlib.py", line 745, in __aexit__
    |     raise exc_details[1]
    |   File "/usr/local/lib/python3.11/contextlib.py", line 728, in __aexit__
    |     cb_suppress = await cb(*exc_details)
    |                   ^^^^^^^^^^^^^^^^^^^^^^
    |   File "/app/.venv/lib/python3.11/site-packages/mcp/shared/session.py", line 210, in __aexit__
    |     return await self._task_group.__aexit__(exc_type, exc_val, exc_tb)
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/app/.venv/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 772, in __aexit__
    |     raise BaseExceptionGroup(
    | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
    +-+---------------- 1 ----------------
      | Traceback (most recent call last):
      |   File "/app/.venv/lib/python3.11/site-packages/mcp/shared/session.py", line 324, in _receive_loop
      |     await self._received_request(responder)
      |   File "/app/.venv/lib/python3.11/site-packages/mcp/server/session.py", line 163, in _received_request
      |     raise RuntimeError(
      | RuntimeError: Received request before initialization was complete
      +------------------------------------
INFO:     10.89.0.3:35740 - "POST /messages/?session_id=000c82cf56f54d92bc89f55fc6e3e62c HTTP/1.1" 202 Accepted
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/app/.venv/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 403, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/starlette/applications.py", line 112, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/app/.venv/lib/python3.11/site-packages/starlette/middleware/errors.py", line 187, in __call__
    raise exc
  File "/app/.venv/lib/python3.11/site-packages/starlette/middleware/errors.py", line 165, in __call__
    await self.app(scope, receive, _send)
  File "/app/.venv/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/app/.venv/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    raise exc
  File "/app/.venv/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
    await app(scope, receive, sender)
  File "/app/.venv/lib/python3.11/site-packages/starlette/routing.py", line 714, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/app/.venv/lib/python3.11/site-packages/starlette/routing.py", line 734, in app
    await route.handle(scope, receive, send)
  File "/app/.venv/lib/python3.11/site-packages/starlette/routing.py", line 460, in handle
    await self.app(scope, receive, send)
  File "/app/.venv/lib/python3.11/site-packages/mcp/server/sse.py", line 175, in handle_post_message
    await writer.send(message)
  File "/app/.venv/lib/python3.11/site-packages/anyio/streams/memory.py", line 242, in send
    self.send_nowait(item)
  File "/app/.venv/lib/python3.11/site-packages/anyio/streams/memory.py", line 213, in send_nowait
    raise BrokenResourceError
anyio.BrokenResourceError
INFO:     10.89.0.3:35752 - "GET /sse HTTP/1.1" 200 OK

OpenRouter config:

I've also tried with the openrouter as a provider instead of openai with the following configuration:

OPENAI_API_KEY='<MY SCRETE KEY>'
OPENAI_BASE_URL='https://openrouter.ai/api/v1'
NEO4J_URI='bolt://localhost:7687'
NEO4J_PORT=7687
NEO4J_USER='neo4j'
NEO4J_PASSWORD='demodemo'
MODEL_NAME='deepseek/deepseek-chat-v3-0324'

I will ask the cursor to do the same task, and now I will have those logs:

LOG:

2025-04-15 06:33:44,931 - __main__ - INFO - Graphiti client initialized successfully
2025-04-15 06:33:44,931 - __main__ - INFO - Using OpenAI model: deepseek/deepseek-chat-v3-0324
2025-04-15 06:33:44,931 - __main__ - INFO - Using temperature: 0.0
2025-04-15 06:33:44,931 - __main__ - INFO - Using group_id: graph_9907a5c9
2025-04-15 06:33:44,931 - __main__ - INFO - Custom entity extraction: disabled
2025-04-15 06:33:44,931 - __main__ - INFO - Starting MCP server with transport: sse
2025-04-15 06:33:44,931 - __main__ - INFO - Running MCP server with SSE transport on 0.0.0.0:8000
INFO:     Started server process [4]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
INFO:     10.89.0.4:36508 - "GET /sse HTTP/1.1" 200 OK
INFO:     10.89.0.4:36518 - "GET /sse HTTP/1.1" 200 OK
INFO:     10.89.0.4:54826 - "POST /messages/?session_id=4c263d705f324155b0b0e5ce4bb58408 HTTP/1.1" 202 Accepted
ERROR:    Exception in ASGI application
  + Exception Group Traceback (most recent call last):
  |   File "/app/.venv/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 403, in run_asgi
  |     result = await app(  # type: ignore[func-returns-value]
  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/app/.venv/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
  |     return await self.app(scope, receive, send)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/app/.venv/lib/python3.11/site-packages/starlette/applications.py", line 112, in __call__
  |     await self.middleware_stack(scope, receive, send)
  |   File "/app/.venv/lib/python3.11/site-packages/starlette/middleware/errors.py", line 187, in __call__
  |     raise exc
  |   File "/app/.venv/lib/python3.11/site-packages/starlette/middleware/errors.py", line 165, in __call__
  |     await self.app(scope, receive, _send)
  |   File "/app/.venv/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
  |     await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  |   File "/app/.venv/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
  |     raise exc
  |   File "/app/.venv/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
  |     await app(scope, receive, sender)
  |   File "/app/.venv/lib/python3.11/site-packages/starlette/routing.py", line 714, in __call__
  |     await self.middleware_stack(scope, receive, send)
  |   File "/app/.venv/lib/python3.11/site-packages/starlette/routing.py", line 734, in app
  |     await route.handle(scope, receive, send)
  |   File "/app/.venv/lib/python3.11/site-packages/starlette/routing.py", line 288, in handle
  |     await self.app(scope, receive, send)
  |   File "/app/.venv/lib/python3.11/site-packages/starlette/routing.py", line 76, in app
  |     await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  |   File "/app/.venv/lib/python3.11/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
  |     raise exc
  |   File "/app/.venv/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
  |     await app(scope, receive, sender)
  |   File "/app/.venv/lib/python3.11/site-packages/starlette/routing.py", line 73, in app
  |     response = await f(request)
  |                ^^^^^^^^^^^^^^^^
  |   File "/app/.venv/lib/python3.11/site-packages/mcp/server/fastmcp/server.py", line 485, in handle_sse
  |     async with sse.connect_sse(
  |   File "/usr/local/lib/python3.11/contextlib.py", line 231, in __aexit__
  |     await self.gen.athrow(typ, value, traceback)
  |   File "/app/.venv/lib/python3.11/site-packages/mcp/server/sse.py", line 123, in connect_sse
  |     async with anyio.create_task_group() as tg:
  |   File "/app/.venv/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 772, in __aexit__
  |     raise BaseExceptionGroup(
  | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
  +-+---------------- 1 ----------------
    | Exception Group Traceback (most recent call last):
    |   File "/app/.venv/lib/python3.11/site-packages/mcp/server/sse.py", line 131, in connect_sse
    |     yield (read_stream, write_stream)
    |   File "/app/.venv/lib/python3.11/site-packages/mcp/server/fastmcp/server.py", line 490, in handle_sse
    |     await self._mcp_server.run(
    |   File "/app/.venv/lib/python3.11/site-packages/mcp/server/lowlevel/server.py", line 483, in run
    |     async with AsyncExitStack() as stack:
    |   File "/usr/local/lib/python3.11/contextlib.py", line 745, in __aexit__
    |     raise exc_details[1]
    |   File "/usr/local/lib/python3.11/contextlib.py", line 728, in __aexit__
    |     cb_suppress = await cb(*exc_details)
    |                   ^^^^^^^^^^^^^^^^^^^^^^
    |   File "/app/.venv/lib/python3.11/site-packages/mcp/shared/session.py", line 210, in __aexit__
    |     return await self._task_group.__aexit__(exc_type, exc_val, exc_tb)
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/app/.venv/lib/python3.11/site-packages/anyio/_backends/_asyncio.py", line 772, in __aexit__
    |     raise BaseExceptionGroup(
    | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
    +-+---------------- 1 ----------------
      | Traceback (most recent call last):
      |   File "/app/.venv/lib/python3.11/site-packages/mcp/shared/session.py", line 324, in _receive_loop
      |     await self._received_request(responder)
      |   File "/app/.venv/lib/python3.11/site-packages/mcp/server/session.py", line 163, in _received_request
      |     raise RuntimeError(
      | RuntimeError: Received request before initialization was complete
      +------------------------------------
INFO:     10.89.0.4:40484 - "GET /sse HTTP/1.1" 200 OK

Did I miss something when I configured it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions